IntelliJ Debugger failed with msg: Fatal Python error: PyCOND_WAIT(gil_cond) failed

I encountered the following issue while trying to debug a (multithreading) project. The error message does not show when using command line, and will only show when using IntelliJ debugger. There is one line in particular confused me: 

 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__
Fatal Python error: PyCOND_WAIT(gil_cond) failed

 

Environment: Anaconda with python3.6, rpy2=2.9.4, ipython, jupyter...

Error message after starting the debugger and hitting a line with a conditional variable:

Fatal Python error: PyCOND_WAIT(gil_cond) failed

Thread 0x0000700006dee000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 164 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000068eb000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 130 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000063e8000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Current thread 0x0000700005ee5000 (most recent call first):
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 299 in wait
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/queue.py", line 173 in get
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 358 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000059e2000 (most recent call first):
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/popen_fork.py", line 69 in _launch
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/popen_fork.py", line 19 in __init__
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/context.py", line 277 in _Popen
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/process.py", line 105 in start
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/pool.py", line 239 in _repopulate_pool
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/pool.py", line 174 in __init__
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/context.py", line 119 in Pool
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/csv_loader.py", line 139 in load_in_chunks
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/pg_csv_loader.py", line 112 in _run_multiprocess
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/pg_csv_loader.py", line 101 in run
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/postgres.py", line 309 in load_file
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/client.py", line 1199 in load_file
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 358 in load_csv
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 247 in load_single_file
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 69 in _execute
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/concurrent/futures/thread.py", line 56 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/concurrent/futures/thread.py", line 69 in _worker
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 864 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__
Fatal Python error: PyCOND_WAIT(gil_cond) failed

Thread 0x0000700006dee000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 164 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000068eb000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 130 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000063e8000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Current thread 0x0000700005ee5000 (most recent call first):
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 299 in wait
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/queue.py", line 173 in get
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 358 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000059e2000 (most recent call first):
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/posixpath.py", line 129 in splitext
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_trace_dispatch.py", line 59 in trace_dispatch
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/popen_fork.py", line 69 in _launch
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/popen_fork.py", line 19 in __init__
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/context.py", line 277 in _Popen
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/process.py", line 105 in start
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/pool.py", line 239 in _repopulate_pool
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/pool.py", line 174 in __init__
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/context.py", line 119 in Pool
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/csv_loader.py", line 139 in load_in_chunks
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/pg_csv_loader.py", line 112 in _run_multiprocess
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/pg_csv_loader.py", line 101 in run
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/postgres.py", line 309 in load_file
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/client.py", line 1199 in load_file
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 358 in load_csv
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 247 in load_single_file
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 69 in _execute
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/concurrent/futures/thread.py", line 56 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/concurrent/futures/thread.py", line 69 in _worker
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 864 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__
[DEBUG Tue Dec 31 13:07:50 EST 2019 ChatSe (ThreadPo)] pg_csv_loader.py:57 Running the copy command COPY table_1577815669851_8609 FROM STDIN WITH CSV DELIMITER ','
Fatal Python error: PyCOND_WAIT(gil_cond) failed

Thread 0x0000700006dee000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 164 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000068eb000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 130 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000063e8000 (most recent call first):
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Current thread 0x0000700005ee5000 (most recent call first):
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 299 in wait
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/queue.py", line 173 in get
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 358 in _on_run
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000059e2000 (most recent call first):
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 1269 in enumerate
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd_tracing.py", line 184 in set_trace_to_threads
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 482 in enable_tracing
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 1711 in _locked_settrace
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 1631 in settrace
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 1867 in settrace_forked
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 74 in _on_forked_process
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 612 in new_fork
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/popen_fork.py", line 66 in _launch
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/popen_fork.py", line 19 in __init__
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/context.py", line 277 in _Popen
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/process.py", line 105 in start
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/pool.py", line 239 in _repopulate_pool
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/pool.py", line 174 in __init__
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/multiprocessing/context.py", line 119 in Pool
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/csv_loader.py", line 139 in load_in_chunks
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/pg_csv_loader.py", line 112 in _run_multiprocess
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/utils/pg_csv_loader.py", line 101 in run
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/postgres.py", line 309 in load_file
 File "/Users/paul/Project/myproject/repo/worker/dc/core/db/client.py", line 1199 in load_file
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 358 in load_csv
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 247 in load_single_file
 File "/Users/paul/Project/myproject/repo/worker/dc/skills/data_io/load_data.py", line 69 in _execute
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/concurrent/futures/thread.py", line 56 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/concurrent/futures/thread.py", line 69 in _worker
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 864 in run
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 916 in _bootstrap_inner
 File "/Users/paul/anaconda/envs/myproject/lib/python3.6/threading.py", line 884 in _bootstrap
 File "/Users/paul/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__
