django-q2
django-q2 copied to clipboard
BadSignature error
Hey, I am getting this error on one of my servers-
Message: BadSignature('Signature "Oi9T5QQeT9ag7ayHMWlnJ9ifcZ2vE1_TUNDgLnxAbK0" does not match')
Arguments: ('Traceback (most recent call last):\n File "/home/ubuntu/dev-backend/venv/lib/python3.8/site-packages/django_q/cluster.py", line 356, in pusher\n task = SignedPackage.loads(task[1])\n File "/home/ubuntu/dev-backend/venv/lib/python3.8/site-packages/django_q/signing.py", line 25, in loads\n return signing.loads(\n File "/home/ubuntu/dev-backend/venv/lib/python3.8/site-packages/django_q/core_signing.py", line 35, in loads\n base64d = force_bytes(TimestampSigner(key, salt=salt).unsign(s, max_age=max_age))\n File "/home/ubuntu/de-backend/venv/lib/python3.8/site-packages/django_q/core_signing.py", line 70, in unsign\n result = super(TimestampSigner, self).unsign(value)\n File "/home/ubuntu/dev-backend/venv/lib/python3.8/site-packages/django_q/core_signing.py", line 55, in unsign\n raise BadSignature(\'Signature "%s" does not match\' % sig)\ndjango.core.signing.BadSignature: Signature "Oi9T5QQeT9ag7ayHMWlnJ9ifcZ2vE1_TUNDgLnxAbK0" does not match\n',)
any ideas ?
tried to fixed it by this- python -c "import secrets; print(secrets.token_urlsafe())" worked for a while then error started to appear again
Are you using different SECRET_KEY
s with your installation (or did you change it after some time)? To pack/unpack packages the SECRET_KEY
needs to be the same, otherwise it will raise that error. Or did you perhaps change any of the settings (such as compress
)?
Hey, I was running 2 Django projects on server and both were using clusters on same port maybe that is why the error came otherwise I have same project running on a diff server without any error.
were using clusters on same port
Same port?
If you are using the same broker for the two apps and you didn't set a different name, then yeah, that could be the issue.
@Amanb1145, I had the same issue. Turns out my Django_q was using the same redis backend, updating the queue names fixed the bad signature error. So I would recommend setting a name.
have you fix this problem?