Had restic
working fine on Arch Linux with a repository in B2 for a year or so without issue. Sometime last year (perhaps after an update to restic
?), it began giving a “connection refused error” that I am at a loss of how to debug:
$ restic -r b2:my-bucket:my-key/ backup /home/my-user/repos/ 2>&1
Fatal: unable to open repository at b2:my-bucket:my-key/: dial tcp: lookup [api.backblazeb2.com](http://api.backblazeb2.com/) on [::1]:53: read udp [::1]:34947->[::1]:53: read: connection refused
$ restic -r b2:my-bucket:my-key list snapshots
Fatal: unable to open repository at b2:my-bucket:my-key: dial tcp: lookup api.backblazeb2.com on [::1]:53: read udp [::1]:51894->[::1]:53: read: connection refused
Current version I am using:
$ restic version
restic 0.15.1 compiled with go1.20 on linux/amd64
The only configuration I have are environment variables: I have set
B2_ACCOUNT_ID
B2_ACCOUNT_KEY
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
RESTIC_PASSWORD
What I have Tried
I ensured that the B2 endpoint is reachable from my machine, by running b2 authorize-account
and b2 list-buckets
on the same machine and confirming that they work just fine.
I note that the restic docs recommend using the S3 API to access B2. So I tried through S3 (after setting up the appropriate environment variables) and got a similar error:
$ restic -r s3:s3.us-west-001.backblazeb2.com/my-bucket/my-key list snapshots
Fatal: unable to open config file: Stat: Get "https://s3.us-west-001.backblazeb2.com/my-bucket/my-key/?location=": dial tcp: lookup s3.us-west-001.backblazeb2.com on [::1]:53: read udp [::1]:48826->[::1]:53: read: connection refused
Is there a repository at the following location?
s3:s3.us-west-001.backblazeb2.com/my-bucket/my-key
Finally, I confirmed that from a different machine (a MacBook) on the same network, restic
works just fine with both the B2 and S3 APIs:
$ restic -r b2:my-bucket:my-key list snapshots
repository 09ab4cca opened successfully, password is correct
008da198994d1f47b38db9e52504201cc6a82706b674dbd53ae4816e36852dd4
009dc2757add1c5a4937af9d18d67c6a210266708a62da0e42c59a6d41433c24
...
...
$ restic -r s3:s3.us-west-001.backblazeb2.com/my-bucket/my-key list snapshots
repository 09ab4cca opened successfully, password is correct
created new cache in /Users/my-user/Library/Caches/restic
008da198994d1f47b38db9e52504201cc6a82706b674dbd53ae4816e36852dd4
009dc2757add1c5a4937af9d18d67c6a210266708a62da0e42c59a6d41433c24
...
...
...
One notable difference is that the MacBook has an older version of restic
:
$ restic version
restic 0.11.0 compiled with go1.15.6 on darwin/amd64