15 comments
Comment actions Permalink

I get this when I try to debug my multi process program after I updated to PyCharm to version 2019.3.1. 

1
Comment actions Permalink

Does it happen with any code debugging or is it a code-specific issue?

1
Comment actions Permalink

Hi Sergey

It happens if debugging with application using multiprocessing. If single process, then it does not happen. 

Also, it is more likely to happen if I Rerun the pydev debugger in console. 

0
Comment actions Permalink

Is it possible to provide a minimal example for reproducing?

0
Comment actions Permalink

I'm seeing the same multiprocessing issue on a fresh install of PyCharm 2019.3.1.

0
Comment actions Permalink

@bioinfoman

Please report it to https://youtrack.jetbrains.com/issues/PY providing a code snippet and steps for reproducing. We'll investigate.

0
Comment actions Permalink

I have the same issue. Created https://youtrack.jetbrains.com/issue/PY-40504 with a code snippet and an error dump.

0
Comment actions Permalink

Same issue here trying to debug Celery:

  • PyCharm 2019.3.3 (Professional Edition)
  • macOS 10.15.3
  • Python 3.6
  • Celery

Fatal Python error: PyCOND_WAIT(gil_cond) failed

Thread 0x00007000107b6000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 164 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000102b3000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 130 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x000070000fdb0000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Current thread 0x000070000f8ad000 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 299 in wait
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/queue.py", line 173 in get
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 358 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007fff69c14dc0 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 169 in islink
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 420 in _joinrealpath
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 386 in realpath
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 246 in _NormPath
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 238 in _NormPaths
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 571 in get_abs_path_real_path_and_base_from_file
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 476 in enable_tracing
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_trace_dispatch.py", line 59 in trace_dispatch
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/popen_fork.py", line 73 in _launch
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/popen_fork.py", line 24 in __init__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/context.py", line 333 in _Popen
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/process.py", line 124 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/pool.py", line 1158 in _create_worker_process
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/asynpool.py", line 445 in _create_worker_process
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/pool.py", line 1046 in __init__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/asynpool.py", line 428 in __init__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/prefork.py", line 112 in on_start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/base.py", line 131 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bootsteps.py", line 369 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bootsteps.py", line 119 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/worker/worker.py", line 205 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/worker.py", line 258 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/base.py", line 252 in __call__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/worker.py", line 223 in run_from_argv
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 420 in execute
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 488 in handle_argv
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/base.py", line 298 in execute_from_commandline
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 496 in execute_from_commandline
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 322 in main
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/__main__.py", line 16 in main
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/celery", line 10 in <module>
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18 in execfile
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1434 in _exec
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1427 in run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2118 in main
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2127 in <module>
Fatal Python error: PyCOND_WAIT(gil_cond) failed

Thread 0x00007000107b6000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 164 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007000102b3000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 130 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Current thread 0x000070000fdb0000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 283 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x000070000f8ad000 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 299 in wait
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/queue.py", line 173 in get
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 358 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 213 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 769 in __call__

Thread 0x00007fff69c14dc0 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 169 in islink
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 420 in _joinrealpath
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 386 in realpath
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 246 in _NormPath
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 238 in _NormPaths
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 571 in get_abs_path_real_path_and_base_from_file
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 476 in enable_tracing
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_trace_dispatch.py", line 59 in trace_dispatch
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/popen_fork.py", line 73 in _launch
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/popen_fork.py", line 24 in __init__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/context.py", line 333 in _Popen
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/process.py", line 124 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/pool.py", line 1158 in _create_worker_process
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/asynpool.py", line 445 in _create_worker_process
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/billiard/pool.py", line 1046 in __init__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/asynpool.py", line 428 in __init__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/prefork.py", line 112 in on_start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/concurrency/base.py", line 131 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bootsteps.py", line 369 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bootsteps.py", line 119 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/worker/worker.py", line 205 in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/worker.py", line 258 in run
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/base.py", line 252 in __call__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/worker.py", line 223 in run_from_argv
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 420 in execute
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 488 in handle_argv
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/base.py", line 298 in execute_from_commandline
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 496 in execute_from_commandline
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/bin/celery.py", line 322 in main
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/celery/__main__.py", line 16 in main
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/celery", line 10 in <module>
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18 in execfile
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1434 in _exec
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1427 in run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2118 in main
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2127 in <module>

