terminating with success status, rc 0 #856
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#856
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
Hi, Im trying to complete a backup including mysql database that never finishes.
Thanks
Steps to reproduce
Run the borgmatic command:
borgmatic -v2
Actual behavior
The backup seems to complete however there is not database backup, we have hung mysqldump processes:
[root@isp mpana]# ps -ef|grep -i mysql mysql 1061 1130 0 2023 ? 15:05:55 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock mysql 1130 1 0 2023 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr root 12416 12413 0 13:33 pts/1 00:00:00 /bin/sh -c mysqldump --quick --compress --max-allowed-packet=2G --add-drop-database --user root --databases list of databases > /home/tmp/mysql_databases/localhost/all root 12417 12416 0 13:33 pts/1 00:00:00 /bin/sh -c mysqldump --quick --compress --max-allowed-packet=2G --add-drop-database --user root --databases list of databases > /home/tmp/mysql_databases/localhost/all root 12518 12495 0 13:33 pts/2 00:00:00 grep --color=auto -i mysql root 30328 1 0 11:49 ? 00:00:00 /bin/sh -c mysqldump --quick --compress --max-allowed-packet=2G --add-drop-database --user root --databases lis of databases > /home/tmp/mysql_databases/localhost/all
And borg/borgmatic never finishes. We have a process that is waiting in this state for over 3 days now. We end up killing them.
security: saving state for ce532d87c91d01bf89453e606b34ae90834fd58d103037b0fd58c1d50c28a64a to /root/.config/borg/security/ce532d87c91d01bf89453e606b34ae90834fd58d103037b0fd58c1d50c28a64a security: current location ssh://xxxx/./xxx security: key type 2 security: manifest timestamp 2024-04-23T10:36:14.951989 RemoteRepository: 140.60 MB bytes sent, 60.22 kB bytes received, 1144 messages sent terminating with success status, rc 0
Mounting and verifying the backups does not include the databases, just the files.
Expected behavior
The job to finish and close and include the mysql dumps.
Other notes / implementation ideas
No response
borgmatic version
1.5.22
borgmatic installation method
pipx
Borg version
1.1.18
Python version
3.6.8
Database version (if applicable)
Ver 15.1 Distrib 5.5.68-MariaDB
Operating system and version
NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"
Thanks for taking the time to file this and provide all the details. There have been a number of improvements made to borgmatic since the version 1.5.22 that you're using, specifically around detecting and preventing hangs during database dumps. I highly suspect that's what you're encountering here and so I recommend you upgrade borgmatic and try again! It sounds like you installed borgmatic with pipx, which makes me think it should hopefully be pretty easy to upgrade. (If you didn't actually install with pipx and you're using an old OS package, uninstall that first and then install with pipx or another installation method of your choice.)
Also, check out the database hook limitations in the documentation. Some of them may be relevant in your case.
Hi,
Thank you as well.
For reasons unbeknownst to me pipx upgrade borgmatic tells me that version 1.5.22 is the latest. I will use one of the other installation methods and test things out.
I have been reading the documentation and did notice that I am using an older version here but did not bother to look into it further. Will do so now.
Regards,
Marius
Huh, that is quite odd! There are definitely newer versions available to pipx. Maybe CentOS has modified their pipx package in some way. In any case, you might be able to install instead with
sudo pip3 install borgmatic
orpip3 install --user borgmatic
.I got updated versions installed, however the issue remains:
borg 1.2.8 borgmatic 1.8.10
I believe the problem may be that I am using a pretty old version of mariadb, which does not include mariadb-dump. I am using the mysql_databases section with mysqldump.
With the never version, the job finished succefully, it no longer hangs with "terminating with success status, rc 0", however there is not database included in the backup.
I will prepare an upgrade to a newer mariadb with the mariadb-dump program included.
Feel free to close this issue or I can report back after the upgrade with more details.
Thank you, I appreciate the support.
How are you checking whether a database is included in the backup? Do you see any indication of that in the borgmatic logs? And are you trying
borgmatic list
to inspect the contents of the backup archive and look for the database dump?I'm happy to leave this open if you're planning on reporting back!
Sure thing.
I am mounting the backup.
(borg) [root@isp ~] borgmatic mount --mount-point /mnt/restore --verbosity 2
And then I look for directory with .borgmatic or a mysql_datbases folder as I noticed I have on other systems where this works:
I have also tried searching with 'find' without success:
Interestingly during the backup I can see and follow (strace) the named pipe and see the mysqldump command, dumping.
I am searching for another Centos7/RH box to test.
Got it, thanks. It definitely does appear that there aren't any databases in that archive! I think at this point it would be useful to see the full verbose output of your borgmatic logs (redacted if necessary). That will hopefully show what's going on with the database dump command.
Alright, here is the the log, I "carefully" cut out all the files being uploaded and am quite certain I did not miss anything:
The included lines similar to these:
Okay, something's definitely going wrong between these two log lines:
Here's what I would expect to see if MySQL databases were actually getting dumped:
Specifically, I'd expect to see the
Dumping MySQL database "name" to ...
log entry even if there were issues calling the MySQL/MariaDB dump binary or it never exited.Looking at the code, here are things I can think of that might result in that log entry never getting logged:
all
but with borgmatic somehow unable to resolve that to actual database names to dump, maybe due to that old MariaDB version. Are you usingall
? If so, does borgmatic work if you instead use actual database names?Thanks for your patience here.
I do see output similar to what you showed, using all or a single database but on stdout not in the logfile specified with --log-file.
While looking at the output I noticed where it was dumping to, or at least creating the named pipe, and realised that I am also backing up /home. I had borg_source_directory = /home/tmp ... I removed that and I now have a root/.borgmatic/mysql_databases folder with my databases. I think I remember reading that borg excludes its temporary directories automatically if they are included in the backup paths, I should have realised that it would also exclude the named pipe and mysqldums.
Man do I feel silly. Im not sure what determined me to set the borg_source_directory in the first place.
I apologise for my haste in opening this issue and really appreciate your time.
Ah that's a very tricky failure mode! I'm really glad to hear you figured it out though and that the fix was so "easy." And yeah,
--log-file
will only include log entries at a certain verbosity unless you increase its log level with--log-file-verbosity
.