pynetbox
pynetbox copied to clipboard
Got not "enough values to unpack" error when pass additional headers
Trying to create webhook with additional headers, but got the error below.
Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.9/site-packages/rq/worker.py", line 1061, in perform_job
rv = job.perform()
File "/opt/netbox/venv/lib/python3.9/site-packages/rq/job.py", line 821, in perform
self._result = self._execute()
File "/opt/netbox/venv/lib/python3.9/site-packages/rq/job.py", line 844, in _execute
result = self.func(*self.args, **self.kwargs)
File "/opt/netbox/netbox/extras/webhooks_worker.py", line 58, in process_webhook
raise e
File "/opt/netbox/netbox/extras/webhooks_worker.py", line 55, in process_webhook
headers.update(webhook.render_headers(context))
File "/opt/netbox/netbox/extras/models/models.py", line 166, in render_headers
header, value = line.split(':', 1)
ValueError: not enough values to unpack (expected 2, got 1)
The header I added was simple, just an authorization header
Authorization:
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NDcwMDgwMDAsInN1YiI6Im5ldGJveC13ZWJob29rIiwibmJmIjoxNjQwODU2NTg2LCJtesttest_keysYsImF1ZCI6WyJrYWZrYS1yZXN0LXByb3h5Il0sImlzcyI6InNlY3JldC9kYXRhLXN0b3JhZ2Uva2Fma2EtcmVzdC1wcm94eS9kZXYvc2VydmljZS1hdXRoIn0.GAEcbzR5Hk7SKg2ZGcE37Ti85VzxxTJkqBzHv7abNjyWYZ2UfI9MZLG--GE2AYSP6ZxOGSylU69gfXiH-jlzrlXylgHt9ZfQzQPqTGXzyy3orinr3tpepKvkKTA_uPRK1vAoyux3Uit0Z617_QCatnvpSDcm5EKCbIa8StvxcLRu6D_zK8uzTBHyIDnnwVwvBDGc6Cd40Cfg7JGTest_keys_testEDG5YTR5xBknSiEXnmXEKWtGnLmyFOoKjifmy1ui78pc4testkeystestV9psBdKGLKEkzmmDsTL6SxMBgNY_nKCAWbZl4SQ
Not sure why the error happend. The netbox version: v3.1.5
How exactly is this related to pynetbox
package?
It doesn't appear to be. Also, your NetBox installation is a bit dated; please try upgrading to the current stable release and you may find that it resolves your issue.
Closing this issue as it appears to be a configuration error.