django-q2 icon indicating copy to clipboard operation
django-q2 copied to clipboard

BadSignature error

Open CommitSithLord opened this issue 1 year ago • 5 comments

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 ?

CommitSithLord avatar Mar 07 '23 08:03 CommitSithLord

tried to fixed it by this- python -c "import secrets; print(secrets.token_urlsafe())" worked for a while then error started to appear again

CommitSithLord avatar Mar 07 '23 09:03 CommitSithLord

Are you using different SECRET_KEYs 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)?

GDay avatar Mar 09 '23 13:03 GDay

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.

CommitSithLord avatar Mar 09 '23 23:03 CommitSithLord

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.

GDay avatar Mar 10 '23 12:03 GDay

@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.

mast3rbow avatar Dec 17 '23 23:12 mast3rbow

have you fix this problem?

aji-pratama avatar Oct 07 '24 23:10 aji-pratama