StorageForbiddenException for ApiClient


#1

I was using the ApiClient to upload some files on the collab storage. It was for a batch of around 50 models, and the first 20 or so were successfully uploaded. For all the remaining I kept getting the error: “You are forbidden to do this” which corresponds to StorageForbiddenException for the ApiClient.

On re-running the upload for one of the failed models, it went through smoothly and the files were available on collab storage. Wondering if it had anything to do with multiple repeated requests, I did a test today of uploading 50 dummy entries to collab storage in rapid succession, and there seemed to be no problem.

Could someone let me know under what scenarios this error can be expected? Not sure how I can reproduce the problem, so hard to debug.


#2

Dear Shailesh,

It seems that you have encountered an issue with the token expiration.

If it happens again, you should re-execute the code that get a token and then instantiate the client.

Best regards


#3

This was my initial thought. But immediately after the requests failed, I manually tried doing this for one of the failed entries and it worked - without being freshly authenticated (using the old token). And also I faced this situation on some occasions previously when I was getting authenticated afresh just prior to each request.

Shall try to record and post more details the next time I encounter this problem. Thanks.