Unable to launch debugger, hit with "Could not find thread pid" error
When ever i try to launch my Django website in pycharm I am hit with this error
Could not find thread pid7476_seq6
Available: ['pid12112_seq2', 'pid12112_seq3', 'pid12112_seq1', 'pid12112_seq4']
Does any have an idea about this error and how to fix it?
Attachment(s):
pycharmerror.png
Please sign in to leave a comment.

Hi Quintin,
the problem most likely is caused by multi-process debugging to handle reloading of Django.
To help us fix it please set environment variable PYCHARM_DEBUG=1 to your run configuration launch it again and then attach console output to the issue http://youtrack.jetbrains.com/issue/PY-6607
As for workaround I can suggest enabling 'No reload' option in run configuration.
Thanks Dimitry,
How do I set
PYCHARM_DEBUG=1
In config? Naïve user here, sorry
Also when I launched it with no reload, I get the console message
New process is launching. Breakpoints won't work.
To debug that process please enable 'Attach to subprocess automatically while debugging' option in your run configuration.
This means that cannot debug the site, which is precisely what I wanted to achieve since I can do a
./manage.py runserver to achieve the same
Thanks again.
Figured out how to set the env and it works.
I’ll post dumps.
Ok,
do you use Django server run configuration? Enabling 'No reload' checkbox there should prevent launching new processes.
Do you still experience the problem? If so, please post the dumps.
Now I'm encountering the same issue, but with Flask instead of Django. I recently moved from Windows 7 to Ubuntu 14.04; in Windows this just worked out of the box?!?
I have no idea where to look for a 'No reload' checkbox, but I set PYCHARM_DEBUG=1 like mentioned above. Also, in the Run/Debug Configuration settings I checked 'Single instance only', but when I start the debugger it still says: 'Started in multiproc mode'. Full first lines:
-- begin
Connected to pydev debugger (build 135.1057)
/home/XXX/.virtualenvs/YYY/bin/python /ZZZ/pycharm-community-3.4.1/helpers/pydev/pydevd.py –multiproc –client 127.0.0.1 –port 34602 –file /home/XXX/Projects/YYY/ZZZ.py
Started in multiproc mode
...
-- end
Relevant part of the console output:
-- begin
sending cmd –> CMD_THREAD_CREATE 103 10 <xml><thread name="Thread-8" id="pid19872_seq7" /></xml>
sending cmd –> CMD_THREAD_SUSPEND 105 12 <xml><thread id="pid19872_seq7" stop_reason="111" message="GET"><frame id="139746894513488" name="upload_file" file="/home/XXX/Projects/YYY/ZZZ.py" line="303">"</frame><frame id="139747431520208" name="decorated" file="/home/XXX/Projects/YYY/ZZZ.py" line="45">"</frame><frame id="139747432079912" name="dispatch_request" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/flask/app.py" line="1461">"</frame><frame id="139747432056328" name="full_dispatch_request" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/flask/app.py" line="1475">"</frame><frame id="139747432756816" name="wsgi_app" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/flask/app.py" line="1817">"</frame><frame id="139747432467248" name="__call__" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/flask/app.py" line="1836">"</frame><frame id="139746894429856" name="debug_application" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/werkzeug/debug/__init__.py" line="88">"</frame><frame id="139746894424816" name="execute" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/werkzeug/serving.py" line="167">"</frame><frame id="139746894422512" name="run_wsgi" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/werkzeug/serving.py" line="177">"</frame><frame id="139747432489040" name="handle_one_request" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/werkzeug/serving.py" line="235">"</frame><frame id="139747433266264" name="handle" file="/usr/lib/python2.7/BaseHTTPServer.py" line="340">"</frame><frame id="139747433020840" name="handle" file="/home/XXX/.virtualenvs/YYY/lib/python2.7/site-packages/werkzeug/serving.py" line="200">"</frame><frame id="139747432761776" name="__init__" file="/usr/lib/python2.7/SocketServer.py" line="649">"</frame><frame id="139747432748504" name="finish_request" file="/usr/lib/python2.7/SocketServer.py" line="334">"</frame><frame id="139747432465392" name="process_request_thread" file="/usr/lib/python2.7/SocketServer.py" line="593">"</frame><frame id="139747432744816" name="run" file="/usr/lib/python2.7/threading.py" line="763">"</frame><frame id="139746894416144" name="__bootstrap_inner" file="/usr/lib/python2.7/threading.py" line="810">"</frame><frame id="139747432971408" name="__bootstrap" file="/usr/lib/python2.7/threading.py" line="783">"</frame></thread></xml>
GET
received >>106 95 pid19872_seq7
<<
Received command: CMD_THREAD_RUN 106 95 pid19872_seq7
Could not find thread pid19872_seq7
Available: ['pid19863_seq2', 'pid19863_seq3', 'pid19863_seq4', 'pid19863_seq1', 'pid19863_seq5']
-- end