__init__() got an unexpected keyword argument 'null_value' #1582

Closed
opened 2025-12-29 16:33:11 +01:00 by adam · 5 comments
Owner

Originally created by @loganbest on GitHub (Feb 27, 2018).

Issue type

[ ] Feature request
[X] Bug report
[ ] Documentation

Environment

  • Python version: 2.7.12
  • NetBox version: 2.2.10
  • PostgreSQL version: 9.5

Description

This issue is the same exact thing as #1736. Since that issue is closed and the problem is still apparent after making sure django-filter is v1.1.0 or greater. Previous issue was on Python 3, but I'm on Python 2. Here's the debug output

Environment:


Request Method: GET
Request URL: https://netbox.webair.com/ipam/ip-addresses/

Django Version: 1.11.3
Python Version: 2.7.12
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'corsheaders',
 'debug_toolbar',
 'django_filters',
 'django_tables2',
 'mptt',
 'rest_framework',
 'rest_framework_swagger',
 'circuits',
 'dcim',
 'ipam',
 'extras',
 'secrets',
 'tenancy',
 'users',
 'utilities',
 'virtualization')
Installed Middleware:
('debug_toolbar.middleware.DebugToolbarMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'utilities.middleware.ExceptionHandlingMiddleware',
 'utilities.middleware.LoginRequiredMiddleware',
 'utilities.middleware.APIVersionMiddleware')



Traceback:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/opt/netbox/netbox/utilities/views.py" in get
  85.             self.queryset = self.filter(request.GET, self.queryset).qs

File "/usr/local/lib/python2.7/dist-packages/django_filters/filterset.py" in qs
  200.             if not self.form.is_valid():

File "/usr/local/lib/python2.7/dist-packages/django_filters/filterset.py" in form
  225.                 for name, filter_ in six.iteritems(self.filters)])

File "/usr/local/lib/python2.7/dist-packages/django_filters/filters.py" in field
  158.                                                **field_kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/forms/fields.py" in __init__
  778.             help_text=help_text, *args, **kwargs

Exception Type: TypeError at /ipam/ip-addresses/
Exception Value: __init__() got an unexpected keyword argument 'null_value'
Originally created by @loganbest on GitHub (Feb 27, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [X] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> ### Environment * Python version: 2.7.12 * NetBox version: 2.2.10 * PostgreSQL version: 9.5 ### Description This issue is the same exact thing as #1736. Since that issue is closed and the problem is still apparent after making sure django-filter is v1.1.0 or greater. Previous issue was on Python 3, but I'm on Python 2. Here's the debug output ``` Environment: Request Method: GET Request URL: https://netbox.webair.com/ipam/ip-addresses/ Django Version: 1.11.3 Python Version: 2.7.12 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'corsheaders', 'debug_toolbar', 'django_filters', 'django_tables2', 'mptt', 'rest_framework', 'rest_framework_swagger', 'circuits', 'dcim', 'ipam', 'extras', 'secrets', 'tenancy', 'users', 'utilities', 'virtualization') Installed Middleware: ('debug_toolbar.middleware.DebugToolbarMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'utilities.middleware.ExceptionHandlingMiddleware', 'utilities.middleware.LoginRequiredMiddleware', 'utilities.middleware.APIVersionMiddleware') Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch 88. return handler(request, *args, **kwargs) File "/opt/netbox/netbox/utilities/views.py" in get 85. self.queryset = self.filter(request.GET, self.queryset).qs File "/usr/local/lib/python2.7/dist-packages/django_filters/filterset.py" in qs 200. if not self.form.is_valid(): File "/usr/local/lib/python2.7/dist-packages/django_filters/filterset.py" in form 225. for name, filter_ in six.iteritems(self.filters)]) File "/usr/local/lib/python2.7/dist-packages/django_filters/filters.py" in field 158. **field_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/forms/fields.py" in __init__ 778. help_text=help_text, *args, **kwargs Exception Type: TypeError at /ipam/ip-addresses/ Exception Value: __init__() got an unexpected keyword argument 'null_value' ```
adam closed this issue 2025-12-29 16:33:11 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 27, 2018):

I'm not able to replicate this with v2.2.10 under Python 2.7.12 with django-filter v1.1.0 installed. What is the output of pip freeze?

@jeremystretch commented on GitHub (Feb 27, 2018): I'm not able to replicate this with v2.2.10 under Python 2.7.12 with django-filter v1.1.0 installed. What is the output of `pip freeze`?
Author
Owner

@loganbest commented on GitHub (Feb 28, 2018):