worker: Hitting Ctrl+C again will terminate all running tasks!

worker: Warm shutdown (MainProcess)

Process finished with exit code 1

0
Comment actions Permalink

I was able to workaround the issue above by clearing all the breakpoints in PyCharm before starting Celery in debug.

If the error re-appears when starting celery and your breakpoints appear all cleared, then simply add a breakpoint and then clear it - and it then works.

Also, you may also have to quit and re-launch PyCharm sometimes.

With that I have been able to debug with Celery on OSX successfully.

1
Comment actions Permalink

Same here. But only sometimes clearing all breakpoint will be effective. 

Clearing breakpoints and restarting Pycharm still not guarantee you can successfully start debugging.

0
Comment actions Permalink

I found that clearing breakpoints in the editor did not always work. You may need to bring up the Breakpoints dialog and add/clear a breakpoint and click DONE

0
Comment actions Permalink

I am also experiencing the same issue when running multiprocessing programs using intellij 2020.1. I did not have any issues when I recently used PyCharm.

0
Comment actions Permalink

The solution will be upgrade the python to 3.7 above, the issue will be resolved. It is a conflict between pycharm/intellij pydev and muti-threading in python.

0
Comment actions Permalink

I experience the same issue using:

MacOS 10.15.7
Pycharm 2021.1.1
Python 3.6
Celery 4.2.1

 

Fatal Python error: PyCOND_WAIT(gil_cond) failed

Thread 0x000070000b9c8000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 172 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 216 in run
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 795 in __call__

Thread 0x000070000b4c5000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 138 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 216 in run
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 795 in __call__

Thread 0x000070000afc2000 (most recent call first):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 290 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 216 in run
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 795 in __call__

Current thread 0x000070000aabf000 (most recent call first):
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 299 in wait
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/queue.py", line 173 in get
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 365 in _on_run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 216 in run
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916 in _bootstrap_inner
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 884 in _bootstrap
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 795 in __call__

Thread 0x0000000118952dc0 (most recent call first):
File "/Users/adig/Envs/cpservice/bin/../lib/python3.6/posixpath.py", line 171 in islink
File "/Users/adig/Envs/cpservice/bin/../lib/python3.6/posixpath.py", line 422 in _joinrealpath
File "/Users/adig/Envs/cpservice/bin/../lib/python3.6/posixpath.py", line 388 in realpath
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 246 in _NormPath
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 238 in _NormPaths
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd_file_utils.py", line 571 in get_abs_path_real_path_and_base_from_file
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 518 in enable_tracing
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_trace_dispatch.py", line 59 in trace_dispatch
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/billiard/popen_fork.py", line 73 in _launch
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/billiard/popen_fork.py", line 24 in __init__
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/billiard/context.py", line 333 in _Popen
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/billiard/process.py", line 124 in start
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/billiard/pool.py", line 1116 in _create_worker_process
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/concurrency/asynpool.py", line 449 in _create_worker_process
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/billiard/pool.py", line 1007 in __init__
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/concurrency/asynpool.py", line 432 in __init__
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/concurrency/prefork.py", line 112 in on_start
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/concurrency/base.py", line 131 in start
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bootsteps.py", line 369 in start
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bootsteps.py", line 119 in start
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/worker/worker.py", line 205 in start
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/worker.py", line 258 in run
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/base.py", line 238 in __call__
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/worker.py", line 223 in run_from_argv
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/celery.py", line 420 in execute
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/celery.py", line 488 in handle_argv
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/base.py", line 275 in execute_from_commandline
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/celery.py", line 496 in execute_from_commandline
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/bin/celery.py", line 322 in main
File "/Users/adig/Envs/cpservice/lib/python3.6/site-packages/celery/__main__.py", line 16 in main
File "/Users/adig/Envs/cpservice/bin/celery", line 8 in <module>
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18 in execfile
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1483 in _exec
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1476 in run
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2164 in main
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2173 in <module>

0
Comment actions Permalink

Hello, 

 

It looks like a confirmed bug, please see https://youtrack.jetbrains.com/issue/PY-40504 and feel free to vote in order to increase its priority. 

 

 

1

Please sign in to leave a comment.