TypeError on /device/register [PUT] endpoint - Need help interpreting traceback

Hi,
I’m seeing the following error in our Pritunl logs and would like help understanding the cause and potential impact. Here’s the full traceback (sensitive data obfuscated):

[pritunl-vpn-host-<obfuscated>][2025-07-21 18:53:15,563][ERROR] Exception on /device/register/<obfuscated>/<obfuscated>/<obfuscated> [PUT]
Traceback (most recent call last):
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/auth/app.py", line 10, in _wrapped
    return call(*args, **kwargs)
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/handlers/device.py", line 48, in device_register_put
    usr.device_register(device_id, reg_key)
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/user/user.py", line 1395, in device_register
    if utils.const_compare(device.get('reg_key', ''), reg_key):
  File "/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py", line 397, in const_compare
    if len(x) != len(y):
TypeError: object of type 'NoneType' has no len()

I’m not sure what specifically triggers this error. From the traceback, it seems like the reg_key from the device object is None, which causes a failure in the const_compare() function.

Could you please clarify:

  1. Under what circumstances could this error occur?
  2. Is this expected behavior under certain conditions (e.g. client misuse, expired state, auth failure)?
  3. Does this indicate a misconfiguration on the server or client side?
  4. Is there any recommended way to handle or suppress this error?

Thanks in advance for your help!

This appears to be an issue fixed in a later release. If a device with the same name was registered it would invalidate it and make it unable to register. I think it was fixed in v1.32.3719.89 but may have been a newer release. The server should be updated and those devices deleted. Verify in the hosts tab that the running version is the latest release.

Hi Zach!
My hosts are running version v1.32.3805.95.

Try deleting all the pending devices shown on the dashboard tab.

Hi,
I’ll follow your guidance.
Thanks, Zach!