Trouble with restic on backblaze b2

Just discovered this tonight. set environmental variable DEBUG_LOG=“./restic.log”, then reran and got a log file. Within the log file I found this:

GET /b2api/v3/b2_authorize_account HTTP/1.1
Host: api.backblazeb2.com
User-Agent: blazer/0.7.2
Authorization: redacted
X-Blazer-Method: b2_authorize_account
X-Blazer-Request-Id: 1
Accept-Encoding: gzip

So, something changed on the backblaze end to cause restic to no longer authorize me I suspect. Maybe need to talk with backblaze. Could this be something about the AWS api instead of the backblaze API warning at the top of the backblaze instructions? Do I need to stop using backblaze or restic, or is there a fix to this ?

A few things

  1. What’s the actual problem you’re trying to fix here, you don’t mention it at all and just go straight into “Do I need to talk to Backblaze” etc etc. Back up a number of steps and explain the actual issue :slight_smile:

  2. Redacted means “Removed so as not to expose” i.e. “Hidden”. You seem to be getting mixed up with maybe “retracted” (taken back) or “rejected” (being told no)

Regardless, what’s the problem/restic error you got that’s caused this post?

You are entirely correct. My initial entry is not showing. I will resend.

Hello, I have been using restic to backup to backblaze for years now with no problem. However, recently, the connection I have been using stopped working. I have had this problem before, and found that the firewall in my routers prevented backblaze access (see my entries in '21 and '22), However, that is not the case this time since those settings have not changed. I suspect a key expired without notice, but I don’t know how to confirm, and I don’t want to start over for fear of losing my data stored on backblaze. When I run my script(s), I get the following error message to the screen:
repository xxxxxxxx opened (version 2, compression level auto)
Fatal: unable to open repository at b2:fea-name-backup:restic_backups/local: context deadline exceeded

The key part of the message seems to be “context deadline exceeded”, but if I search for this message, I don’t find anything.

I am current with restic at

restic version
restic 0.18.0 compiled with go1.24.1 on linux/amd64

Any help here sincerely appreciated.

Application keys in B2 can be managed independently of the data stored at B2. You can simply create a new additional key for testing (just make sure to clean up unnecessary keys afterwards).

This simply means that restic failed to connect to B2 within one minute.

The key to debugging this problem lies in the response to this request. Was there any response or did it just time out? What happens when you run curl https://api.backblazeb2.com/b2api/v3/b2_authorize_account? Does it hang or return a “bad_auth_token” error? What does host api.backblazeb2.com return?

The main difference is that there’s much better error reporting for the S3 API in restic. But if the B2 API worked for you in the past, there’s no reason for it to suddenly stop working.

OK. I went ahead and created a new application key, and removed the old one. Then inserted the new application key into my script that I am testing (the others later after I fix). I also looked at the requirements for the S3 API, and it appears that I can just use the same Keys, but different environmental variables. Regardless, I am still just using the B2 keys for now anyway. I reran my test script with the new keys and also produced a log file. This time I just am inserting the entire log file (it is fairly small actually) and shows all the messages. I edited the log file so as to mask the key IDs so no one can use my account ! It is still failing on the same error it seems to me.

2025/06/04 11:34:07 restic/main.go:167 main.main 1 main string{“restic”, “copy”, “–from-repo”, “/mnt/audio”}
2025/06/04 11:34:07 restic/main.go:168 main.main 1 restic 0.18.0 compiled with go1.24.1 on linux/amd64
2025/06/04 11:34:07 restic/global.go:603 main.innerOpen 1 parsing location /mnt/audio
2025/06/04 11:34:07 restic/global.go:598 main.parseConfig 1 opening local repository at &local.Config{Path:“/mnt/audio”, Connections:0x2}
2025/06/04 11:34:07 local/local.go:56 local.Open 1 open local backend at /mnt/audio
2025/06/04 11:34:07 local/local.go:45 local.open 1 using (0o600 file, 0o700 dir) permissions
2025/06/04 11:34:07 logger/log.go:52 logger.(*Backend).Stat 1 Stat()
2025/06/04 11:34:07 sema/semaphore.go:27 sema.semaphore.GetToken 1 acquired token
2025/06/04 11:34:07 logger/log.go:54 logger.(*Backend).Stat 1 stat err
2025/06/04 11:34:07 logger/log.go:24 logger.(*Backend).IsNotExist 1 IsNotExist(, , false)
2025/06/04 11:34:07 logger/log.go:24 logger.(*Backend).IsNotExist 1 IsNotExist(, , false)
2025/06/04 11:34:07 index/index.go:385 index.(*Index).Finalize 1 finalizing index
2025/06/04 11:34:07 logger/log.go:59 logger.(*Backend).List 1 List(key)
2025/06/04 11:34:07 repository/key.go:145 repository.SearchKey.func1 1 trying key “----------------------------------------------------------------”
2025/06/04 11:34:07 logger/log.go:45 logger.(*Backend).Load 1 Load(<key/cfa0ebeb69>, length 0, offset 0)
2025/06/04 11:34:07 sema/semaphore.go:27 sema.semaphore.GetToken 1 acquired token
2025/06/04 11:34:07 logger/log.go:47 logger.(*Backend).Load 1 load err
2025/06/04 11:34:07 repository/key.go:158 repository.SearchKey.func1 1 successfully opened key ----------------------------------------------------------------
2025/06/04 11:34:07 logger/log.go:61 logger.(*Backend).List 1 list err
2025/06/04 11:34:07 repository/repository.go:174 repository.(*Repository).LoadUnpacked 1 load config with id 0000000000000000000000000000000000000000000000000000000000000000
2025/06/04 11:34:07 logger/log.go:45 logger.(*Backend).Load 1 Load(<config/0000000000>, length 0, offset 0)
2025/06/04 11:34:07 sema/semaphore.go:27 sema.semaphore.GetToken 1 acquired token
2025/06/04 11:34:07 logger/log.go:47 logger.(*Backend).Load 1 load err
2025/06/04 11:34:07 cache/cache.go:98 cache.New 1 using cache dir /root/.cache/restic/560f802e2973c0aff23fc29ac434167504ed1186949adb55f9375003fe32e458
2025/06/04 11:34:07 repository/repository.go:158 repository.(*Repository).UseCache 1 using cache
2025/06/04 11:34:07 cache/cache.go:222 cache.OlderThan 1 0 old cache dirs found
2025/06/04 11:34:07 logger/log.go:59 logger.(*Backend).List 8 List(lock)
2025/06/04 11:34:08 logger/log.go:61 logger.(*Backend).List 8 list err
2025/06/04 11:34:08 restic/json.go:25 restic.SaveJSONUnpacked[…] 1 save new blob lock
2025/06/04 11:34:08 logger/log.go:30 logger.(*Backend).Save 1 Save(<lock/ffce11531f>, 158)
2025/06/04 11:34:08 logger/log.go:32 logger.(*Backend).Save 1 save err
2025/06/04 11:34:08 repository/repository.go:502 repository.(*Repository).saveUnpacked 1 blob <lock/ffce11531f> saved
2025/06/04 11:34:08 logger/log.go:59 logger.(*Backend).List 49 List(lock)
2025/06/04 11:34:08 logger/log.go:61 logger.(*Backend).List 49 list err
2025/06/04 11:34:08 restic/parallel.go:38 restic.ParallelList.func2 34 worker got file lock/ffce1153
2025/06/04 11:34:08 repository/lock.go:91 repository.(*locker).Lock 1 create lock 0xc0000f7650 (exclusive false)
2025/06/04 11:34:08 restic/global.go:603 main.innerOpen 1 parsing location b2:fea-name-backup:restic_backups/audio
2025/06/04 11:34:08 repository/lock.go:120 repository.(*locker).refreshLocks 27 start
2025/06/04 11:34:08 restic/global.go:598 main.parseConfig 1 opening b2 repository at &b2.Config{AccountID:“-------------------------”, Key:“redacted”, Bucket:“fea-name-backup”, Prefix:“restic_backups/audio”, Connections:0x5}
2025/06/04 11:34:08 b2/b2.go:92 b2.Open 1 cfg b2.Config{AccountID:“-------------------------”, Key:“redacted”, Bucket:“fea-name-backup”, Prefix:“restic_backups/audio”, Connections:0x5}
2025/06/04 11:34:08 debug/round_tripper.go:93 debug.loggingRoundTripper.RoundTrip 1 ------------ HTTP REQUEST -----------
GET /b2api/v3/b2_authorize_account HTTP/1.1
Host: api.backblazeb2.com
User-Agent: blazer/0.7.2
Authorization: redacted
X-Blazer-Method: b2_authorize_account
X-Blazer-Request-Id: 1
Accept-Encoding: gzip

