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

[15.0] external dependency "cryptography" causes error 'X509_V_FLAG_CB_ISSUER_CHECK' #424

Closed
CRogos opened this issue Sep 26, 2022 · 10 comments
Labels

Comments

@CRogos
Copy link
Contributor

CRogos commented Sep 26, 2022

Module auth_jwt

The name of the module that has a bug.
auth_jwt has an external dependency "cryptography" which seems not be compatible with Odoo anymore:
odoo/odoo@55d2da4

Describe the bug

The Odoo server is not starting because of dependency incompatibilities.
similar topics:
odoo/odoo#89798
https://www.odoo.com/de_DE/forum/hilfe-1/attributeerror-module-lib-has-no-attribute-x509-v-flag-cb-issuer-check-when-creating-new-staging-branch-202955

To Reproduce

Affected versions: 15.0
Odoo does not start when this repository is added to the addon folder.
Error:
File "/usr/lib/python3/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1553, in
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

Steps to reproduce the behavior:

  1. I am using Odoo.sh with an empty database referencing this repository. The server with an empty db does not start.

Expected behavior

Additional context
I've added the following line to the requirements.txt and the error is gone:
cryptography==36.0.2 # last version working with pyopenssl==19.0.0

But I am not using the auth_jwt module, so I am not sure if the module is still working with the changed requirements.txt?
Is this something this repository should react on, or will this probably be fixed in odoo?

@CRogos CRogos added the bug label Sep 26, 2022
@sbidoul
Copy link
Member

sbidoul commented Oct 1, 2022

This has been fixed in Odoo: odoo/odoo#99829

@sbidoul sbidoul closed this as completed Oct 1, 2022
@CRogos
Copy link
Contributor Author

CRogos commented Oct 5, 2022

This has been fixed in Odoo: odoo/odoo#99829

@sbidoul are you sure? I still get the same error when not setting the cryptography version in the requirements.txt.

@sbidoul
Copy link
Member

sbidoul commented Oct 5, 2022

I don't know which version your odoo sh instance has, but I'm 100% sure we should not pin the version in this repo.

@CRogos
Copy link
Contributor Author

CRogos commented Oct 5, 2022

Odoo.sh is using the latest Odoo version and the Odoo patch is applied:
image

I agree that pinning it to a version is ugly, but without it is not building anymore.

All builds newer than 2 weeks have the same issue:
https://runboat.odoo-community.org/webui/builds.html?repo=oca/server-auth&target_branch=15.0

@sbidoul
Copy link
Member

sbidoul commented Oct 5, 2022

Butt, is your issue with odoo.sh or runboat?

@CRogos
Copy link
Contributor Author

CRogos commented Oct 5, 2022

I am using odoo.sh, but I am also using runboat, and I can reproduce the issue on both.

@sbidoul
Copy link
Member

sbidoul commented Oct 5, 2022

Ah, I see it now. I think some other dependency of this repo requires a cryptography version greater than the one in odoo's requirements.txt. We need to find which one.

@CRogos
Copy link
Contributor Author

CRogos commented Oct 5, 2022

Cryptography is used in auth_jwt (and auth_jwt_demo), which both have the version 14 in the 15 branch?!?!

"version": "14.0.1.2.0",

@CRogos
Copy link
Contributor Author

CRogos commented Oct 5, 2022

@sbidoul the external_dependencies of auth_jwt are not added to the requirements.txt because in the manifest the installable is set to False.

What is the reason why the 14.0.1.2.0 was added to the 15.0 branch without migration?
When I set the module to installable = True and remove it from the "not installable addons" list, I get more migration related issues.

I think the easiest way to fix this topic is to delete the auth_jwt module from the 15.0 branch and migrate it properly.
Do you agree?

@sbidoul
Copy link
Member

sbidoul commented Oct 5, 2022

What is the reason why the 14.0.1.2.0 was added to the 15.0 branch without migration?

This comes from #320. But that is not the cause of the problem.

Depending on cryptography without version constraint is fine, because it is preinstalled with the version pinned by Odoo's requirements.txt (both in odoo.sh and runboat), and pip install cryptography then says requirement already satisfied and everyone is happy.

The problem here comes from the pysaml2 package which depends on cryptography>=3.1. Since Odoo has version 2.6.x pre-installed, pip wants to upgrade it to the latest version to satisfy >=3.1. And since the relationship between cryptography and pyopenssl version is complicated and not declared in their respective dependencies pip has no way to know it can't install cryptography 38.

I'm trying #429 with a fix that is closer to the root cause.

@CRogos CRogos closed this as completed Oct 6, 2022
SiesslPhillip pushed a commit to grueneerde/OCA-server-auth that referenced this issue Nov 20, 2024
Syncing from upstream OCA/server-auth (17.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants