-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passphrase env vars with special characters no longer work with 1.8.13 #346
Comments
I agree. I've had significant issues with Borgmatic starting to declare my password incorrect, after having worked for the past 6 months at least. I'm convinced this is part of the problem. After painstaking review, I figured out that the issue was the BORG_PASSPHRASE environment variable in my docker compose file. In the past I had it set to BORG_PASSPHRASE="mypassword", but not it only works when I take out the quotes, i.e. BORG_PASSPHRASE=mypassword. I'm guessing this is related. The README and documentation still has quotes, and I think this needs to be changed. |
My backups started failing when called from CRON with 1.8.13 too, EDIT: 9/5/24 failing in 1.8.14 too. |
I observe similar issues with passphrases that contain something like However, the root cause depends on the special character.
Whereas with stuff like docker-borgmatic/root/etc/s6-overlay/s6-rc.d/secrets/run Lines 58 to 59 in 8adec5d
While the contents of the resulting I am unsure whether this expansion behavior is on purpose, maybe @Psycho0verload can comment on that - depending on the intended behavior, either code or documentation should be adjusted. My personal take is: the borgmatic image should make no assumptions at all about the passphrase (which requires some very careful handling of the passphrase in shell scripts). |
@SECtim It's been a few days now. I suspect that I also had problems with the special characters and that's why I put it in quotation marks. I've seen that Linuxserver.io also works mainly with S6-overlay, and there are Secrets implemented by default. It's very cleanly written there and I'll test if that's not the better option for borgmatic as well. |
I am by no means a shell guru, but I suppose single quotes instead of double ones in the |
No problem, I am currently testing a different type of Secrets integration. The way it is used by linuxserver.io. that could help :) |
Just for your information. I am still on vacation. I will start working on this ticket again next week ;-) |
I encountered this problem. I spent a lot of time trying to find where I went wrong. Until I found this issue. I rolled back to 1.8.12. |
I am current working on this |
Fixing: ``` fatal: during dependency resolution for service svc-cron: undefined service name secrets ``` Working on borgmatic-collective#346
As of docker-borgmatic 1.8.13, some Borg passphrases that worked fine with 1.8.12 no longer work. For instance:
Which, if cron is actually configured and runs, leads to a Borg error about:
passphrase supplied in BORG_PASSPHRASE, by BORG_PASSCOMMAND or via BORG_PASSPHRASE_FD is incorrect
.Whereas with 1.8.12:
$ docker run --rm -e BORG_PASSPHRASE='`' ghcr.io/borgmatic-collective/borgmatic:1.8.12 [custom-init] Docker CLI variable not set, skipping... [custom-init] No custom packages found, skipping... ----------------------------------- Software Versions:
And then if cron is actually configured, the passphrase comes through correctly and there's no error from Borg.
I believe the problem was likely introduced in #331 and specifically in https://github.com/borgmatic-collective/docker-borgmatic/pull/331/files#diff-df5fc4ba71d9f961534c2d65215e50da1befb1f2a16c4a03c58eba442f8c5dc3
It's possible that a backtick is not the only special character broken in this way by 1.8.13.
The text was updated successfully, but these errors were encountered: