401 unauthorized syncing with a restricted B2 key

I am trying to use rclone sync with a B2 key that only has read/write access to a single bucket. This appears to fail because rclone is trying to create the bucket – which already exists. rclone lsd even shows it!

rclone sync output:

2018/10/11 16:24:03 Attempt 1/3 failed with 1 errors and: failed to create bucket: Unknown 401  (401 unauthorized)
2018/10/11 16:24:05 Attempt 2/3 failed with 1 errors and: failed to create bucket: Unknown 401  (401 unauthorized)
2018/10/11 16:24:06 Attempt 3/3 failed with 1 errors and: failed to create bucket: Unknown 401  (401 unauthorized)
2018/10/11 16:24:06 Failed to sync: failed to create bucket: Unknown 401  (401 unauthorized)

Using a B2 application key with read/write access to the entire account works.

Is there something I’m missing? Is there a way to tell rclone sync to assume that the bucket exists and not to try to create it? Why does it not check if the bucket exists before trying to create it?

Try to reconfigure b2

The configuration is not the problem. I can do rclone lsd without error, which does show the one bucket I have configured the restricted key to be able to access. So the key works.

What doesn’t work is trying to create a bucket with a key that doesn’t have permission to create a bucket.

But it’s silly to try to create a bucket that already exists, so why is rclone sync even trying to do that?

I suspect you aren’t using the latest version of rclone. Try 1.43.1 or the latest beta.

Indeed, that was the problem. The version in Debian Stretch apparently has this bug.

1 Like