New keys are not found

I’m trying to add a new key to one of my repos. The process successfully completes with the “Saved new key as …” message.

However, when I then try to access the repo in the usual way, using the new password (for the newly generated key), I get “Fatal: No password or wrong key found”.

I’ve attempted to generate new keys several times (different password each time), with the same result. Any ideas? TIA.

it depends on your commands and passwords.
e.g. on linux RESTIC_PASSWORD=Pa$$word may not work as expected

I have not tested this but usually the shell tries to expand variables in the example

1 Like

Check on the backend side it there are any corresponding new files in the locks directory in the repository. There should be one new file for each new key.

1 Like

you can also list your keys with
restic … key list

with the latest release i was able to add, list and remove a new key
tested with foobar as password

If there is a problem such as the backend not showing files that were created, trying to list them using restic is not very useful. That is why it’s better to check directly on the backend side instead.

Thanks guys. I tried again for about the 7th attempt, and it worked without issue. I can only speculate it was something to do with special characters and shell expansion, as my passwords are long randomly generated strings. The keys were being created on the remote repo, and were listed as added using the key list command (using the original key to access). I was trying by passing the password as env variables on CLI, and also likewise in a bash script (running on Ubuntu Linux server 20.04).

In any case, seems to be resolved for now - for this key/password at least. I need to add others to other repos over the next few days, so will see how it goes. Thanks again.

If you want to use a long password, I recommend using a password file instead via the --password-file flag.

Then I usually generate my password files in a similar way to this:
head -c 1024 /dev/urandom | base64 > key ; chmod 400 key