/opt/netbox# pip freeze
asn1crypto==0.24.0
bcrypt==3.1.4
blinker==1.3
certifi==2018.1.18
cffi==1.11.4
chardet==3.0.4
cloud-init==17.1
command-not-found==0.3
configobj==5.0.6
coreapi==2.3.3
coreschema==0.0.4
cryptography==2.1.4
Django==1.11.10
django-cors-headers==2.1.0
django-debug-toolbar==1.9.1
django-filter==1.1.0
django-mptt==0.8.7
django-rest-swagger==2.1.2
django-tables2==1.19.0
djangorestframework==3.7.7
graphviz==0.8.2
gunicorn==19.4.5
idna==2.6
itypes==1.1.0
Jinja2==2.10
jsonpatch==1.10
jsonpointer==1.9
language-selector==0.1
lxml==4.1.1
Markdown==2.6.11
MarkupSafe==1.0
natsort==5.2.0
ncclient==0.5.3
netaddr==0.7.18
oauthlib==1.0.3
olefile==0.44
openapi-codec==1.3.2
paramiko==2.4.0
Pillow==5.0.0
prettytable==0.7.2
psycopg2==2.7.4
py-gfm==0.1.3
pyasn1==0.4.2
pycparser==2.18
pycryptodome==3.4.11
pycurl==7.43.0
pygobject==3.20.0
PyJWT==1.3.0
PyNaCl==1.2.1
pyserial==3.0.1
python-apt==1.1.0b1
python-debian==0.1.27
python-systemd==231
pytz==2018.3
PyYAML==3.11
requests==2.18.4
simplejson==3.13.2
six==1.11.0
sqlparse==0.2.4
ssh-import-id==5.5
ufw==0.35
unattended-upgrades==0.1
uritemplate==3.0.0
urllib3==1.22
virtualenv==15.0.1
xmltodict==0.11.0
@loganbest commented on GitHub (Feb 28, 2018): ``` /opt/netbox# pip freeze asn1crypto==0.24.0 bcrypt==3.1.4 blinker==1.3 certifi==2018.1.18 cffi==1.11.4 chardet==3.0.4 cloud-init==17.1 command-not-found==0.3 configobj==5.0.6 coreapi==2.3.3 coreschema==0.0.4 cryptography==2.1.4 Django==1.11.10 django-cors-headers==2.1.0 django-debug-toolbar==1.9.1 django-filter==1.1.0 django-mptt==0.8.7 django-rest-swagger==2.1.2 django-tables2==1.19.0 djangorestframework==3.7.7 graphviz==0.8.2 gunicorn==19.4.5 idna==2.6 itypes==1.1.0 Jinja2==2.10 jsonpatch==1.10 jsonpointer==1.9 language-selector==0.1 lxml==4.1.1 Markdown==2.6.11 MarkupSafe==1.0 natsort==5.2.0 ncclient==0.5.3 netaddr==0.7.18 oauthlib==1.0.3 olefile==0.44 openapi-codec==1.3.2 paramiko==2.4.0 Pillow==5.0.0 prettytable==0.7.2 psycopg2==2.7.4 py-gfm==0.1.3 pyasn1==0.4.2 pycparser==2.18 pycryptodome==3.4.11 pycurl==7.43.0 pygobject==3.20.0 PyJWT==1.3.0 PyNaCl==1.2.1 pyserial==3.0.1 python-apt==1.1.0b1 python-debian==0.1.27 python-systemd==231 pytz==2018.3 PyYAML==3.11 requests==2.18.4 simplejson==3.13.2 six==1.11.0 sqlparse==0.2.4 ssh-import-id==5.5 ufw==0.35 unattended-upgrades==0.1 uritemplate==3.0.0 urllib3==1.22 virtualenv==15.0.1 xmltodict==0.11.0 ```
Author
Owner

@jeremystretch commented on GitHub (Mar 7, 2018):

Closing this out as I'm not able to replicate it on a fresh installation. Please post to the mailing list if you require further assistance.

@jeremystretch commented on GitHub (Mar 7, 2018): Closing this out as I'm not able to replicate it on a fresh installation. Please post to the mailing list if you require further assistance.
Author
Owner

@loganbest commented on GitHub (Mar 7, 2018):

really? So I'm just supposed to not access these pages anymore?

@loganbest commented on GitHub (Mar 7, 2018): really? So I'm just supposed to not access these pages anymore?
Author
Owner

@olenoerby commented on GitHub (Jul 27, 2018):

This solved it for me:

pip3 install django-filter==1.1.0

Edit: Please reply back if it solved it for you. I know it's a long time ago you wrote this, but it's worth the trouble to help other people.

@olenoerby commented on GitHub (Jul 27, 2018): This solved it for me: pip3 install django-filter==1.1.0 Edit: Please reply back if it solved it for you. I know it's a long time ago you wrote this, but it's worth the trouble to help other people.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1582