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

Codechecker Store fails with Python 3.12 #4437

Open
amai2012 opened this issue Jan 27, 2025 · 5 comments
Open

Codechecker Store fails with Python 3.12 #4437

amai2012 opened this issue Jan 27, 2025 · 5 comments

Comments

@amai2012
Copy link

Describe the bug
Codechecker fails to store results using python 3.12 (e.g. from Ubuntu 24.04 LTS)

CodeChecker version
6.24.4

To Reproduce
Steps to reproduce the behaviour:

  1. Executing the command '$ CodeChecker store ./reports --url https://codechecker:8001/Default --name PROJECT`'

triggers

$ CodeChecker store ./reports --url https://codechecker:8001/Default --name PROJECT
[INFO 2025-01-27 09:27] - Storing analysis results for run 'PROJECT'
[INFO 2025-01-27 09:27] - Checking local passwords or tokens in /root/.codechecker.passwords.json
[INFO 2025-01-27 09:27] - Password file not found.
[INFO 2025-01-27 09:27] - Checking for local valid sessions.
Traceback (most recent call last):
  File "/builds/projectvenv/lib/python3.12/site-packages/codechecker_common/cli.py", line 208, in main
    sys.exit(args.func(args))
             ^^^^^^^^^^^^^^^
  File "/builds/projectvenv/lib/python3.12/site-packages/codechecker_client/cmd/store.py", line 895, in main
    client = libclient.setup_client(args.product_url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/projectvenv/lib/python3.12/site-packages/codechecker_client/client.py", line 256, in setup_client
    session_token = get_new_token(protocol, host, port, cred_manager)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/projectvenv/lib/python3.12/site-packages/codechecker_client/client.py", line 235, in get_new_token
    return perform_auth_for_handler(auth_client, host, port, cred_manager)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/projectvenv/lib/python3.12/site-packages/codechecker_client/client.py", line 144, in perform_auth_for_handler
    auth_response = auth_client.getAuthParameters()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/projectvenv/lib/python3.12/site-packages/codechecker_client/thrift_call.py", line 41, in wrapper
    self.transport.open()
  File "/builds/projectvenv/lib/python3.12/site-packages/thrift/transport/THttpClient.py", line 112, in open
    self.__http = http_client.HTTPSConnection(self.host, self.port,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HTTPSConnection.__init__() got an unexpected keyword argument 'key_file'

Expected behaviour
Upload succesds

Desktop (please complete the following information)

  • OS: Ubuntu Linux 24.0.4 LTS

Additional context

@amai2012
Copy link
Author

BTW, https://github.com/Ericsson/codechecker/blob/master/docs/deps.md claims

[Python3](https://www.python.org/) (>= 3.8)

@vodorok
Copy link
Contributor

vodorok commented Jan 27, 2025

Hi @amai2012

Did you set up SSL for your server? If not can you please try storing through http?

CodeChecker store ./reports --url http://codechecker:8001/Default --name PROJECT

@amai2012
Copy link
Author

Yes, the server is set up with a ssl certificate.
I am just evaluating CodeChecker, but probably won't be able to use it later on without that.

As google suggested the issue is with an incompatibility to python 3.12. I managed to run the "store" command successfully after settuing up a python 3.10 environment using uv.

@vodorok
Copy link
Contributor

vodorok commented Jan 29, 2025

Hi @amai2012 , we have looked into this issue, and it looks like the rpc library (thrift) that CodeChecker uses for the network communication between the server an client is not compatible with python 3.12. (Which is a shame as it is the default python in the latest LTS Ubuntu. The current latest Thrift compiler will generate python stubs which contain deprecated python code...)

We will try to resolve this on the Thrift side.
I will keep you posted how this will progress.

In the meantime please try CodeChecker with an older python, 3.10 or 3.11.

@gamesh411
Copy link
Collaborator

Hi!
I have reported the issue to Thrift.
The issue is tracked here:
https://issues.apache.org/jira/browse/THRIFT-5847

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

No branches or pull requests

3 participants