I had backed up a database on a windows server to B2 after having followed instructions here https://help.backblaze.com/hc/en-us/articles/115002880514-How-to-configure-Backblaze-B2-with-Restic-on-Linux
On attempting to restore the backup on my ubuntu laptop, kept getting the error “Fatal: wrong password or no key found” even though the RESTIC_PASSWORD environment variable was being attempted to be set to the same password string using the ‘export’ command on my bash script. Also, passing in the password manually on the command line was leading to the same error, but running restore on the windows machine was working fine. Found with further troubleshooting, that trying to enter the password on the powershell command line was too causing the same error. Putting the password into a file and using RESTIC_PASSWORD_FILE too didn’t help!
I am not sure why special characters were being truncated when env variable was set in the windows machine using the ‘set’ command on the batch script(Google search didn’t help here). I had a “%8” and a “^” in the password string that was being truncated. Therefore, the actual password of the remote repository didn’t have these characters in the password!
Took me a wasted day to figure this out. Hope it helps someone.
Even though this is not a bug in Restic, it would help if the password could be passed into Restic using a config file to avoid this special-char-truncation problem when setting environment variables.