yes/NO prompt not shown when changing repo location, causing confusion. #914
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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 am changing the IP Address of a remote repo because the device it is hosted had its IP changed.
Steps to reproduce
Actual behavior
A line containing a yes/no prompt is not output until enter is pressed, hanging borgmatic and causing lots of confusion.
Only upon pressing enter, this appears:
which will then already have aborted becuse No is the default.
Expected behavior
The last line prompting a choice should have been output as well. Like:
Other notes / implementation ideas
Workaround: press [y] then [Enter] upon seeing
Warning: The repository at location <A> was previously located at <B>
borgmatic version
1.8.13
borgmatic installation method
pipx
Borg version
borg 1.1.16 on source, borg 1.2.4 on destination
Python version
Python 3.9.2
Database version (if applicable)
No response
Operating system and version
Debian GNU/Linux 11 (bullseye) on source, Raspbian GNU/Linux 12 (bookworm) on destination
Promp missing on rep location change, creating confusion.to yes/NO prompt not shown when changing repo location, causing confusion.Thanks for taking the time to report this. What's going on is that, rather than operating in an interactive mode that allows you to see Borg's prompt, borgmatic is consuming Borg's output on a line-by-line basis and logging it to the console. So any interactive prompts don't display because they don't contain newlines. (And even if they did, you wouldn't be able to see what you're typing because borgmatic is intermediating Borg's input/output rather than giving Borg direct access to the console.) borgmatic does in certain cases switch to interactive mode, e.g. when
--progress
is specified. But in that scenario, borgmatic can't do fancy logging, which is needed for colored output, multiple logging backends, etc.Unfortunately that leaves this use case without a good solution unless you or I can think of another approach. In the meantime, what I recommend doing is to set the option
relocated_repo_access_is_ok: true
in your configuration file (either temporarily or permanently). That will allow Borg to bypass the interactive prompt and just deal with the fact that the repository has been moved.Okay, I've actually got a "fix" implemented in main, which will be part of the next release. Now, when the repository location changes, borgmatic will instruct Borg to exit immediately instead of displaying an invisible prompt. Then borgmatic will display a hopefully helpful error message suggesting what to do next. (This message only displays when using Borg 1.4.0+.)
Here's what it looks like:
The "Do you want to continue?" is not an actual interactive prompt. It's just what Borg displays when defaulting to "no" via the
BORG_RELOCATED_REPO_ACCESS_IS_OK
environment variable—which borgmatic now sets to "no" when the "relocated_repo_access_is_ok" option is unset.Anyway, feedback is welcome on this. But I'll close the ticket now as implemented! Thanks again.
this is way better than the invisible propmpt. thank you for taking the time :)
Sure thing!
Released in borgmatic 1.9.0!
thank you ^^