Trying to create storage with RSA encryption: looping?

I’m trying to create a storage with RSA encryption copying from another existing and encrypted storage (without RSA), both in B2.

I’m running this command to add the new storage:

duplicacy add
 -encrypt
 -key public.pem
 -copy [existing storage]
 -repository D:/[redacted]
 [new storage]
 [rep id]
 b2://[new bucket for RSA]

But I’m getting a kind of looping when I run the add command:

Repository set to D:/[redacted]
Enter Backblaze account or application id: [redacted]
Enter corresponding Backblaze application key: [redacted]
download URL is: https://f002.backblazeb2.com
Enter storage password for b2://[new bucket for RSA]: *****************************
Re-enter storage password: *****************************
Enter Backblaze account or application id: [redacted]
Enter corresponding Backblaze application key: [redacted]
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com

(interrupted with ctrl-c)

Why did it request the app id/key twice?

What am I doing wrong?

I decided to leave it running and got:

...
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com
download URL is: https://f002.backblazeb2.com
Failed to load the Backblaze B2 storage at b2://[existing bucket]: URL request 'https://api002.backblazeb2.com/b2api/v1/b2_list_buckets' returned 401

I’ve also tried to provide the old bucket’s app id/key pair, but obviously it doesn’t “find” the new bucket (which has a new key):

Enter Backblaze account or application id:[existing id]
Enter corresponding Backblaze application key:[existing key]
download URL is: https://f001.backblazeb2.com
Failed to load the Backblaze B2 storage at b2://[new bucket]: Bucket [new bucket] not found

Failed to load the Backblaze B2 storage at b2://[existing bucket]: URL request ‘https://api002.backblazeb2.com/b2api/v1/b2_list_buckets’ returned 401

It looks like that your old application id/key can’t access the existing bucket or any other bucket.

The current storage/bucket is in a B2 account (with an id/key pair) and the new bucket is in a new B2 account (and with a new id/key pair).

I thought that the two times when it asks for key pairs are the first for the existing bucket and the second for the new bucket. Is that correct?

No it is the other way around: new storage first and then the existing storage.

Running with -d should give more information.

1 Like

I ran with the debug option and provided the keys in that order. It was clear what they were referring to when the messages about the environment variables appeared. It seems that all the keys were accepted without a problem.

However, it still didn’t work:

...
Reading the environment variable [new storage]__B2_RSA_PASSWORD
Enter storage password for b2://[new RSA bucket]:*****************************
[0] URL request 'HEAD https://f002.backblazeb2.com/file/[new RSA bucket]/config' returned status code 404
https://f002.backblazeb2.com/[new RSA bucket]/config did not return headers
...

...
Reading the environment variable [existing storage]_B2_KEY
Enter corresponding Backblaze application key:[redacted]
[0] URL request 'POST https://api.backblazeb2.com/b2api/v1/b2_authorize_account' returned 401
Failed to load the Backblaze B2 storage at b2://[existing bucket]: Authorization failure

I managed to make it work. It was a mess with the master keys and the apps leys of the two accounts.

The use of debug option was essential. Thanks!

I would like to leave the suggestion that, in these cases, the prompt asking for the keys (Enter Backblaze account or application id:) shows the storage to which it refers.

1 Like

The copy is running smoothly. :ok_hand: