-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger does not attach when running from ArcGIS Pro (Python Toolbox tool) #431
Comments
With debugpy version 1.2.1, debugging of Python toolboxes (ArcGIS Pro 2.6.3) now works fine, at least with the attach configuration. Another small problem remains: |
What do you mean by Note: the expected process is that you call |
I meant if I disconnect then I can't attach again. |
What is the lifecycle of Python code in ArcGIS like? Is there some main thread that stays alive all the time? I suspect that what's happening here is that your code runs to completion, and then the host kills all remaining Python threads (including the one waiting on the socket). |
@ghaefele - I realize this is pretty old but I'm curious how you configured VS code to debug arcgis python toolboxes, been trying for a bit with no luck. |
Environment data
Actual behavior
Starting a ArcGIS Pro Python Toolbox tool and then the debug task (attach) in VS Code brings up the debugger button toolbar, but nothing happens after that.
Expected behavior
Start debugging should attach and stop at first breakpoint.
Background
A Python Toolbox tool runs within ArcGIS Pro (embedded Python) and for debugging it is necessary to remote attach to this process.
The debug server seems to start successfully. According to the adapter log file there are additional ports/processes involved.
But both sides stay in a waiting status until the debugging process and the Python Toolbox tool are stopped. The processes (LISTENING…) still exists after this. Debugpy does not remove these processes on exit.
After that it is not possible to start the tool or the debugging process again. The existing processes seems to block everything.
I have to remove the processes manually (
taskkill /PID … /F
).Debugging with ptvsd worked more or less well until June 2020.
Configuration
launch.json
Code (Python Toolbox tool)
The issues #387 and #262 solved the problem that the listen process created a new ArcGIS Pro process. The workaround with sys.executable therefore can now be omitted.
Log files
It is noticeable in the adapter log file that the ArcGIS Pro process is listed and not the Python process that was started by ArcGIS Pro.
debugpy.adapter-15908.log
debugpy.server-10300.log
The text was updated successfully, but these errors were encountered: