User has no config #6092

Closed
opened 2025-12-29 19:36:41 +01:00 by adam · 7 comments
Owner

Originally created by @someconservator on GitHub (Feb 15, 2022).

NetBox version

v.3.1.8

Python version

3.9

Steps to Reproduce

  1. Click "log in"
  2. Enter credentials
  3. Click "sign in"

Expected Behavior

Correct login

Observed Behavior

<class 'django.contrib.auth.models.User.config.RelatedObjectDoesNotExist'>

User has no config.

Python version: 3.9.7
NetBox version: 3.1.8

Originally created by @someconservator on GitHub (Feb 15, 2022). ### NetBox version v.3.1.8 ### Python version 3.9 ### Steps to Reproduce 1. Click "log in" 2. Enter credentials 3. Click "sign in" ### Expected Behavior Correct login ### Observed Behavior <class 'django.contrib.auth.models.User.config.RelatedObjectDoesNotExist'> User has no config. Python version: 3.9.7 NetBox version: 3.1.8
adam closed this issue 2025-12-29 19:36:42 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 15, 2022):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch commented on GitHub (Feb 15, 2022): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@someconservator commented on GitHub (Feb 16, 2022):

Excuse me, but what other steps need to be specified? This is exactly what happens to me: I try to log in and I get a window with this error.

@someconservator commented on GitHub (Feb 16, 2022): Excuse me, but what other steps need to be specified? This is exactly what happens to me: I try to log in and I get a window with this error.
Author
Owner

@jeremystretch commented on GitHub (Feb 16, 2022):

Per the bug report template:

Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox.

You have not provided any such detail. Obviously merely logging into NetBox does not reproduce the problem, as you can verify for yourself here. If you'd like someone to look into this, you'll need to spend some time determining how to reproduce it.

@jeremystretch commented on GitHub (Feb 16, 2022): Per the bug report template: > Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. You have not provided any such detail. Obviously merely logging into NetBox does not reproduce the problem, as you can verify for yourself [here](https://demo.netbox.dev/). If you'd like someone to look into this, you'll need to spend some time determining how to reproduce it.
Author
Owner

@someconservator commented on GitHub (Feb 16, 2022):

During today I've narrowed down the possible issues: a fresh installation of netbox (by the way, this is centos8.5, and nginx1.20, and with ldap) does indeed work fine. My netbox installation is an upgraded installation from version 3.1. As soon as i dump its database to a fresh installation i immediately get the same error. I have a suspicion that the update script did not make some necessary migrations (while the data itself is present in the database, I checked)

@someconservator commented on GitHub (Feb 16, 2022): During today I've narrowed down the possible issues: a fresh installation of netbox (by the way, this is centos8.5, and nginx1.20, and with ldap) does indeed work fine. My netbox installation is an upgraded installation from version 3.1. As soon as i dump its database to a fresh installation i immediately get the same error. I have a suspicion that the update script did not make some necessary migrations (while the data itself is present in the database, I checked)
Author
Owner

@someconservator commented on GitHub (Feb 22, 2022):

During today I've narrowed down the possible issues: a fresh installation of netbox (by the way, this is centos8.5, and nginx1.20, and with ldap) does indeed work fine. My netbox installation is an upgraded installation from version 3.1. As soon as i dump its database to a fresh installation i immediately get the same error. I have a suspicion that the update script did not make some necessary migrations (while the data itself is present in the database, I checked)

@someconservator commented on GitHub (Feb 22, 2022): During today I've narrowed down the possible issues: a fresh installation of netbox (by the way, this is centos8.5, and nginx1.20, and with ldap) does indeed work fine. My netbox installation is an upgraded installation from version 3.1. As soon as i dump its database to a fresh installation i immediately get the same error. I have a suspicion that the update script did not make some necessary migrations (while the data itself is present in the database, I checked)
Author
Owner

@someconservator commented on GitHub (Feb 22, 2022):

When i try to login in DEBUG mode in test server, i get on console:
[22/Feb/2022 08:22:22] "POST /login/ HTTP/1.1" 302 0
Internal Server Error: /
Traceback (most recent call last):
File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/views/generic/base.py", line 98, in dispatch
return handler(request, *args, **kwargs)
File "/opt/netbox-3.1.8/netbox/netbox/views/init.py", line 136, in get
changelog_table = ObjectChangeTable(changelog, user=request.user)
File "/opt/netbox-3.1.8/netbox/utilities/tables.py", line 68, in init
selected_columns = user.config.get(f"tables.{self.class.name}.columns")
File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/utils/functional.py", line 247, in inner
return func(self._wrapped, *args)
File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/db/models/fields/related_descriptors.py", line 421, in get
raise self.RelatedObjectDoesNotExist(
django.contrib.auth.models.User.config.RelatedObjectDoesNotExist: User has no config.

How I can further understand, what gives me such an error?

@someconservator commented on GitHub (Feb 22, 2022): When i try to login in DEBUG mode in test server, i get on console: [22/Feb/2022 08:22:22] "POST /login/ HTTP/1.1" 302 0 Internal Server Error: / Traceback (most recent call last): File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/views/generic/base.py", line 70, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/views/generic/base.py", line 98, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox-3.1.8/netbox/netbox/views/__init__.py", line 136, in get changelog_table = ObjectChangeTable(changelog, user=request.user) File "/opt/netbox-3.1.8/netbox/utilities/tables.py", line 68, in __init__ selected_columns = user.config.get(f"tables.{self.__class__.__name__}.columns") File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/utils/functional.py", line 247, in inner return func(self._wrapped, *args) File "/opt/netbox-3.1.8/venv/lib64/python3.9/site-packages/django/db/models/fields/related_descriptors.py", line 421, in __get__ raise self.RelatedObjectDoesNotExist( django.contrib.auth.models.User.config.RelatedObjectDoesNotExist: User has no config. How I can further understand, what gives me such an error?
Author
Owner

@someconservator commented on GitHub (Feb 22, 2022):

I found!
When migrating from an older version, the users_userconfig table remains empty:
netboxdb=> select * from users_userconfig;
id | data | user_id
----+------+---------
(0 rows)

when i manually do:
netboxdb=> INSERT INTO users_userconfig values (1,'{}',1);

this error disappears.

hence the questions:
why does this happen?
how best to fix this?
will this continue to happen when a new user is added?

@someconservator commented on GitHub (Feb 22, 2022): I found! When migrating from an older version, the users_userconfig table remains empty: netboxdb=> select * from users_userconfig; id | data | user_id ----+------+--------- (0 rows) when i manually do: netboxdb=> INSERT INTO users_userconfig values (1,'{}',1); this error disappears. hence the questions: why does this happen? how best to fix this? will this continue to happen when a new user is added?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6092