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

The rsync 24 return code should not trigger a BIT failure #1506

Closed
jean-christophe-manciot opened this issue Aug 23, 2023 · 6 comments
Closed
Assignees
Labels

Comments

@jean-christophe-manciot
Copy link

jean-christophe-manciot commented Aug 23, 2023

Using BIT ecf9312, I noticed that some snapshots fail and are consequently cancelled due to an rsync warning:

[I] Take snapshot (rsync: total size is 46.24G  speedup is 13.62)
[I] Take snapshot (rsync: rsync warning: some files vanished before they could be transferred (code 24) at main.c(1338) [sender=3.2.7])
[E] Error: 'rsync' ended with exit code 24 (negative values are signal numbers, see 'kill -l')
[E] Failed to take snapshot 2023-08-20 00:31:55.

It can be part of a normal live linux system to create some files temporarily before the backup starts and discard them before the end of the snapshot.
This warning should not cancel the entire backup.

I propose 2 alternatives:

  • dismiss this specific rsync return code and let the snapshot complete normally (preferred solution)
  • or add an option in the "expert options" of the settings to dismiss this 24 return code

bit-diags.txt

@aryoda aryoda self-assigned this Aug 24, 2023
@emtiu emtiu added the Bug label Aug 25, 2023
@aryoda
Copy link
Contributor

aryoda commented Aug 27, 2023

THX for testing and reporting this issue!

I think I will implement alternative 1 by logging the exit code 24 as [I] (info) only in the snapshot log instead of treating it as error.

I have also just checked the list of rsync's exit codes to find other candidates (beyond 24) which should NOT be treated as an error but just as a warning or info in BiT and have found no more additional exit codes:

EXIT VALUES
 0 - Success
 1 - Syntax or usage error
 2 - Protocol incompatibility
 3 - Errors selecting input/output files, dirs
 4 - Requested action not supported. Either:
     - an attempt was made to manipulate 64-bit files on a platform that cannot support them
     - an option was specified that is supported by the client and not by the server
 5 - Error starting client-server protocol
 6 - Daemon unable to append to log-file
10 - Error in socket I/O
11 - Error in file I/O
12 - Error in rsync protocol data stream
13 - Errors with program diagnostics
14 - Error in IPC code
20 - Received SIGUSR1 or SIGINT
21 - Some error returned by waitpid()
22 - Error allocating core memory buffers
23 - Partial transfer due to error
24 - Partial transfer due to vanished source files
25 - The --max-delete limit stopped deletions
30 - Timeout in data send/receive
35 - Timeout waiting for daemon connection

I was hesitating on my opinion about the exit code 25 though - it could also be an info in BiT instead of an error (man rsync describes this as a "warning" but considers error code 25 as an "error code").

Since the --max-delete option is not used in BiT (I have checked the code) it can only be activated by adding manual cmd line options in the BiT profile settings so the user should know why he/she does this and how to handle the exit code 25 then.

So I plead to treat exit code 25 as error too in BiT for now...

@aryoda
Copy link
Contributor

aryoda commented Aug 28, 2023

I have improved the code base and created the PR #1510

Now not only exit code 24 is logged as INFO (instead of ERROR) but also exit code 0 ("success") which was previously not logged in the snapshot log.

Note: The branch name linked in this issue in the "development" block (top right) is wrong and I cannot change it anymore to the correct name so please ignore it and use the branch name of the PR...

@jean-christophe-manciot
Copy link
Author

@aryoda

I've just built d7e0297 for Ubuntu 23.04. I'll let you know when that error/warning pops up again.

@aryoda
Copy link
Contributor

aryoda commented Aug 29, 2023

@jean-christophe-manciot Sorry, the commit you have used does not yet contain my fix, I have just merged it into the dev branch (a95cf2e) so please use this version to test it...

Note: The snapshot log entry should now look like this in case of exit code 24:

[I] 'rsync' ended with exit code 24: Partial transfer due to vanished source files (see 'man rsync')

@buhtz buhtz added this to the 1.4.0 (upcoming release) milestone Aug 31, 2023
@jean-christophe-manciot
Copy link
Author

OK, 92ac856 (which includes a95cf2e) is now available for Debian 12 and soon Ubuntu 23.04.

@aryoda
Copy link
Contributor

aryoda commented Sep 11, 2023

I am closing this issue now.

The fix is contained in the upcoming release we are preparing in the upcoming week(s).

Please open a new issue if something is still wrong.

@aryoda aryoda closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants