openssl error during db mirations in upgrade from 2.0.8 to 2.1.0 #1136

Closed
opened 2025-12-29 16:29:20 +01:00 by adam · 2 comments
Owner

Originally created by @deninny on GitHub (Jul 31, 2017).

Issue type: bug report

Python version: 2.7.12
NetBox version: 2.1.0

While upgrading from netbox 2.0.8 to 2.1.0 i was thrown a stacktrace when running ./upgrade.sh. this seems to be caused by internals of the pyopenssl library provided by urllib3. installing pyopenssl version 16.2.0 resolved this for me (google). I've done this through adding pyOpenSSL==16.2.0 in the requirements.txt file.

Traceback (most recent call last):
File "netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 363, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 337, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/init.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/local/lib/python2.7/dist-packages/django_filters/init.py", line 4, in
from .filterset import FilterSet
File "/usr/local/lib/python2.7/dist-packages/django_filters/filterset.py", line 13, in
from .conf import settings
File "/usr/local/lib/python2.7/dist-packages/django_filters/conf.py", line 9, in
from .utils import deprecate
File "/usr/local/lib/python2.7/dist-packages/django_filters/utils.py", line 17, in
from .compat import make_aware, remote_field, remote_model
File "/usr/local/lib/python2.7/dist-packages/django_filters/compat.py", line 28, in
import coreapi
File "/usr/local/lib/python2.7/dist-packages/coreapi/init.py", line 2, in
from coreapi import auth, codecs, exceptions, transports, utils
File "/usr/local/lib/python2.7/dist-packages/coreapi/auth.py", line 2, in
from requests.auth import AuthBase, HTTPBasicAuth
File "/usr/local/lib/python2.7/dist-packages/requests/init.py", line 84, in
from urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Originally created by @deninny on GitHub (Jul 31, 2017). ### Issue type: bug report **Python version: 2.7.12** **NetBox version: 2.1.0** While upgrading from netbox 2.0.8 to 2.1.0 i was thrown a stacktrace when running ./upgrade.sh. this seems to be caused by internals of the pyopenssl library provided by urllib3. installing pyopenssl version 16.2.0 resolved this for me (google). I've done this through adding pyOpenSSL==16.2.0 in the requirements.txt file. Traceback (most recent call last): File "netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 337, in execute django.setup() File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/usr/local/lib/python2.7/dist-packages/django_filters/__init__.py", line 4, in <module> from .filterset import FilterSet File "/usr/local/lib/python2.7/dist-packages/django_filters/filterset.py", line 13, in <module> from .conf import settings File "/usr/local/lib/python2.7/dist-packages/django_filters/conf.py", line 9, in <module> from .utils import deprecate File "/usr/local/lib/python2.7/dist-packages/django_filters/utils.py", line 17, in <module> from .compat import make_aware, remote_field, remote_model File "/usr/local/lib/python2.7/dist-packages/django_filters/compat.py", line 28, in <module> import coreapi File "/usr/local/lib/python2.7/dist-packages/coreapi/__init__.py", line 2, in <module> from coreapi import auth, codecs, exceptions, transports, utils File "/usr/local/lib/python2.7/dist-packages/coreapi/auth.py", line 2, in <module> from requests.auth import AuthBase, HTTPBasicAuth File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 84, in <module> from urllib3.contrib import pyopenssl File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in <module> import OpenSSL.SSL File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module> from OpenSSL import rand, crypto, SSL File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module> SSL_ST_INIT = _lib.SSL_ST_INIT AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
adam closed this issue 2025-12-29 16:29:20 +01:00
Author
Owner

@murrant commented on GitHub (Jul 31, 2017):

pyOpenSSL seemed to be too old in my case.
I did:

pip uninstall pyOpenSSL
pip install pyOpenSSL
./upgrade.sh
@murrant commented on GitHub (Jul 31, 2017): pyOpenSSL seemed to be too old in my case. I did: ``` pip uninstall pyOpenSSL pip install pyOpenSSL ./upgrade.sh ```
Author
Owner

@jeremystretch commented on GitHub (Aug 2, 2017):

Unfortunately this is a dependency issue external to NetBox. It looks like upgrading pyOpenSSL manually is a suitable workaround until the conflict gets resolved upstream.

@jeremystretch commented on GitHub (Aug 2, 2017): Unfortunately this is a dependency issue external to NetBox. It looks like upgrading pyOpenSSL manually is a suitable workaround until the conflict gets resolved upstream.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1136