minor issue after upgrade from 2.8.7 to 2.11.4

295 views
Skip to first unread message

Narayan Krishnan

unread,
May 29, 2021, 10:23:15 PM5/29/21
to NetBox
on first visit to the main URL, one is greeted with:

----------

 Server Error

A module import error occurred during this request. Common causes include the following:

 Missing required packages - This installation of NetBox might be missing one or more required Python packages. These packages are listed in requirements.txt and local_requirements.txt, and are normally installed as part of the installation or upgrade process. To verify installed packages, run pip freeze from the console and compare the output to the list of required packages.

 WSGI service not restarted after upgrade - If this installation has recently been upgraded, check that the WSGI service (e.g. gunicorn or uWSGI) has been restarted. This ensures that the new code is running.

The complete exception is provided below:

<class 'ModuleNotFoundError'>


No module named 'utilities.auth_backends'


Python version: 3.7.3

NetBox version: 2.11.4

If further assistance is required, please post to the NetBox mailing list.

----------

After checking the hints, and checking, indeed there is no such file.    Before posting here, copied netbox-2.8.7/netbox/utilities/auth_backends.py to netbox-2.11.4/netbox/utilities/auth_backends.py.  And that seemed be effective enough for now.

The motivation for the upgrade was the ability to associate secrets with VMs, and that functionality seems to be working as well.

It is more than likely that there are other latent errors.  Hints on the real resolution would be appreciated.

Brian Candler

unread,
May 30, 2021, 3:53:43 AM5/30/21
to NetBox
Check your configuration.py.  Compare it to the supplied configuration.example.py.  Are there any old settings in there that should have changed?

Are you using REMOTE_AUTH_BACKEND and/or LDAP?  Note the "Configuration Changes" sections of the v2.9.0 release notes.

Narayan Krishnan

unread,
May 30, 2021, 1:00:32 PM5/30/21
to NetBox
Thanks Brian.  A documentation opportunity for https://netbox.readthedocs.io/en/stable/installation/upgrading/ to include verbiage  like your first paragraph.  Alternately replace the copy configuration.py instruction with something like fold in the changes from the incumbent configuration.example.py and configuration.py to create the configuration.py from the configuration.example.py in the new release.

In this case besides the intended changes (ALLOWED_HOSTS, USER, PASSWORD and SECRET_KEY) there were other unintended changes.

1.  Some sections moved

35a36
>         'DEFAULT_TIMEOUT': 300,
37,39d37
<         # Set this to True to skip TLS certificate verification
<         # This can expose the connection to attacks, be careful
<         # 'INSECURE_SKIP_TLS_VERIFY': False,
48a47
>         'DEFAULT_TIMEOUT': 300,
50,52d48
<         # Set this to True to skip TLS certificate verification
<         # This can expose the connection to attacks, be careful
<         # 'INSECURE_SKIP_TLS_VERIFY': False,

2. Other changes in the base template.

< # Base URL path if accessing NetBox within a directory. For example, if installed at https://example.com/netbox/, set:
---
> # Base URL path if accessing NetBox within a directory. For example, if installed at http://example.com/netbox/, set:
163,165d158
< # The URL to use when mapping physical addresses or GPS coordinates
<
195c188
< # NAPALM optional arguments (see https://napalm.readthedocs.io/en/latest/support/#optional-arguments). Arguments must
---
> # NAPALM optional arguments (see http://napalm.readthedocs.io/en/latest/support/#optional-arguments). Arguments must
224c217
< REMOTE_AUTH_BACKEND = 'netbox.authentication.RemoteUserBackend'
---
> REMOTE_AUTH_BACKEND = 'utilities.auth_backends.RemoteUserBackend'
228c221
< REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
---
> REMOTE_AUTH_DEFAULT_PERMISSIONS = []
242,244d234
< # Maximum execution time for background tasks, in seconds.
< RQ_DEFAULT_TIMEOUT = 300
<
248,250d237
<
< # The name to use for the session cookie.
< SESSION_COOKIE_NAME = 'sessionid'
Reply all
Reply to author
Forward
0 new messages