Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle "borg create" status code which maybe be "1" when warning occurs (such as when a file changed during the backup) #176

Merged

Conversation

fflorent
Copy link
Contributor

Problem

Fixes #159 ?

If a file has changed during the backup, the admin gets a warning and the borg create command exists with status code 1. This code is meant to raise attention about an issue that may not be severe:
borgbackup/borg@7e6afc9

Solution

I propose to check the status code and exit only it is equal to 2 or above.

Also see this comment, which should solve the warning (I still think my patch would probably be helpful anyway for other cases): YunoHost-Apps/synapse_ynh#474 (comment)

Please note that I haven't tested it yet. I encounter the issue on production, I would like to get a review and I would be glad to beta test it afterward.

PR Status

  • Code finished and ready to be reviewed/tested
  • The fix/enhancement were manually tested (if applicable) ⇒ see above

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

@fflorent
Copy link
Contributor Author

!testme

@yunohost-bot
Copy link
Contributor

🪱
Test Badge

@yunohost-bot
Copy link
Contributor

Alrighty!
Test Badge

@fflorent fflorent changed the base branch from master to testing August 25, 2024 13:44
@utzer
Copy link
Contributor

utzer commented Dec 13, 2024

Why is this not merged? I get 12 emails each day (during each backup one) for this problem, it made the notifications of yunohost really useless.

Don't get me wrong, I am just asking, no pressure, but also wanted to explain that this is some fix that might be awaited by some people like me.

@fflorent
Copy link
Contributor Author

I don't have the merge grant, so I need someone to review this patch.

@utzer
Copy link
Contributor

utzer commented Dec 29, 2024

I don't have the merge grant, so I need someone to review this patch.

I thought so... and still not merged.

conf/backup_method Outdated Show resolved Hide resolved
# This is a warning, the script may continue, but let's warn the admin.
# See: https://github.com/borgbackup/borg/issues/6989#issuecomment-1223921392
echo "Some warning were logged during the backup, you'd probably check whether it was severe or not" >&2
# Note that retco
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is truncated. I fix that.

@fflorent fflorent requested a review from alexAubin December 29, 2024 17:32
@alexAubin alexAubin changed the title Fix file changed during backup Properly handle "borg create" status code which maybe be "1" when warning occurs (such as when a file changed during the backup) Dec 29, 2024
@alexAubin alexAubin merged commit 8dbc4c6 into YunoHost-Apps:testing Dec 29, 2024
@alexAubin alexAubin mentioned this pull request Dec 29, 2024
@utzer
Copy link
Contributor

utzer commented Dec 29, 2024

Thanks guys!

I am wondering if there is a way to stop an application before the backup, because for some applications it might be better to stop them before, I guess synapse is one of those apps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Borg fails when file changes on disk during archive creation
4 participants