-
Notifications
You must be signed in to change notification settings - Fork 7
Troubleshooting
Common issues and solutions for PCART.
Problem: Python 3.9+ is required
Solution: Ensure you are using Python 3.9 or higher:
python --versionProblem: ModuleNotFoundError: No module named 'dill'
Solution: Install dill in your environments:
pip install dillProblem: JSONDecodeError when running PCART
Solution:
- Ensure your JSON is valid (no trailing commas, proper quotes)
- Use a JSON validator to check your configuration file
- On Windows, use double backslashes (
\\) or forward slashes (/) in paths
Problem: FileNotFoundError: Project path does not exist
Solution:
- Verify
projPathis an absolute path, not relative - Check that the path exists on your filesystem
- On Windows, ensure backslashes are properly escaped in JSON
Problem: Virtual environment path does not exist
Solution:
- Verify
currentEnvandtargetEnvpaths are correct - Use full absolute paths to virtual environment root directories, not the Python executable
- On Windows, PCART looks for
python.exeat<env>/python.exeand<env>/Scripts/python.exe
Problem: UnsupportedRunCommand or command execution fails with "not found"
Solution:
- PCART supports these
runCommandformats:python,python3,py -X.Y,python -m, and console scripts (e.g.,pytest,flask run) - The Python executable or console script must exist in the configured virtual environment
- On Windows, the
pylauncher version selector (-3.9,-3) is automatically stripped — the actual Python comes fromcurrentEnv/targetEnv - On Linux, console scripts are resolved from
<env>/bin/; on Windows, from<env>/Scripts/
Problem: extractLibAPI.py fails or times out
Solution:
- Ensure the virtual environments have the correct library versions installed
- Check that the library is importable in the virtual environment
- Pre-extracted APIs are available in
LibAPIExtraction/directory
Problem: FileNotFoundError: [Errno 2] No such file or directory: 'LibAPIExtraction/{libName}/{libName}{version}'
Cause: The library's API definition files have not been pre-extracted for the specified version.
Solution: Run extractLibAPI.py to extract the API definitions for the missing version(s):
python extractLibAPI.py -cfg {config_file}.jsonReplace {config_file} with your configuration file name (e.g., aiofiles1).
Problem: Failure to generate PKL in current version
Cause: The instrumented project failed to run in currentEnv. This typically means the project has runtime errors or missing dependencies.
Solution:
- Check that the project runs successfully on its own in the current version environment
- Ensure
dillis installed incurrentEnv - Check the terminal output for the run workspace path (printed as
Run workspace: ...at the start of each run), then look in<workspace>/Report/<project>_fixed_log.txt - Check the exported report under
Report/runs/{run_id}/{command_id}/ - Verify that
runCommandandrunFilePathare correctly set
Problem: Failed to load pkl in target version X.X.X: Ran out of input or similar dill error
Cause: The pkl file generated in the current environment cannot be deserialized in the target environment (common when library object formats change between versions).
Solution: This is handled automatically — PCART re-instruments and re-generates the pkl in targetEnv. If it persists after re-generation, check Report/<project>_fixed_log.txt.
Problem: Manifest shows "status": "save_failed" for a candidate
Cause: The runtime receiver object could not be serialized by dill (common with locked resources, database connections, or C extension objects).
Solution:
- PCART automatically falls back to the
__exprcandidate (string expression) if the__objectcandidate fails - If both fail, the API call falls back to static matching only
- Check
<workspace>/Copy/pkl/<artifact_id>.manifest.jsonfor detailed error information. The workspace path is printed at the start of each run.
Problem: PCART stops during compatibility analysis
Solution:
- Ensure your project runs successfully in the currentEnv environment (targetEnv is only used for API signature inspection and repair validation)
- Check that the library version in currentEnv matches your configuration
- Verify the library is importable in targetEnv
Problem: Some APIs are not repaired successfully
Solution:
- PCART repairs all incompatible calls at the AST level. pkl availability only determines validation method: dynamic (run repaired code) vs static (signature check).
- If repair status is
Unknownand the error mentionsdill, the parameter values may not be serializable - Check the repair report in
Report/runs/{run_id}/{command_id}/for details on which validation path was used - Some compatibility issues may require manual intervention
Problem: Many APIs show "Coverage: No"
Cause: These APIs are not invoked in the executed code paths.
Solution: This is normal behavior. PCART only analyzes APIs that are actually called at runtime.
Problem: Some APIs show "Unknown Compatible"
Cause: PCART cannot determine compatibility through static analysis alone.
Solution: This is expected for some complex API usages. The dynamic matching phase provides more accurate results.
If you encounter an issue not covered here:
- Check the repair report in
Report/runs/{run_id}/{command_id}/for detailed error information - Check
<workspace>/Copy/pkl/for manifest files withsave_failedstatus (workspace path is printed at the start of each run) - Verify your configuration file is correct
- Ensure all prerequisites are installed
- Check the GitHub Issues
- Quick-Start: Basic usage tutorial
- Configuration-Guide: Configuration reference
- How-It-Works: Internal mechanism and data flow
- Examples: More usage examples