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

**URL:** <https://forum.pritunl.com/t/typeerror-on-device-register-put-endpoint-need-help-interpreting-traceback/3442>\
**Category:** Pritunl VPN\
**Created:** [July 22, 2025, 8:59pm UTC](https://forum.pritunl.com/t/typeerror-on-device-register-put-endpoint-need-help-interpreting-traceback/3442 "2025-07-22T20:59:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Latorre](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/l/b5ac83/32.png) [@Latorre](https://forum.pritunl.com/u/Latorre)\
**Post date:** [July 22, 2025, 8:59pm UTC](https://forum.pritunl.com/t/typeerror-on-device-register-put-endpoint-need-help-interpreting-traceback/3442/1 "2025-07-22T20:59:28Z")

</div>

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):

```auto
[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!

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [July 24, 2025, 12:39pm UTC](https://forum.pritunl.com/t/typeerror-on-device-register-put-endpoint-need-help-interpreting-traceback/3442/2 "2025-07-24T12:39:03Z")

</div>

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**](https://github.com/pritunl/pritunl/releases/tag/1.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.

---

<div class="post-metadata">

**Author:** ![Latorre](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/l/b5ac83/32.png) [@Latorre](https://forum.pritunl.com/u/Latorre)\
**Post date:** [July 24, 2025, 3:14pm UTC](https://forum.pritunl.com/t/typeerror-on-device-register-put-endpoint-need-help-interpreting-traceback/3442/3 "2025-07-24T15:14:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [July 24, 2025, 7:50pm UTC](https://forum.pritunl.com/t/typeerror-on-device-register-put-endpoint-need-help-interpreting-traceback/3442/4 "2025-07-24T19:50:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Latorre](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/l/b5ac83/32.png) [@Latorre](https://forum.pritunl.com/u/Latorre)\
**Post date:** [July 25, 2025, 2:25pm UTC](https://forum.pritunl.com/t/typeerror-on-device-register-put-endpoint-need-help-interpreting-traceback/3442/5 "2025-07-25T14:25:36Z")

</div>

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