check --repair interactive question gets immediately answered #730

Closed
opened 2023-07-22 21:42:44 +00:00 by nebulon42 · 5 comments
Contributor

What I'm trying to do and why

I'm trying to repair a repository with problems but the interactive question gets immediately answered with NO and then the command aborts.

Steps to reproduce

Run borgmatic check --repair on 1.8.0.

Actual behavior

borg --version --debug --show-rc
ssh://user@url/./repo: Running actions for repository
/path/to/config.yml: No commands to run for pre-actions hook
/path/to/config.yml: No commands to run for pre-check hook
ssh://user@url/./repo: Running consistency checks
borg info --json ssh://user@url/./repo
borg check --repair --debug --show-rc ssh://user@url/./repo >
using builtin fallback logging configuration
35 self tests completed in 0.13 seconds
SSH command line: ['ssh', '-o', 'IdentitiesOnly=yes', '-i', '/path/to/key', '-p', '23', 'user@url', 'borg', 'serve', '--umask=077', '--debug']
Remote: using builtin fallback logging configuration
Remote: 33 self tests completed in 0.10 seconds
Remote: using builtin fallback logging configuration
Remote: Initialized logging system for JSON-based protocol
Remote: Resolving repository path b'/./repo'
Remote: Resolved repository path to '/repo'
This is a potentially dangerous function.
check --repair might lead to data loss (for kinds of corruption it is not
capable of dealing with). BE VERY CAREFUL!

Type 'YES' if you understand this and want to continue: NO (from BORG_CHECK_I_KNOW_WHAT_I_AM_DOING)
Aborting.
RemoteRepository: 139 B bytes sent, 838 B bytes received, 2 messages sent
terminating with error status, rc 2

Expected behavior

The question should be answered in interactive mode.

Other notes / implementation ideas

Could this be a regression from #724? I did not change anything in the config. Are there adjustments necessary?

borgmatic version

1.8.0

borgmatic installation method

No response

Borg version

No response

Python version

No response

Database version (if applicable)

No response

Operating system and version

No response

### What I'm trying to do and why I'm trying to repair a repository with problems but the interactive question gets immediately answered with NO and then the command aborts. ### Steps to reproduce Run borgmatic check --repair on 1.8.0. ### Actual behavior borg --version --debug --show-rc ssh://user@url/./repo: Running actions for repository /path/to/config.yml: No commands to run for pre-actions hook /path/to/config.yml: No commands to run for pre-check hook ssh://user@url/./repo: Running consistency checks borg info --json ssh://user@url/./repo borg check --repair --debug --show-rc ssh://user@url/./repo > using builtin fallback logging configuration 35 self tests completed in 0.13 seconds SSH command line: ['ssh', '-o', 'IdentitiesOnly=yes', '-i', '/path/to/key', '-p', '23', 'user@url', 'borg', 'serve', '--umask=077', '--debug'] Remote: using builtin fallback logging configuration Remote: 33 self tests completed in 0.10 seconds Remote: using builtin fallback logging configuration Remote: Initialized logging system for JSON-based protocol Remote: Resolving repository path b'/./repo' Remote: Resolved repository path to '/repo' This is a potentially dangerous function. check --repair might lead to data loss (for kinds of corruption it is not capable of dealing with). BE VERY CAREFUL! Type 'YES' if you understand this and want to continue: NO (from BORG_CHECK_I_KNOW_WHAT_I_AM_DOING) Aborting. RemoteRepository: 139 B bytes sent, 838 B bytes received, 2 messages sent terminating with error status, rc 2 ### Expected behavior The question should be answered in interactive mode. ### Other notes / implementation ideas Could this be a regression from #724? I did not change anything in the config. Are there adjustments necessary? ### borgmatic version 1.8.0 ### borgmatic installation method _No response_ ### Borg version _No response_ ### Python version _No response_ ### Database version (if applicable) _No response_ ### Operating system and version _No response_
Owner

Thanks for taking the time to file this! I can repro it locally. And yes, good find, I think this is very likely a regression from #724 in that an incorrect default is being applied. Looking into it..

Thanks for taking the time to file this! I can repro it locally. And yes, good find, I think this is very likely a regression from #724 in that an incorrect default is being applied. Looking into it..
witten added the
bug
label 2023-07-22 21:51:53 +00:00
Owner

And by the way, you can work around this issue right now by specifying check_i_know_what_i_am_doing: true in your borgmatic configuration. That will unblock your check --repair, although be aware that it'll also bypass the interactive prompt.

And by the way, you can work around this issue right now by specifying `check_i_know_what_i_am_doing: true` in your borgmatic configuration. That will unblock your `check --repair`, although be aware that it'll also bypass the interactive prompt.
Author
Contributor

Yes, doing that now. :)

Yes, doing that now. :)
Owner

This has been fixed in main and will be part of the next release. Now, BORG_* environment variables are no longer passed to Borg unless the corresponding borgmatic options are actually set. Thanks again for reporting this!

This has been fixed in main and will be part of the next release. Now, `BORG_*` environment variables are no longer passed to Borg unless the corresponding borgmatic options are actually set. Thanks again for reporting this!
Owner

Just released in borgmatic 1.8.1!

Just released in borgmatic 1.8.1!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

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