Comment 1 for bug 1570304

Revision history for this message
Pierre-Arthur MATHIEU (pi3rra) wrote :

How to reproduce the "Directory not empty" error :

Setup:

    mkdir backupdir
    mkdir backupdir/dir1
    mkdir backupdir/dir2
    echo "aa" > backupdir/dir1/file1_dir1
    echo "aa" > backupdir/dir2/file1_dir2

    freezer-agent --path-to-backup /home/stack/backupdir/ --backup-name plop --storage local --container /tmp/test/ --max-level 15

    rm -rf backupdir/dir2/
    mv backupdir/dir1/ backupdir/dir2

    freezer-agent --path-to-backup /home/stack/backupdir/ --backup-name plop --storage local --container /tmp/test/ --max-level 15

Restore:

    stack@padawan-ccp-c0-m1-mgmt:~$ freezer-agent --restore-abs-path /home/stack/restoredir/ --backup-name plop --storage local --container /tmp/test/ --action restore
    [*] Critical Error: failed to restore file

After restore state:

    stack@padawan-ccp-c0-m1-mgmt:~$ ls -lah restoredir/
    total 16K
    drwxr-xr-x 4 stack stack 4.0K Apr 21 05:20 .
    drwxr-xr-x 14 stack stack 4.0K Apr 21 05:20 ..
    drwxr-xr-x 2 stack stack 4.0K Apr 21 05:19 dir1
    drwxr-xr-x 2 stack stack 4.0K Apr 21 05:19 dir2
    stack@padawan-ccp-c0-m1-mgmt:~$ ls -lah restoredir/dir1/
    total 12K
    drwxr-xr-x 2 stack stack 4.0K Apr 21 05:19 .
    drwxr-xr-x 4 stack stack 4.0K Apr 21 05:20 ..
    -rw-r--r-- 1 stack stack 3 Apr 21 05:19 file1_dir1
    stack@padawan-ccp-c0-m1-mgmt:~$ ls -lah restoredir/dir2
    total 8.0K
    drwxr-xr-x 2 stack stack 4.0K Apr 21 05:19 .
    drwxr-xr-x 4 stack stack 4.0K Apr 21 05:20 ..

Log (separated backup level 1, backup level 2 and restore):

    2016-04-21 05:20:17,738 root INFO log file at /home/stack/.freezer/freezer.log
    2016-04-21 05:20:17,739 root INFO [*] Job execution Started at: 2016-04-21 05:20:17
    2016-04-21 05:20:17,899 root INFO [*] No LVM requested/configured
    2016-04-21 05:20:17,899 root WARNING [*] Directory /home/stack/.freezer found!
    2016-04-21 05:20:17,900 root INFO Tar engine backup stream enter
    2016-04-21 05:20:17,901 root INFO Execution command:
    /bin/tar --create -z --warning=none --no-check-device --one-file-system --preserve-permissions --same-owner --seek --ignore-failed-read --listed-incremental=/home/stack/.freezer/tar_metadata_padawan-ccp-c0-m1-mgmt_plop_1461216017_0 .
    2016-04-21 05:20:17,920 root INFO Tar engine streaming end
    2016-04-21 05:20:17,926 root INFO [*] Job execution Finished, at: 2016-04-21 05:20:17
    2016-04-21 05:20:17,927 root INFO [*] Job time Elapsed: 0:00:00.186618

    2016-04-21 05:20:30,207 root INFO log file at /home/stack/.freezer/freezer.log
    2016-04-21 05:20:30,208 root INFO [*] Job execution Started at: 2016-04-21 05:20:30
    2016-04-21 05:20:30,258 root INFO [*] No LVM requested/configured
    2016-04-21 05:20:30,260 root WARNING [*] Directory /home/stack/.freezer found!
    2016-04-21 05:20:30,262 root INFO Tar engine backup stream enter
    2016-04-21 05:20:30,265 root INFO Execution command:
    /bin/tar --create -z --warning=none --no-check-device --one-file-system --preserve-permissions --same-owner --seek --ignore-failed-read --listed-incremental=/home/stack/.freezer/tar_metadata_padawan-ccp-c0-m1-mgmt_plop_1461216017_0 .
    2016-04-21 05:20:30,277 root INFO Tar engine streaming end
    2016-04-21 05:20:31,279 root INFO [*] Job execution Finished, at: 2016-04-21 05:20:31
    2016-04-21 05:20:31,279 root INFO [*] Job time Elapsed: 0:00:01.071243

    2016-04-21 05:20:58,102 root INFO log file at /home/stack/.freezer/freezer.log
    2016-04-21 05:20:58,103 root INFO [*] Job execution Started at: 2016-04-21 05:20:58
    2016-04-21 05:20:58,103 root INFO [*] Executing FS restore...
    2016-04-21 05:20:58,104 root INFO Creation restore path: /home/stack/restoredir/
    2016-04-21 05:20:58,105 root INFO Creation restore path completed
    2016-04-21 05:20:58,105 root INFO Restore backup padawan-ccp-c0-m1-mgmt_plop_1461216017_0
    2016-04-21 05:20:58,128 root INFO [*] Pipe closed as EOF reached. Data transmitted successfully
    2016-04-21 05:20:58,137 root INFO Restore backup padawan-ccp-c0-m1-mgmt_plop_1461216030_1
    2016-04-21 05:20:58,156 root INFO [*] Pipe closed as EOF reached. Data transmitted successfully
    2016-04-21 05:20:58,164 root ERROR [*] Restore error: /bin/tar: Cannot rename ‘./dir1’ to ‘./dir2’: Directory not empty
    /bin/tar: Exiting with failure status due to previous errors
    Traceback (most recent call last):
      File "/opt/stack/venv/freezer_agent-20160418T041026Z/lib/python2.7/site-packages/freezer/engine/tar/tar_engine.py", line 129, in restore_level
        tar_process.stdin.write(read_pipe.recv_bytes())
    EOFError
    2016-04-21 05:20:58,167 root CRITICAL [*] Critical Error: failed to restore file