Skip to content
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

TypeError: cannot pickle '_thread._local' object #3542

Open
y-Adrian opened this issue Dec 8, 2021 · 3 comments
Open

TypeError: cannot pickle '_thread._local' object #3542

y-Adrian opened this issue Dec 8, 2021 · 3 comments

Comments

@y-Adrian
Copy link

y-Adrian commented Dec 8, 2021

Describe the bug
When I use the command codechecker server I got this error. Here are the details:

[INFO 2022-02-24 18:34] - Checking configuration database ...
[INFO 2022-02-24 18:34] - Database is up to date.
[INFO 2022-02-24 18:34] - Status of products:
-------------------------------------------------------------------------------------------------------------------------------------------------------
Product endpoint | Database status         | Database location                         | Schema version in the database | Schema version in the package
-------------------------------------------------------------------------------------------------------------------------------------------------------
Default          | Database is up to date. | /Users/debris/.codechecker/Default.sqlite | fb356f0eefed (up to date)      | fb356f0eefed                 
-------------------------------------------------------------------------------------------------------------------------------------------------------
[INFO 2022-02-24 18:34] - Garbage collection for product 'Default' started...
[INFO 2022-02-24 18:34] - Garbage collection finished.
[INFO 2022-02-24 18:34] - Searching for SSL key at /Users/debris/.codechecker/key.pem, cert at /Users/debris/.codechecker/cert.pem, not found...
[INFO 2022-02-24 18:34] - Falling back to simple, insecure HTTP.
[INFO 2022-02-24 18:34] - Server waiting for client requests on [localhost:8001]
Traceback (most recent call last):
  File "/Users/debris/miniconda3/lib/python3.8/site-packages/codechecker_common/cli.py", line 208, in main
    sys.exit(args.func(args))
  File "/Users/debris/miniconda3/lib/python3.8/site-packages/codechecker_server/cmd/server.py", line 436, in __handle
    main(args)
  File "/Users/debris/miniconda3/lib/python3.8/site-packages/codechecker_server/cmd/server.py", line 1002, in main
    server_init_start(args)
  File "/Users/debris/miniconda3/lib/python3.8/site-packages/codechecker_server/cmd/server.py", line 972, in server_init_start
    server.start_server(args.config_directory,
  File "/Users/debris/miniconda3/lib/python3.8/site-packages/codechecker_server/server.py", line 1092, in start_server
    p.start()
  File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_thread._local' object

CodeChecker version
6.18.0

To Reproduce
Steps to reproduce the behaviour:

  1. Run command 'codechecker server'
  2. See error

Expected behaviour
I want to start the service and visit the webpage of codechecker through typing http://localhost:8001 in my browser.

Desktop (please complete the following information)

  • OS: macOS Big Sur Version 11.4
  • Browser: Chrome

Additional context
I install the codechecker through the command pip install codechecker according to here
The version of pip :
->pip -V
pip 21.3.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)

@y-Adrian
Copy link
Author

y-Adrian commented Feb 24, 2022

There seems something wrong with the _Popen function in File "/Users/debris/miniconda3/lib/python3.8/multiprocessing/process.py" at line 77:

def _Popen(self):
    raise NotImplementedError

But I don't know how to fix it

@MisterMartin
Copy link

I encountered the same error on MacOS Monterey. Was able to get the server to run by using python3.7.

@whisperity
Copy link
Contributor

@y-Adrian @MisterMartin Could you please retry using a newer CodeChecker version? We have recently changed multiprocessing-related library in 6.23: #4076, #4118.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants