Issues with Backblaze

I created a bucket on BackBlaze.
I run the following command from my Mac:
restic -r b2:mybucket:s3:s3.eu-central-003.backblazeb2.com init
I receive the following error:

Fatal: create repository at b2:mybucket:s3:s3.eu-central-003.backblazeb2.com failed: Fatal: unable to open repository at b2:mybucket:s3:s3.eu-central-003.backblazeb2.com: Fatal: unable to open B2 backend: Account ID ($B2_ACCOUNT_ID) is empty

Where was I wrong?

You mix b2 native access with S3 I think.

Decide which one you want to use and follow docs.

Also note:

Due to issues with error handling in the current B2 library that restic uses, the recommended way to utilize Backblaze B2 is by using its S3-compatible API.

So focus on latter.

Can you please help me understand what format in concrete I should use?

I succeeded.
I found the solution.
Thank you for the input.

B2 supports two different API - B2 native and industry standard S3. For reasons mentioned in docs looks like S3 is preferred by restic.

You have to get S3 credentials - ACCESS_KEY and SECRET_ACCESS_KEY. How exactly I am not sure as I do not use B2:) But I am sure you can google it easily.

Then you export both keys and connect to S3, as per docs:

export AWS_ACCESS_KEY_ID=<YOUR-S3-ACCESS-KEY-ID>
export AWS_SECRET_ACCESS_KEY=<YOUR-S3-SECRET-ACCESS-KEY>

restic -r s3:https://<SERVICE-URL>/<BUCKET-NAME> init
1 Like

For anyone else who finds this thread, the answer is:

export B2_ACCOUNT_ID="<your B2 Account ID>"
export B2_ACCOUNT_KEY="<your B2 Account Key"

Which restic then reads. The error above “B2 backend: Account ID ($B2_ACCOUNT_ID) is empty” clearly indicates that hadn’t been done.

2 Likes

I used autorestic, and I configured the b2 type.
Notably, to the benefit of all, I used the following settings:

backends:
  bblaze:
    type: b2
    path: bucketname
    key: password
    env:
      B2_ACCOUNT_ID: "string"
      B2_ACCOUNT_KEY: "string"
2 Likes