check --repair interactive question gets immediately answered #730
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#730
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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..
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 yourcheck --repair
, although be aware that it'll also bypass the interactive prompt.Yes, doing that now. :)
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!Just released in borgmatic 1.8.1!