Backblaze / B2_Command_Line_Tool

The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage
Other
543 stars 128 forks source link

authorzation failed while the file is being uploaded with the argument --incremental-mode #1057

Open stupidloud opened 2 weeks ago

stupidloud commented 2 weeks ago

ERROR: unauthorized for application key with capabilities 'writeBucketEncryption,readBucketReplications,listAllBucketNames,writeFiles,readBucketEncryption,writeBucketReplications,readFiles,listFiles,listBuckets,readBuckets,deleteFiles,shareFiles', restricted to bucket 'bucketname1' (None)

sometimes my bucket has unfinished uploading large files, I always manually deleted them. I assume --incremental-mode has a capability to append data to the these files, instead of adding another version. but the uploading is failed with the message on the first line.

ppolewicz commented 2 weeks ago

Hi,

thank you for the bug report. This is not supposed to happen. Have you deleted the unfinished large file as the CLI was uploading the affected file?

stupidloud commented 1 week ago

I updated the command b2v4 from 4.1 to 4.2, now I cannot reproduce this issue. but a new file version was still added while --incremental-mode is used. the procedure:

  1. b2 file upload --incremental-mode --threads 4 --sha1 9ae4aeab1a128b361c3825fb3c0c550b9bef332e testbk0 filevov1306 00498f907da83
  2. manually CTRL+C to interrupt the upload
  3. re-ran b2 file upload --incremental-mode --threads 4 --sha1 9ae4aeab1a128b361c3825fb3c0c550b9bef332e testbk0 filevov1306 00498f907da83 and wait the completion
  4. two 00498f907da83 were found on b2 server and one of the them is un-finished
stupidloud commented 1 week ago

This bug is still there. After uploaded a few files, each upload command (same arguments but different files) produced the same error. It's not second upload attempt. Each fresh upload had this error.

ppolewicz commented 6 days ago

Hey,

I'm slightly confused. Is the problem that you are getting an "authorization error", or that the upload session is not continued from where it left off? Or maybe it's both?

stupidloud commented 6 days ago

I am getting an "authorization error", but not always. I wrote a script to watch a directory, to upload files which were put into. After a few files were successfully uploaded, the upload command continuously reported this error message. To identify the reason, I logined to the b2 web console, confirmed that there is no unfinished parts of those files which referenced.

I think the error is related to your server. And I think you should continuously upload a few files to reproduce this error.

To resolve, I remove --incremental-mode from the command line.