-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
b2sdk with InMemoryAccountInfo not successfully reauthenticating after authorizationToken expires #509
Comments
This is most likely related to the This AccountInfo uses django cache (as it should). Alternatively, if you don't trust neither b2sdk nor django-backblaze-b2 package you can use S3 compatibility and for example https://django-storages.readthedocs.io/en/latest/backends/s3_compatible/backblaze-B2.html as django storage backend if you don't mind a slightly less efficient non-native API implementation. Please note though, that if your caching is badly configured - for example, Dummy or LocMemCache cache is used with multiple django serving processes - you are going to encounter more unexpected errors in your app, so I strongly suggest double checking that first. |
Thanks for the reply. When we first started seeing this error, my guess was that I can confirm that b2sdk is using that class:
Something I am seeing now is the |
AccountInfo class is the one that is important here. My suspicion was that Please share full traceback of an error, b2sdk version used, ideally with debug logs as well. The b2sdk version used should not matter much since I don't recall last time when we had to fix the reauth code, but as always I highly recommend using the latest version. |
I'm using https://github.com/ehossack/django-backblaze-b2 as a storage backend, which uses
b2sdk
to store files in a backblaze bucket.Around 24 hours after deployment, I see frequent errors:
unauthorized for application key with capabilities 'readFiles,listBuckets,shareFiles,listFiles,readBuckets,writeFiles,deleteFiles', restricted to bucket <bucket-name>
. My understanding is theauthorizationToken
has expired and isn't being refreshed.django-backblaze-b2
instantiates aB2Api
, authorizes the account, then doesn't interact with the authentication lifecycle at all, leaving that up tob2sdk
. I believe these errors are related tob2sdk
, and notdjango-backblaze-b2
.With these errors, I see the following two requests:
This leads me to believe that the
_reauthorization_loop
method is running to attempt to update theauthorizationToken
, then failing.Unfortunately I can't replicate this in an environment where I can step through the error, since it requires waiting 24 hours for the
authorizationToken
to expire.The text was updated successfully, but these errors were encountered: