autorestic icon indicating copy to clipboard operation
autorestic copied to clipboard

copy to backblaze fails

Open cschritt opened this issue 3 years ago • 12 comments

autorestic version: 1.7.1 restic version: 0.13.1

backends:
  local:
    type: local
    path: /backup/data
    key: $KEY
  backblaze:
    type: b2
    path: '$PATH'
    key: $KEY
    env:
      B2_ACCOUNT_ID: '$ID'
      B2_ACCOUNT_KEY: '$KEY'

locations:
  data:
    from:
    - /data
    to:
    - local
    copy:
      local: 
        - backblaze

With this config on an initialized b2 repository, the copy fails for no apparent reason.

user@host:~> autorestic -c .config/restic/autorestic.yaml backup --ci --verbose --all
Backend: local
> Executing: /usr/local/bin/restic backup --tag ar:location:data /data
using parent snapshot xxx

Files:           0 new,     0 changed, xxx unmodified
Dirs:            0 new,     0 changed,  xxx unmodified
Added to the repo: 0 B

snapshot xxx of [/data] at 2022-08-17 20:24:20.645239574 +0200 CEST)
  copy started, this may take a while...
snapshot xxx saved
Copying local → backblaze
> Executing: /usr/local/bin/restic copy xxx

Running hooks
[...]
exit status 1

Is there any way to debug this further?

cschritt avatar Aug 17 '22 18:08 cschritt

I think it's a problem with restic since autorestic just call the restic binary with the proper arguments

rdelaage avatar Aug 28 '22 16:08 rdelaage

Have you run check?

cupcakearmy avatar Sep 13 '22 13:09 cupcakearmy

Ran into this issue as well. Using check says it's initializing but still fails

 autorestic check --verbose 2 -c ~/server/backup/.autorestic.yml
Using config:    ~/server/backup/.autorestic.yml
Using lock:      ~/server/backup/.autorestic.lock.yml
> Executing: /usr/local/bin/restic check
> Executing: /usr/local/bin/restic check
Initializing backend "backblaze"...
> Executing: /usr/local/bin/restic init
Error: exit status 1

I have pretty much the same config as OP

vinaydawani avatar Dec 01 '22 05:12 vinaydawani

Got the same issue - backup to backblaze is fine, when i try copy it fails. Unfortunately there is no proper error log / message.

scubao avatar Jul 13 '23 21:07 scubao

Got the same issue too.

I'm on Arch Linux, and I can see that using version 1.7.4.-1 it was working fine. Since then, it started to error.

alvaro17f avatar Aug 01 '23 17:08 alvaro17f

Got this too.

hogcycle avatar Jan 02 '24 05:01 hogcycle

I finally got to take a closer look at this again. restic recommends to use the s3 API for backblaze now in their docs https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#backblaze-b2

I tested this method and it is working without any issues for me. Heres an example config. Don't be confused by the AWS_ variables. Put in the values for the Backblaze API.

[...]
backends:
    backblaze_b2:
        type: s3
        path: https://s3.us-west-002.backblazeb2.com/<b2-bucket>/<directory>
        key: <restic-key>
        env:
            AWS_ACCESS_KEY_ID: <apiKeyId>
            AWS_SECRET_ACCESS_KEY: <apiKey>

cschritt avatar Jan 04 '24 20:01 cschritt

@cschritt I tested today with the latest versions of restic and autorestic and it's still not working. I can successfully backup to s3 directly but I can't use copy from a local backend to s3.

Do you have any more details about your working config?

I think it's a problem with restic since autorestic just call the restic binary with the proper arguments

Copying directly with restic (without autorestic) works. I think that the issue is how autorestic sets up the two environments to copy from/to.

Anybody has an idea how to debug this? The failure unfortunately leaves no trace in the log, just an exit status 1

pec0ra avatar Jan 05 '24 06:01 pec0ra

@pec0ra

Do you have any more details about your working config?

I started on a fresh B2 bucket this time. I also first created a backup on the b2 backend as a primary target. Then I reconfigured autorestic and ran another backup. This effectively replicated all data on the b2 backend, but the copy finished successfully. I did not take any further care about the extra setup step or the redundant data on the backend, yet.

cschritt avatar Jan 07 '24 22:01 cschritt