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:
- Under what circumstances could this error occur?
- Is this expected behavior under certain conditions (e.g. client misuse, expired state, auth failure)?
- Does this indicate a misconfiguration on the server or client side?
- Is there any recommended way to handle or suppress this error?
Thanks in advance for your help!