Activating a user's private key #464

Closed
opened 2025-12-29 16:22:25 +01:00 by adam · 6 comments
Owner

Originally created by @bogdanstoica35 on GitHub (Oct 4, 2016).

I have added a new RSA 2048 bits key to one of the user's in my netbox installation. When I try to activate that user's key I am getting this error:

Server Error
There was a problem with your request. This error has been logged and administrative staff have been notified. Please return to the home page and try again.

If you are responsible for this installation, please consider filing a bug report. Additional information is provided below:

<type 'exceptions.TypeError'>
object of type 'NoneType' has no len()

I am using the last versiof of netbox from github on a Debian 8.6 linux

Originally created by @bogdanstoica35 on GitHub (Oct 4, 2016). I have added a new RSA 2048 bits key to one of the user's in my netbox installation. When I try to activate that user's key I am getting this error: Server Error There was a problem with your request. This error has been logged and administrative staff have been notified. Please return to the home page and try again. If you are responsible for this installation, please consider filing a bug report. Additional information is provided below: <type 'exceptions.TypeError'> object of type 'NoneType' has no len() I am using the last versiof of netbox from github on a Debian 8.6 linux
adam closed this issue 2025-12-29 16:22:25 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 4, 2016):

Could you please enable debugging (set DEUBG = True in configuration.py) and post the full stack trace?

@jeremystretch commented on GitHub (Oct 4, 2016): Could you please enable debugging (set `DEUBG = True` in configuration.py) and post the full stack trace?
Author
Owner

@jeremystretch commented on GitHub (Oct 21, 2016):

Closing due to lack of activity.

@jeremystretch commented on GitHub (Oct 21, 2016): Closing due to lack of activity.
Author
Owner

@evagonz commented on GitHub (Oct 24, 2016):

Hello,

Sorry for responding to a closed issue. I'm receiving the same error as @bogdanstoica35, running v. 1.6.3 on CentOS 6.8. This is the debug information I got:

TypeError at /admin/secrets/userkey/
object of type 'NoneType' has no len()
Request Method: POST
Request URL: http://netbox.zacks.com/admin/secrets/userkey/
Django Version: 1.10
Exception Type: TypeError
Exception Value:
object of type 'NoneType' has no len()
Exception Location: /opt/python27/lib/python2.7/site-packages/Crypto/Cipher/PKCS1_OAEP.py in encrypt, line 139
Python Executable: /usr/bin/python27
Python Version: 2.7.6
Python Path:
['/opt/netbox/netbox',
'/opt/python27/bin',
'/opt/python27/lib/python27.zip',
'/opt/python27/lib/python2.7',
'/opt/python27/lib/python2.7/plat-linux2',
'/opt/python27/lib/python2.7/lib-tk',
'/opt/python27/lib/python2.7/lib-old',
'/opt/python27/lib/python2.7/lib-dynload',
'/opt/python27/lib/python2.7/site-packages']
Server time: Mon, 24 Oct 2016 09:40:34 -0500

And the full trace is pasted here:

dpaste.com/0RSW0KX

At first I tried one generated by the application, but it wasn't working for me, so I tested again with this pair that I already had, which I can confirm works.

@evagonz commented on GitHub (Oct 24, 2016): Hello, Sorry for responding to a closed issue. I'm receiving the same error as @bogdanstoica35, running v. 1.6.3 on CentOS 6.8. This is the debug information I got: TypeError at /admin/secrets/userkey/ object of type 'NoneType' has no len() Request Method: POST Request URL: http://netbox.zacks.com/admin/secrets/userkey/ Django Version: 1.10 Exception Type: TypeError Exception Value: object of type 'NoneType' has no len() Exception Location: /opt/python27/lib/python2.7/site-packages/Crypto/Cipher/PKCS1_OAEP.py in encrypt, line 139 Python Executable: /usr/bin/python27 Python Version: 2.7.6 Python Path: ['/opt/netbox/netbox', '/opt/python27/bin', '/opt/python27/lib/python27.zip', '/opt/python27/lib/python2.7', '/opt/python27/lib/python2.7/plat-linux2', '/opt/python27/lib/python2.7/lib-tk', '/opt/python27/lib/python2.7/lib-old', '/opt/python27/lib/python2.7/lib-dynload', '/opt/python27/lib/python2.7/site-packages'] Server time: Mon, 24 Oct 2016 09:40:34 -0500 And the full trace is pasted here: dpaste.com/0RSW0KX At first I tried one generated by the application, but it wasn't working for me, so I tested again with this pair that I already had, which I can confirm works.
Author
Owner

@bogdanstoica35 commented on GitHub (Oct 25, 2016):

I have managed to fix the issue by pulling the last version of netbox from github. As far as I could check, the issue was only on Google Chrome. Same netbox version on the same server was running just fine if I was using Firefox.

@bogdanstoica35 commented on GitHub (Oct 25, 2016): I have managed to fix the issue by pulling the last version of netbox from github. As far as I could check, the issue was only on Google Chrome. Same netbox version on the same server was running just fine if I was using Firefox.
Author
Owner

@evagonz commented on GitHub (Oct 25, 2016):

Thanks for the reply -- unfortunately the issue has persisted for me in Firefox, though my coworker was able to get his activated.

@evagonz commented on GitHub (Oct 25, 2016): Thanks for the reply -- unfortunately the issue has persisted for me in Firefox, though my coworker was able to get his activated.
Author
Owner

@bogdanstoica35 commented on GitHub (Oct 26, 2016):

Try deleting the cache (the private key is basically saved in the browser). In my case, after pulling the latest release from github it works both on firefox and chrome.

@bogdanstoica35 commented on GitHub (Oct 26, 2016): Try deleting the cache (the private key is basically saved in the browser). In my case, after pulling the latest release from github it works both on firefox and chrome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#464