Backup and restore issue

Discussion in 'General' started by browscofield, Aug 2, 2021.

  1. browscofield

    browscofield New Member

    Hi everyone,
    I am facing some issue with my ISPConfig when I was running the backup where I faced the following error below.
    Failed to make backup of type web for domain id 6, because failed to mount backup directory
    So, then I just unchecked the option about if the "directory is mounted" ( I don't know why, once the dir /var/backup is mounted since the boot) - Server Settings Menu.
    But now, I am facing another issue when I try to restore the content as we can see the log below as well.

    -----
    dom ago 1 23:12:01 -03 2021 PHP Warning: copy(/var/www/clients/client3/web3/backup/manual-web3_2021-08-01_18-57.zip): failed to open stream: No such file or directory in /usr/local/ispconfig/server/lib/classes/backup.inc.php on line 275
    dom ago 1 23:12:02 -03 2021 PHP Warning: chgrp(): No such file or directory in /usr/local/ispconfig/server/lib/classes/backup.inc.php on line 276
    dom ago 1 23:12:02 -03 2021 PHP Warning: unlink(/var/www/clients/client3/web3/backup/manual-web3_2021-08-01_18-57.zip): No such file or directory in /usr/local/ispconfig/server/lib/classes/backup.inc.php on line 345
    dom ago 1 23:12:02 -03 2021 01.08.2021-23:12 - ERROR - Failed to restore web backup /var/backup/web3/manual-web3_2021-08-01_18-57.zip, exit code 9
    dom ago 1 23:12:02 -03 2021 finished server.php.
    -------

    pwd
    /var/www/clients/client3/web3
    root@ispserver:/var/www/clients/client3/web3# ls
    cgi-bin log private ssl tmp web webdav

    I tried to create the directory manually, but no successful.
    mkdir backup
    mkdir cannot create directory “backup”: operation not permitted

    And then I can't restore the backup so far.


    O.S and system information
    (Ubuntu 18.04.5 LTS (Bionic Beaver)) ISPConfig 3.2.5

    Using the previous version also happens the issue.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Start with this:
    https://www.howtoforge.com/community/threads/please-read-before-posting.58408/
    What shows
    Code:
    # ls -lhd /var/backup
    # df -hT /var/backup
    I don't know why but your host seems to store backups in or at least try to restore them from clients backup directory:
    Code:
    /var/www/clients/client3/web3/backup/manual-web3_2021-08-01_18-57.zip)
    On my host backups are stored in /var/backup.
     
  3. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I'm a little unclear, your original issue is failing to create a backup? Then you're later trying to restore a backup, so you additionally have a restore issue (possibly unrelated to the backup issue)?

    Do you have backup mount/unmount scripts in use? Or you simply mount something at /var/backup via fstab?

    What is in the /var/backup/web3/ directory?

    Can you enable server debug mode first, click the button to perform that restore again, then run server.sh manually to see all the debug messages? After having done that and saved that output, this (creating the backup dir manually) is worth a shot; to do so you will need to 'chattr -i /var/www/clients/client3/web3' first. If this works to allow you to restore, there may be some bug/scenario in which the backup dir is not created, please post the above saved output and any further info you can about this website (eg. was it just created, or do you know steps to reproduce the issue).
     
  4. browscofield

    browscofield New Member

    Hello everyone,

    Sorry for my confused post.
    Let me try to explain better step by step, in timeline way.

    First issue was related to start backing up automatically, so, I scheduled the backup every day at 1 a.m, but I've noticed that the copy wasn't working, then I tried to run manually and notice the same matter. Looking at the logs I saw the following error below.

    Code:
    Failed to make backup of type web for domain id 6, because failed to mount backup directory
    So, after trying a lot of time and check the directory if it was or not mounted. I unchecked the options "Is the backup's directory mounted?", then the backup started working, manually and automatically.

    After I that, I tried to download and restore option as well, but I couldn't download even restore the backup, cause even the backup was being created on /var/backup, it wasn't able to restore, because there isn't the backup directory created on

    What I meant above that I tried to create the directory by myself, but because of permission I couldn't do.
    Every test I was running the backup manually. I don't know if there is some rule, but after the backup ran automatically I can see that the backup directory was created successful, and it seens to be working normally right now.

    My question after this whole situation.
    When is the backup directory created into the clients' home?
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Looks like it is created in prepare_backup_dir(), which is called by make_database_backup() and make_web_backup(), which are called by run_backup(). run_backup() is called in various places, eg. from run_all_backups() (via cron job) and when creating a manual backup ("backup now").
     
    browscofield likes this.
  6. browscofield

    browscofield New Member

    @Jesse Norell
    Yes. but it seems that was just created after automatic backup run, cause I ran manually but it wasn't created.
     

Share This Page