#22035·restic

`RESTIC_REST_PASSWORD` ignored with `username@domain` URL

Author: BD103Created Aug 29, 2026Updated Sep 20, 2026
Labelstype: bughelp: wantedhelp: minor complexitybackend: resthelp: good first issue

Output of restic version

bash
$ restic version
restic 0.19.1 compiled with go1.26.5 on darwin/arm64

What backend/service did you use to store the repository?

The REST server, packaged by Debian.

bash
$ restic-rest-server --version
restic-rest-server version restic-rest-server 0.13.0 compiled with go1.24.2 on linux/arm64

Problem description / Steps to reproduce

While the following two examples work:

bash
$ RESTIC_REST_USERNAME=user RESTIC_REST_PASSWORD=password restic -r rest:http://domain:8000/user snapshots
repository a3ff2cb0 opened (version 2, compression level auto)
...
bash
$ restic -r rest:http://user:password@domain:8000/user snapshots
repository a3ff2cb0 opened (version 2, compression level auto)
...

This doesn't, saying the password is incorrect:

bash
$ RESTIC_REST_PASSWORD=password restic -r rest:http://user@domain:8000/user snapshots
Stat(<config/>) failed: unexpected HTTP response (401): 401 Unauthorized
Fatal: unable to open config file: unexpected HTTP response (401): 401 Unauthorized
rest:http://user@domain:8000/user/

In other words, specifying the username in the URL with user@domain results in RESTIC_REST_PASSWORD being ignored.

Expected behavior

I expected running RESTIC_REST_PASSWORD=password restic -r rest:http://user@domain:8000/user snapshots to show me a list of snapshots.

Actual behavior

It says I am unauthorized, even though my credentials are correct:

Stat(<config/>) failed: unexpected HTTP response (401): 401 Unauthorized
Fatal: unable to open config file: unexpected HTTP response (401): 401 Unauthorized
rest:http://user@domain:8000/user/

Do you have any idea what may have caused this?

My guess is that when Restic sees user@domain it assumes the password is blank and skips checking RESTIC_REST_PASSWORD.

Did restic help you today? Did it make you happy in any way?

Absolutely! Restic seems to get everything right (ignoring this one paper cut), and I've been really happy with it so far. :)