trinv / PowerDNS

7 stars 15 forks source link

AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' #3

Open trinv opened 2 years ago

trinv commented 2 years ago

HI, i got a problem when i ran flask db upgrade Please help me to resolved this issue. Thanks

# export FLASK_APP=powerdnsadmin/__init__.py
# flask db upgrade

/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/authlib/jose/rfc7518/_cryptography_backends/_jws.py:11: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release. from cryptography.hazmat.primitives import hashes Traceback (most recent call last): File "/opt/web/powerdns-admin/flask/bin/flask", line 8, in sys.exit(main()) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/flask/cli.py", line 967, in main cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/flask/cli.py", line 586, in main return super(FlaskGroup, self).main(args, kwargs) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, ctx.params) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/click/core.py", line 754, in invoke return __callback(args, *kwargs) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), args, **kwargs) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/flask/cli.py", line 425, in decorator with __ctx.ensure_object(ScriptInfo).load_app().app_context(): File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/flask/cli.py", line 388, in load_app app = locate_app(self, import_name, name) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/flask/cli.py", line 257, in locate_app return find_best_app(script_info, module) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/flask/cli.py", line 83, in find_best_app app = call_factory(script_info, app_factory) File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/flask/cli.py", line 119, in call_factory return app_factory() File "/opt/web/powerdns-admin/powerdnsadmin/init.py", line 13, in create_app from . import models, routes, services File "/opt/web/powerdns-admin/powerdnsadmin/routes/init.py", line 3, in from .index import index_bp File "/opt/web/powerdns-admin/powerdnsadmin/routes/index.py", line 31, in from ..services.saml import SAML File "/opt/web/powerdns-admin/powerdnsadmin/services/saml.py", line 7, in from ..lib.certutil import KEY_FILE, CERT_FILE, create_self_signed_cert File "/opt/web/powerdns-admin/powerdnsadmin/lib/certutil.py", line 1, in from OpenSSL import crypto File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/OpenSSL/init.py", line 8, in from OpenSSL import crypto, SSL File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/OpenSSL/crypto.py", line 1517, in class X509StoreFlags(object): File "/opt/web/powerdns-admin/flask/lib/python3.6/site-packages/OpenSSL/crypto.py", line 1537, in X509StoreFlags CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

trinv commented 2 years ago

add this line in requerements.txt file:

cryptography==3.3 and change pyOpenSSL to version 20.0.0 pyOpenSSL==20.0.0