Error initializing repo in backblaze

I updated to 0.14 in order to leverage compression and I am receiving the following error when I initialize a new repo in an empty bucket:

# export TMPDIR=/tmp
# export RESTIC_CACHE_DIR=/tmp
# export RESTIC_REPOSITORY='b2:xyz:/'
# export RESTIC_PASSWORD='...'
# export B2_ACCOUNT_ID='...'
# export B2_ACCOUNT_KEY='...'
# export RESTIC_COMPRESSION=max
# restic init --verbose
b2_download_file_by_name: 404: : b2.b2err
b2_download_file_by_name: 404: : b2.b2err
created restic repository c410391d33 at b2:xyz:/

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.

Verbose doesn’t provide any additional insight as to what the actual error relates to.

Any ideas?

Can you reproduce the issue with the latest restic version 0.14.0? If yes, please generate a debug log by setting the environment variable DEBUG_LOG=logfile.log when/before reproducing the problem, that should hopefully get you some insight :slight_smile:

Hi,
Thanks for that pointer, it has provided some detail.

I created a new bucket and ran restic init with the same environment variables adjusted for the new repo and the same errors appeared. I am not familiar with this codebase at all, but it is reproducible so I will open a ticket.

2022/08/27 08:25:22 restic/main.go:95	main.main	1	main []string{"restic.alt", "init", "--verbose=3"}
2022/08/27 08:25:22 restic/main.go:96	main.main	1	restic 0.14.0 compiled with go1.19 on linux/amd64
2022/08/27 08:25:22 restic/global.go:768	main.create	1	parsing location b2:bucket-name:/
2022/08/27 08:25:22 restic/global.go:665	main.parseConfig	1	opening b2 repository at b2.Config{AccountID:"...", Key:"**redacted**", Bucket:"bucket-name", Prefix:"", Connections:0x5}
2022/08/27 08:25:22 b2/b2.go:85	b2.Create	1	cfg b2.Config{AccountID:"...", Key:"**redacted**", Bucket:"bucket-name", Prefix:"", Connections:0x5}
2022/08/27 08:25:22 debug/round_tripper.go:94	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP REQUEST -----------
GET /b2api/v1/b2_authorize_account HTTP/1.1
Host: api.backblazeb2.com
User-Agent: blazer/0.5.3
Authorization: **redacted**
X-Blazer-Method: b2_authorize_account
X-Blazer-Request-Id: 1
Accept-Encoding: gzip


2022/08/27 08:25:22 debug/round_tripper.go:111	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP RESPONSE ----------
HTTP/1.1 200 
Content-Length: 812
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/json;charset=UTF-8
Date: Sat, 27 Aug 2022 14:25:22 GMT


2022/08/27 08:25:22 debug/round_tripper.go:94	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP REQUEST -----------
POST /b2api/v1/b2_list_buckets HTTP/1.1
Host: api001.backblazeb2.com
User-Agent: blazer/0.5.3
Content-Length: 94
Authorization: **redacted**
X-Blazer-Method: b2_list_buckets
X-Blazer-Request-Id: 2
Accept-Encoding: gzip


2022/08/27 08:25:22 debug/round_tripper.go:111	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP RESPONSE ----------
HTTP/1.1 200 
Content-Length: 709
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/json;charset=UTF-8
Date: Sat, 27 Aug 2022 14:25:22 GMT


2022/08/27 08:25:22 b2/b2.go:255	b2.(*b2Backend).Test	1	Test <config/>
2022/08/27 08:25:22 debug/round_tripper.go:94	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP REQUEST -----------
HEAD /file/bucket-name/config HTTP/1.1
Host: f001.backblazeb2.com
User-Agent: blazer/0.5.3
Authorization: **redacted**
X-Blazer-Method: b2_download_file_by_name
X-Blazer-Request-Id: 3


2022/08/27 08:25:23 debug/round_tripper.go:111	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP RESPONSE ----------
HTTP/1.1 404 
Content-Length: 94
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/json;charset=utf-8
Date: Sat, 27 Aug 2022 14:25:22 GMT


2022/08/27 08:25:23 repository/index.go:404	repository.(*Index).Finalize	1	finalizing index
2022/08/27 08:25:23 b2/b2.go:255	b2.(*b2Backend).Test	1	Test <config/>
2022/08/27 08:25:23 debug/round_tripper.go:94	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP REQUEST -----------
HEAD /file/bucket-name/config HTTP/1.1
Host: f001.backblazeb2.com
User-Agent: blazer/0.5.3
Authorization: **redacted**
X-Blazer-Method: b2_download_file_by_name
X-Blazer-Request-Id: 4


2022/08/27 08:25:23 debug/round_tripper.go:111	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP RESPONSE ----------
HTTP/1.1 404 
Content-Length: 94
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/json;charset=utf-8
Date: Sat, 27 Aug 2022 14:25:22 GMT


