Cannot change repository passphrase (borg change-passphrase) #911

Closed
opened 2024-09-01 13:21:20 +00:00 by sumpfralle · 3 comments

What I'd like to do and why

I tried to change the passphrase of the backup repository via borgmatic borg key:

root@example:~# borgmatic borg key change-passphrase 
Borg's key subcommand is supported natively by borgmatic. Try this instead: borgmatic key

I took a look at the code: the above warning is really just a warning. The subcommand is executed anyway. This is good.

But the action seems to fail (or just do nothing). Maybe this is related to stdin / interactivity handling of borgmatic.

Then I tried to follow the advice of using borgmatic's integrated key action:

root@example:~# borgmatic key change-passphrase
Missing sub-action after key action. Expected one of: export

Need some help? https://torsion.org/borgmatic/#issues

Thus, I see two issues:

  • The warning message regarding the natively supported key subcommand does not take the chosen sub-sub-command into account. But I failed to come up with a better phrasing for this message. Thus, probably it is not worth being changed.
  • The interactive borg key change-passphrase action does not seem to work while being wrapped into borgmatic.

I am not sure, whether password changes are within the desired scope of borgmatic. Thus, you may feel free to close this issue if this is not the case.

Thank you for your time!

Other notes / implementation ideas

No response

### What I'd like to do and why I tried to change the passphrase of the backup repository via `borgmatic borg key`: ``` root@example:~# borgmatic borg key change-passphrase Borg's key subcommand is supported natively by borgmatic. Try this instead: borgmatic key ``` I took a look at the code: the above warning is really just a warning. The subcommand is executed anyway. This is good. But the action seems to fail (or just do nothing). Maybe this is related to stdin / interactivity handling of borgmatic. Then I tried to follow the advice of using borgmatic's integrated `key` action: ``` root@example:~# borgmatic key change-passphrase Missing sub-action after key action. Expected one of: export Need some help? https://torsion.org/borgmatic/#issues ``` Thus, I see two issues: * The warning message regarding the natively supported `key` subcommand does not take the chosen sub-sub-command into account. But I failed to come up with a better phrasing for this message. Thus, probably it is not worth being changed. * The interactive `borg key change-passphrase` action does not seem to work while being wrapped into `borgmatic`. I am not sure, whether password changes are within the desired scope of borgmatic. Thus, you may feel free to close this issue if this is not the case. Thank you for your time! ### Other notes / implementation ideas _No response_
Owner

Thanks for taking the time to file this! I can confirm both of the issues you've identified. The not taking the sub-sub-command into account in the warning is unfortunate, but yeah, may or may not be worth attempting to fix. But the lack of borgmatic wrapping change-passphrase seems like something pretty straightforward to implement and within the scope of what borgmatic can/should do.

But the action seems to fail (or just do nothing). Maybe this is related to stdin / interactivity handling of borgmatic.

This is a likely cause. One of the downsides of the borgmatic borg escape hatch is that the "wrapped" commands aren't truly wrapped, and so borgmatic isn't smart enough to know what to do with input/output.

Thanks for taking the time to file this! I can confirm both of the issues you've identified. The not taking the sub-sub-command into account in the warning is unfortunate, but yeah, may or may not be worth attempting to fix. But the lack of borgmatic wrapping [`change-passphrase`](https://borgbackup.readthedocs.io/en/stable/usage/key.html) seems like something pretty straightforward to implement and within the scope of what borgmatic can/should do. > But the action seems to fail (or just do nothing). Maybe this is related to stdin / interactivity handling of borgmatic. This is a likely cause. One of the downsides of the `borgmatic borg` escape hatch is that the "wrapped" commands aren't truly wrapped, and so borgmatic isn't smart enough to know what to do with input/output.
Owner

Wrapping of key change-passphrase is implemented in main and will be part of the next release! Thanks again for the suggestion.

Wrapping of `key change-passphrase` is implemented in main and will be part of the next release! Thanks again for the suggestion.
witten added the
new feature area
label 2024-09-01 18:15:52 +00:00
witten referenced this issue from a commit 2024-10-01 16:26:16 +00:00
witten referenced this issue from a commit 2024-10-01 16:31:17 +00:00
Owner

Released in borgmatic 1.9.0!

Released in borgmatic 1.9.0!
Sign in to join this conversation.
No Milestone
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#911
No description provided.