2025/06/04 11:34:28 debug/round_tripper.go:100 debug.loggingRoundTripper.RoundTrip 1 RoundTrip() returned error: dial tcp: lookup api.backblazeb2.com on 127.0.0.53:53: read udp 127.0.0.1:46546->127.0.0.53:53: i/o timeout
2025/06/04 11:34:29 debug/round_tripper.go:93 debug.loggingRoundTripper.RoundTrip 1 ------------ HTTP REQUEST -----------
GET /b2api/v3/b2_authorize_account HTTP/1.1
Host: api.backblazeb2.com
User-Agent: blazer/0.7.2
Authorization: redacted
X-Blazer-Method: b2_authorize_account
X-Blazer-Request-Id: 2
Accept-Encoding: gzip

2025/06/04 11:34:49 debug/round_tripper.go:100 debug.loggingRoundTripper.RoundTrip 1 RoundTrip() returned error: dial tcp: lookup api.backblazeb2.com on 127.0.0.53:53: read udp 127.0.0.1:57129->127.0.0.53:53: i/o timeout
2025/06/04 11:34:50 debug/round_tripper.go:93 debug.loggingRoundTripper.RoundTrip 1 ------------ HTTP REQUEST -----------
GET /b2api/v3/b2_authorize_account HTTP/1.1
Host: api.backblazeb2.com
User-Agent: blazer/0.7.2
Authorization: redacted
X-Blazer-Method: b2_authorize_account
X-Blazer-Request-Id: 3
Accept-Encoding: gzip

2025/06/04 11:35:08 debug/round_tripper.go:100 debug.loggingRoundTripper.RoundTrip 1 RoundTrip() returned error: context deadline exceeded
2025/06/04 11:35:08 repository/lock.go:143 repository.(*locker).refreshLocks 27 terminate
2025/06/04 11:35:08 repository/lock.go:207 repository.(*locker).monitorLockRefresh 28 terminate expiry monitoring
2025/06/04 11:35:08 repository/lock.go:131 repository.(*locker).refreshLocks.func1 27 unlocking repository with lock PID 1347963 on fea-home by root (UID 0, GID 0)
lock was created at 2025-06-04 11:34:07 (1m0.452571205s ago)
storage ID ffce1153
2025/06/04 11:35:08 cache/backend.go:40 cache.(*Backend).Remove 27 cache Remove(<lock/ffce11531f>)
2025/06/04 11:35:08 logger/log.go:38 logger.(*Backend).Remove 27 Remove(<lock/ffce11531f>)
2025/06/04 11:35:08 logger/log.go:40 logger.(*Backend).Remove 27 remove err
2025/06/04 11:35:08 restic/cleanup.go:39 main.Exit 1 exiting with status code 1

Did I provide the information you wanted? Still no luck here. I also tried a direct utility from Backblaze called “b2” which is a linux binary that I use to sync my home directory between my desktop/server and backblaze. It doesn;t connect either, but gives me a slightly different error message to the screen:
ERROR: Connection error: HTTPSConnectionPool(host=‘api004.backblazeb2.com’, port=443): Max retries exceeded with url: /b2api/v2/b2_list_buckets (Caused by NameResolutionError(“<urllib3.connection.HTTPSConnection object at 0x7fe657739790>: Failed to resolve ‘api004.backblazeb2.com’ ([Errno -3] Temporary failure in name resolution)”))

Which leads me to believe that the DNS is not finding this IP address. However, it pings fine, so this doesn;t make sense either !

This could certainly give us a clue. The response from

host api.backblazeb2.com
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; no servers could be reached

But it does ping, so the DNS is working, but something is preventing communications

Yes, you have some sort of local network issue.
The issue isn’t a restic one.

There clearly is a DNS issue:

host api.backblazeb2.com
;; communications error to 127.0.0.53#53: timed out
;; communications error to 127.0.0.53#53: timed out
;; no servers could be reached

Are you sure ping is working to the exact same DNS name?

Either way - not a restic issue - a local network/DNS/configuration is what’s causing your problem.

Yes. I agree. And further, I started stripping down my configuration. I had an old iptables that my son and I set up years ago. I didn’t understand it, but he did. It didn’t apply now since things have changed quite a bit. I disabled the iptables (-F), and viola ! I could connect to backblaze again. I don’t know what happened two months ago, but I am starting to straighten things out. I will check back in later.

Fixed the problem. An old iptables that I did not need was hanging around in my root directory. It managed to corrupt things up so badly that restic/backblaze stopped working. Gone.

1 Like