Confusing error messages #623

Closed
opened 2022-12-23 16:23:01 +00:00 by marozsas · 7 comments

When borgmatic is running and in another window you run another borgmatic command, i.e. borgmatic info, it replies with a message saying that was impossible to acquire a lock, which is fine, followed by another error message saying that there is an error in config file that are just non-sense and could lead one to wondering that really is another problem.

Would be nice to just have a siingle message about the lock removing the error message that says "/etc/borgmatic.d/photos.yaml: Error running configuration file" since there is no error on configuration file...

kimera:~ # borgmatic list
/media/miguel/ExternalBackups/borg-backups/windows-pictures: Listing archives
Failed to create/acquire the lock /media/miguel/ExternalBackups/borg-backups/windows-pictures/lock.exclusive (timeout).
/media/miguel/ExternalBackups/borg-backups/windows-pictures: Error running actions for repository
Command 'borg list /media/miguel/ExternalBackups/borg-backups/windows-pictures' returned non-zero exit status 2.
/etc/borgmatic.d/photos.yaml: Error running configuration file
...
summary:
/etc/borgmatic.d/photos.yaml: Error running configuration file
/media/miguel/ExternalBackups/borg-backups/windows-pictures: Error running actions for repository
Failed to create/acquire the lock /media/miguel/ExternalBackups/borg-backups/windows-pictures/lock.exclusive (timeout).
Command 'borg list /media/miguel/ExternalBackups/borg-backups/windows-pictures' returned non-zero exit status 2.

Environment

borgmatic version: 1.7.5

borgmatic installation method: RPM
borgbackup-bash-completion-1.2.2-1.1.noarch
borgbackup-1.2.2-1.1.x86_64
borgmatic-1.7.5-1.1.noarch

Borg version: borg 1.2.2

Python version: Python 3.10.9

operating system and version: opensuse tumbleweed

When borgmatic is running and in another window you run another borgmatic command, i.e. borgmatic info, it replies with a message saying that was impossible to acquire a lock, which is fine, followed by another error message saying that there is an error in config file that are just non-sense and could lead one to wondering that really is another problem. Would be nice to just have a siingle message about the lock removing the error message that says "/etc/borgmatic.d/photos.yaml: Error running configuration file" since there is no error on configuration file... kimera:~ # borgmatic list /media/miguel/ExternalBackups/borg-backups/windows-pictures: Listing archives Failed to create/acquire the lock /media/miguel/ExternalBackups/borg-backups/windows-pictures/lock.exclusive (timeout). /media/miguel/ExternalBackups/borg-backups/windows-pictures: Error running actions for repository Command 'borg list /media/miguel/ExternalBackups/borg-backups/windows-pictures' returned non-zero exit status 2. /etc/borgmatic.d/photos.yaml: Error running configuration file ... summary: /etc/borgmatic.d/photos.yaml: Error running configuration file /media/miguel/ExternalBackups/borg-backups/windows-pictures: Error running actions for repository Failed to create/acquire the lock /media/miguel/ExternalBackups/borg-backups/windows-pictures/lock.exclusive (timeout). Command 'borg list /media/miguel/ExternalBackups/borg-backups/windows-pictures' returned non-zero exit status 2. #### Environment **borgmatic version:** 1.7.5 **borgmatic installation method:** RPM borgbackup-bash-completion-1.2.2-1.1.noarch borgbackup-1.2.2-1.1.x86_64 borgmatic-1.7.5-1.1.noarch **Borg version:** borg 1.2.2 **Python version:** Python 3.10.9 **operating system and version:** opensuse tumbleweed
Owner

Thanks for taking the time to file this! The current error messages are accurate, although I can see how they are misleading in this case. What's going on is borgmatic runs Borg, which is itself erroring with the "failed to create/acquire lock" message. borgmatic sees that Borg has exited with an error and displays its own "Error running configuration file" message, indicating that something has gone wrong while running through actions for the named configuration file—not that anything is necessarily wrong with the file itself.

So maybe this is just a question of tweaking the phrasing? What do you think of /etc/borgmatic.d/photos.yaml: Error running actions for configuration file? Or just /etc/borgmatic.d/photos.yaml: An error occurred?

Thanks for taking the time to file this! The current error messages are accurate, although I can see how they are misleading in this case. What's going on is borgmatic runs Borg, which is itself erroring with the "failed to create/acquire lock" message. borgmatic sees that Borg has exited with an error and displays its own "Error running configuration file" message, indicating that something has gone wrong while running through actions for the named configuration file—not that anything is necessarily wrong with the file itself. So maybe this is just a question of tweaking the phrasing? What do you think of `/etc/borgmatic.d/photos.yaml: Error running actions for configuration file`? Or just `/etc/borgmatic.d/photos.yaml: An error occurred`?
Author

I guess that tweaking the phrase to "/etc/borgmatic.d/photos.yaml: An error occurred" is more general and don't cause one to misinterpret it as a problem in config.

Funny story, let me give you a background of what occurred so you can have a complete picture:

Today, before leaving to Xmas, we (I and my co-workers) decided to make an extra backup, just because we can.

Than, hours later, I run "borgmatic info" to inspect the destination disk, as a sanity check before running the backup and got those errors.
I spend several minutes (really!) to figure out why the config is wrong and why a lock is in place.

Then I realize that one of my buddies started the backup hours before so this explain the lock out of my knowledge, and so I tought it was a problem in config which is most common! You see ? Se someone don't knows a backup is running, the messages are misleading !

Thank tou !

I guess that tweaking the phrase to "/etc/borgmatic.d/photos.yaml: An error occurred" is more general and don't cause one to misinterpret it as a problem in config. Funny story, let me give you a background of what occurred so you can have a complete picture: Today, before leaving to Xmas, we (I and my co-workers) decided to make an extra backup, just because we can. Than, hours later, I run "borgmatic info" to inspect the destination disk, as a sanity check before running the backup and got those errors. I spend several minutes (really!) to figure out why the config is wrong and why a lock is in place. Then I realize that one of my buddies started the backup hours before so this explain the lock out of my knowledge, and so I tought it was a problem in config which is most common! You see ? Se someone don't knows a backup is running, the messages are misleading ! Thank tou !
Owner

That totally makes sense. Based on that series of events, I can see how the message would be misleading. I'll tweak the wording to hopefully improve clarity here!

That totally makes sense. Based on that series of events, I can see how the message would be misleading. I'll tweak the wording to hopefully improve clarity here!
witten added the
good first issue
label 2023-02-04 17:14:44 +00:00
Collaborator

I had the same issue with the phrasing too, I'll work on this if nobody else does, considering this might be a good issue for (even) newer contributors :D

I had the same issue with the phrasing too, I'll work on this if nobody else does, considering this might be a good issue for (even) newer contributors :D
Owner

Feel free to pick it up if you want!

Feel free to pick it up if you want!
Owner
Fixed by @diivi in https://github.com/borgmatic-collective/borgmatic/pull/55!
Owner

Released in borgmatic 1.7.10!

Released in borgmatic 1.7.10!
Sign in to join this conversation.
No Milestone
No Assignees
3 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#623
No description provided.