Documentation suggested to address NameError: name 'NestedGroupOfNamesType' is not defined #1826

Closed
opened 2025-12-29 17:19:33 +01:00 by adam · 0 comments
Owner

Originally created by @alexjhart on GitHub (Jul 4, 2018).

Issue type

[ ] Feature request
[ ] Bug report
[x] Documentation
[ ] Housekeeping

Environment

  • Python version: 3.5.2
  • NetBox version: 2.3.5

Description

Following the LDAP documentation for nested groups, I ended up with this error:

NameError: name 'NestedGroupOfNamesType' is not defined[2018-07-03 16:08:11 -0700] [14210] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 126, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.5/dist-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/opt/netbox/netbox/netbox/wsgi.py", line 8, in <module>
    application = get_wsgi_application()
  File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 22, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/netbox/netbox/netbox/settings.py", line 78, in <module>
    from netbox.ldap_config import *
  File "/opt/netbox/netbox/netbox/ldap_config.py", line 30, in <module>
    AUTH_LDAP_GROUP_TYPE = NestedGroupOfNamesType()
NameError: name 'NestedGroupOfNamesType' is not defined

Turns out this line:

 from django_auth_ldap.config import LDAPSearch, GroupOfNamesType

needs to be replaced with:

 from django_auth_ldap.config import LDAPSearch, NestedGroupOfNamesType
Originally created by @alexjhart on GitHub (Jul 4, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [ ] Bug report <!-- Unexpected or erroneous behavior --> [x] Documentation <!-- A modification to the documentation --> [ ] Housekeeping <!-- Changes pertaining to the codebase itself --> ### Environment * Python version: 3.5.2 * NetBox version: 2.3.5 ### Description Following the LDAP documentation for nested groups, I ended up with this error: ``` NameError: name 'NestedGroupOfNamesType' is not defined[2018-07-03 16:08:11 -0700] [14210] [ERROR] Exception in worker process Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker worker.init_process() File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 126, in init_process self.load_wsgi() File "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi self.wsgi = self.app.wsgi() File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.5/dist-packages/gunicorn/util.py", line 352, in import_app __import__(module) File "/opt/netbox/netbox/netbox/wsgi.py", line 8, in <module> application = get_wsgi_application() File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application django.setup(set_prefix=False) File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 22, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 56, in __getattr__ self._setup(name) File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 41, in _setup self._wrapped = Settings(settings_module) File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 110, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/opt/netbox/netbox/netbox/settings.py", line 78, in <module> from netbox.ldap_config import * File "/opt/netbox/netbox/netbox/ldap_config.py", line 30, in <module> AUTH_LDAP_GROUP_TYPE = NestedGroupOfNamesType() NameError: name 'NestedGroupOfNamesType' is not defined ``` Turns out this line: ```python from django_auth_ldap.config import LDAPSearch, GroupOfNamesType ``` needs to be replaced with: ```python from django_auth_ldap.config import LDAPSearch, NestedGroupOfNamesType ```
adam added the status: acceptedtype: documentation labels 2025-12-29 17:19:33 +01:00
adam closed this issue 2025-12-29 17:19:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1826