Restic 0.14.0 with s3 not following "301 moved permanently" anymore

It’s not a big deal but just to tell - I noticed the following:

Sometimes I mix up my wasabi bucket hostnames. So like “https://s3.eu-central-1.wasabisys.com/BUCKETNAME” it may happened that I used “https://s3.eu-west-1.wasabisys.com/BUCKETNAME” in my config files.

This was never a problem since wasabi sends out a “301 moved permanently” in this case. So I never even noticed that I used a wrong hostname on some of my systems.

With 0.14.0 this has changed. It seems that restic is not following the 301 anymore. Now in this case I just get

Fatal: unable to open config file: Stat: 301 Moved Permanently
Is there a repository at the following location?

Tested again with restic versions before 0.14.0 - works.

Is there some reason that this behaviour changed?

We haven’t changed something in that regard in restic. So this must either be somehow caused by updating the minio-go library (I don’t see anything obvious there which explain that change in behavior) or by updating to Go 1.19.

It might be related to this change in Go 1.19 https://go.dev/doc/go1.19:

The HTTP client will handle a 3xx response without a Location header by returning it to the caller, rather than treating it as an error.

Judging from the associated github issue net/http: can't read 301 response without a Location header · Issue #49281 · golang/go · GitHub , this could be that cause of this behavior change.

1 Like