User has no config

229 views
Skip to first unread message

Sanju O

unread,
Nov 5, 2020, 4:32:47 AM11/5/20
to NetBox
Hello,

The below error is being thrown when clicking on any of the option in the netbox, but able to add the details.

<class 'django.contrib.auth.models.User.config.RelatedObjectDoesNotExist'>
User has no config. Python version: 3.6.8 NetBox version: 2.9.8

If anybody faced similar issue and  having solution it will be a great help. I am new in network automation so there may be config mistake done from my end

Thanks in advance



Brian Candler

unread,
Nov 5, 2020, 5:55:43 AM11/5/20
to NetBox
1. Get a Postgres SQL prompt: under Ubuntu it would be "sudo -u postgres psql netbox"

Then show the results of these SQL queries:

select id, username from auth_user;
select * from users_userconfig;

users_userconfig is the table of user web view preferences, and I would have thought it would be populated automatically on demand.

2. Are you using Netbox's built-in username/password authentication, or something else (LDAP? Remote auth?)  Are you logging in as an administrator or as an unprivileged user?

3. Finally, it could also be helpful to get a proper backtrace.  You can get this by editing configuration.py, and setting DEBUG = True (in which case a more detailed error is displayed in the web browser), or by settings ADMINS to give one or more real contact details and EMAIL to a suitable mail relay (in which case, any exceptions like this will be E-mailed out automatically, even with DEBUG = False)

Message has been deleted
Message has been deleted

Jeremy Hermsdorf

unread,
Nov 12, 2020, 8:19:33 AM11/12/20
to NetBox
For some reason my post was deleted.  I have this same problem after new install and I signed in as superuser created by following instructions.  I'm using netbox built-in auth.  Here is the SQL query results:

netbox=> select id, username from auth_user;
 id | username
----+----------
  1 | admin
(1 row)

netbox=> select * from users_userconfig;
 id | data | user_id
----+------+---------
(0 rows)

Do you want me to post all of the debug output?  I did that yesterday but my message was deleted??  Thanks.

Message has been deleted
Message has been deleted
Message has been deleted

Jeremy Hermsdorf

unread,
Nov 12, 2020, 3:47:58 PM11/12/20
to NetBox
The system does not like something with the content of the debug, every time I post it gets deleted.  Trying with copy and paste view:

Environment:


Request Method: GET

Django Version: 3.1
Python Version: 3.6.8
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'cacheops',
 'corsheaders',
 'debug_toolbar',
 'django_filters',
 'django_tables2',
 'django_prometheus',
 'mptt',
 'rest_framework',
 'taggit',
 'timezone_field',
 'circuits',
 'dcim',
 'ipam',
 'extras',
 'secrets',
 'tenancy',
 'users',
 'utilities',
 'virtualization',
 'django_rq',
 'drf_yasg']
Installed Middleware:
['debug_toolbar.middleware.DebugToolbarMiddleware',
 'django_prometheus.middleware.PrometheusBeforeMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'utilities.middleware.ExceptionHandlingMiddleware',
 'utilities.middleware.RemoteUserMiddleware',
 'utilities.middleware.LoginRequiredMiddleware',
 'utilities.middleware.APIVersionMiddleware',
 'extras.middleware.ObjectChangeMiddleware',
 'django_prometheus.middleware.PrometheusAfterMiddleware']



Traceback (most recent call last):
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 73, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 124, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/views/generic/base.py", line 101, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 307, in get
    columns = request.user.config.get(f"tables.{self.table.__name__}.columns")
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/utils/functional.py", line 241, in inner
    return func(self._wrapped, *args)
  File "/opt/netbox/venv/lib64/python3.6/site-packages/django/db/models/fields/related_descriptors.py", line 424, in __get__
    self.related.get_accessor_name()

Exception Type: RelatedObjectDoesNotExist at /ipam/ip-addresses/
Exception Value: User has no config.

Jeremy Hermsdorf

unread,
Nov 17, 2020, 9:11:12 AM11/17/20
to NetBox
Does anyone have any ideas on this issue?  Everything I click on from the home page like IP Addresses, VLANs, Circuits, etc... results in the below error message and I can't use the product.  This is after a new install so I must have missed something or something went wrong in the process.  I have included all the debug info above in previous posts.

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

User has no config.

Python version: 3.6.8
NetBox version: 2.9.9

Thanks!!

Sanju O

unread,
Nov 17, 2020, 11:14:10 AM11/17/20
to Jeremy Hermsdorf, NetBox
Hello,

I was also unable to rectify the error. Try installing using docker containers

With Regards,

Sanju O
Network Engineer
Mob No: 8156989021
Chinmaya International Foundation
Swamiye Saranam Ayyappa
Visit our website: www.chinfo.org 
 
        
Disclaimer:This email is confidential and may also be privileged. If you are not the intended recipient, please delete it and notify us immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Views and opinions expressed are those of the sender. The Foundation accepts no liability whatsoever for any loss or damages incurred. For more information about Chinmaya International Foundation visit  www.chinfo.org.


--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/efc1747d-b176-40ca-8fad-2ace950eb175n%40googlegroups.com.
Message has been deleted

Jeremy Hermsdorf

unread,
Nov 19, 2020, 4:25:30 PM11/19/20
to NetBox
I found the solution to this problem.  The issue was REDIS was less than version 4 so when the manage.py createsuperuser script was run it did not complete thus causing all the login and permission issues.  I rebuilt the server and upgraded REDIS to version 6.x (latest as of this post) using this link:  https://computingforgeeks.com/how-to-install-latest-redis-on-centos-7/

Once that was completed then the superuser script completed successfully thus solving the login/permission issues.  I also had to mess with nginx configs to get the web server working and for that I followed this link:  https://github.com/netbox-community/netbox/issues/1906

Thanks.

Gasparr P

unread,
Nov 27, 2020, 9:22:18 AM11/27/20
to NetBox
Just to share my experience for this error. I also got the 'user has no config error'. Same as Jherms, I have to update Redis, because Netbox 2.9 requires minimum redis 4 , and centos 7 is a bit behind the avalilable lastest Redis. Then I remove the users account in postgres DB
netbox=> SELECT * FROM auth_user;
netbox=> DELETE FROM auth_user WHERE username = 'admin';

and just need to recreate the account with (venv) [xxxxxxx netbox]$ python3 manage.py createsuperuser

That works
Reply all
Reply to author
Forward
0 new messages