2022/08/27 08:25:23 restic/config.go:49	restic.CreateConfig	1	New config: restic.Config{Version:0x2, ID:"01b4783dac7601fb6f5b72cf3bd60f14de28e1fc08e05e65d34ccecf20b3bf60", ChunkerPolynomial:0x36598879c05431}
2022/08/27 08:25:23 repository/key.go:212	repository.AddKey	1	calibrated KDF parameters are {32768 8 1}
2022/08/27 08:25:24 b2/b2.go:216	b2.(*b2Backend).Save	1	Save <key/3cf71efe16>, name keys/3cf71efe16d10aef5b2075e7d78307dc048318b0f74ffc12b0273041ffdf56bb
2022/08/27 08:25:24 b2/b2.go:222	b2.(*b2Backend).Save	1	  saved 467 bytes, err <nil>
2022/08/27 08:25:24 debug/round_tripper.go:94	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP REQUEST -----------
POST /b2api/v1/b2_get_upload_url HTTP/1.1
Host: api001.backblazeb2.com
User-Agent: blazer/0.5.3
Content-Length: 39
Authorization: **redacted**
X-Blazer-Method: b2_get_upload_url
X-Blazer-Request-Id: 5
Accept-Encoding: gzip


2022/08/27 08:25:24 debug/round_tripper.go:111	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP RESPONSE ----------
HTTP/1.1 200 
Content-Length: 275
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/json;charset=UTF-8
Date: Sat, 27 Aug 2022 14:25:24 GMT


2022/08/27 08:25:24 debug/round_tripper.go:94	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP REQUEST -----------
POST /b2api/v1/b2_upload_file/f5f3a7c1afb3d9f98421011f/c001_v0001038_t0047 HTTP/1.1
Host: pod-000-1038-15.backblaze.com
User-Agent: blazer/0.5.3
Content-Length: 467
Authorization: **redacted**
Content-Type: application/octet-stream
X-Blazer-Method: b2_upload_file
X-Blazer-Request-Id: 6
X-Bz-Content-Sha1: 350a7dc1c4acfb464017943ba910237dff74a1f5
X-Bz-File-Name: keys/3cf71efe16d10aef5b2075e7d78307dc048318b0f74ffc12b0273041ffdf56bb
Accept-Encoding: gzip


2022/08/27 08:25:24 debug/round_tripper.go:111	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP RESPONSE ----------
HTTP/1.1 200 
Content-Length: 771
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/json;charset=UTF-8
Date: Sat, 27 Aug 2022 14:25:23 GMT


2022/08/27 08:25:24 restic/json.go:25	restic.SaveJSONUnpacked	1	save new blob config
2022/08/27 08:25:24 b2/b2.go:216	b2.(*b2Backend).Save	1	Save <config/0000000000>, name config
2022/08/27 08:25:24 b2/b2.go:222	b2.(*b2Backend).Save	1	  saved 155 bytes, err <nil>
2022/08/27 08:25:24 debug/round_tripper.go:94	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP REQUEST -----------
POST /b2api/v1/b2_upload_file/f5f3a7c1afb3d9f98421011f/c001_v0001038_t0047 HTTP/1.1
Host: pod-000-1038-15.backblaze.com
User-Agent: blazer/0.5.3
Content-Length: 155
Authorization: **redacted**
Content-Type: application/octet-stream
X-Blazer-Method: b2_upload_file
X-Blazer-Request-Id: 7
X-Bz-Content-Sha1: db8095ea0e151a1e9edf5ebe964b40d74e2b3d68
X-Bz-File-Name: config
Accept-Encoding: gzip


2022/08/27 08:25:25 debug/round_tripper.go:111	debug.loggingRoundTripper.RoundTrip	1	------------  HTTP RESPONSE ----------
HTTP/1.1 200 
Content-Length: 708
Cache-Control: max-age=0, no-cache, no-store
Content-Type: application/json;charset=UTF-8
Date: Sat, 27 Aug 2022 14:25:24 GMT


2022/08/27 08:25:25 repository/repository.go:494	repository.(*Repository).SaveUnpacked	1	blob <config/0000000000> saved

Looks like you only pasted a snippet of the debug log here, and opened a/the issue at Initializing a new repository with v0.14.0 in B2 emits errors · Issue #3896 · restic/restic · GitHub - let’s continue the debugging there.

That is the full content of the log attached to the issue, this was all that was emitted from restic during the operation.

The error message is just a left over debug message in the library we use to access B2, see `b2_download_file_by_name: 404` on Backblaze B2 repository init · Issue #3750 · restic/restic · GitHub for more details. Alternatively you could take a look at the instructions in doc: recommend usage of B2's S3 API by MichaelEischer · Pull Request #3886 · restic/restic · GitHub to use the S3 API of B2. For S3 we use a different library which doesn’t have that (and several other) problems.