We moved this page to our Documentation Portal. You can find the latest updates here. |
Issue
Restoring a VS from an incremental backup fails if there are some files that are protected by the append flag.
The following are the examples of the files that are protected by the append flag and are used by cPanel logs:
[root@testonapp ~]# lsattr /usr/local/cpanel/logs/
-------------e-- /usr/local/cpanel/logs/license_log
-----a-------e-- /usr/local/cpanel/logs/cphulkd.log
-------------e-- /usr/local/cpanel/logs/php-fpm
-------------e-- /usr/local/cpanel/logs/license_error.display
-------------e-- /usr/local/cpanel/logs/cpdavd_error_log
-----a-------e-- /usr/local/cpanel/logs/queueprocd.log
-------------e-- /usr/local/cpanel/logs/session_log
-------------e-- /usr/local/cpanel/logs/cpwrapd_log
-------------e-- /usr/local/cpanel/logs/build_locale_databases_log
-------------e-- /usr/local/cpanel/logs/incoming_http_requests.log
-----a-------e-- /usr/local/cpanel/logs/spamd_error_log
-----a-------e-- /usr/local/cpanel/logs/error_log
-----a-------e-- /usr/local/cpanel/logs/dnsadmin_log
-------------e-- /usr/local/cpanel/logs/access_log
-----a-------e-- /usr/local/cpanel/logs/stats_log
-----a-------e-- /usr/local/cpanel/logs/cphulkd_errors.log
-------------e-- /usr/local/cpanel/logs/update_analysis
-------------e-- /usr/local/cpanel/logs/login_log
-----a-------e-- /usr/local/cpanel/logs/tailwatchd_log
-------------e-- /usr/local/cpanel/logs/api_tokens_log
The append flag doesn't allow to rewrite or delete files but only to edit them. Rsync that is used to restore virtual servers from incremental backups fails when it cannot rewrite such files.
See the log output below for an example:
sync: rename "/mnt/onapp-tmp-x62lgr1fnvpaz8/usr/local/cpanel/logs/.tailwatchd_log.pG04ZV" ->
"usr/local/cpanel/logs/tailwatchd_log": Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.1]
Fatal: Execution of rsync --xattrs --acls --archive --hard-links --delete --numeric-ids --sparse --exclude '/dev/**' --exclude '/proc/**' --exclude '/sys/**' --exclude '/selinux/**' --exclude '/tmp/**' /onapp/backups/m/b/mbwydlyfgraoxe/ /mnt/onapp-tmp-x62lgr1fnvpaz8/ failed
Environment
All OnApp Versions
Resolution
Starting from OnApp 5.9
To resolve the issue on clouds that run OnApp 5.9-Edge and the following versions (5.10-Edge and 6.0), you can format the main virtual disk from UI before restoring a VS from an incremental backup.
OnApp 5.8 and preceding versions
If you run OnApp 5.8 or an earlier version, apply the following workaround to resolve the issue:
1. Take an incremental backup for a virtual server.
3. Start the virtual server in the recovery mode.
4. Access the virtual server via SSH.
5. Run the following commands:
mount /dev/vda1 /mnt/
chattr -a -R /mnt/usr/local/cpanel/logs/