Unable to extract the directory 'backup'

suhesh

New member
Joined
Jun 25, 2017
Messages
8
I am getting the following error while restoring the account from directadmin.

Code:
Error restoring xtextuserx: Unable to extract the directory 'backup' from the file /home/admin/admin_backups/user.admin.xtextuserx.tar.gz as user xtextuserx<br>
<br>
File '/home/admin/admin_backups/user.admin.xtextuserx.tar.gz' was 430065655 bytes in size, as read by root.<br>
I have go through the logs and didn't found a solution for this error.
 

adam12

Verified User
Joined
Feb 19, 2016
Messages
56
A couple questions:

- How large is the backup file?
- Does the backup file actually contain a `backup` folder? Check this by extracting it somewhere temporary.
 

suhesh

New member
Joined
Jun 25, 2017
Messages
8
Backup size is 411M
Yes, already extracted and confirmed the "backup" directory is present in the tar files.
 

suhesh

New member
Joined
Jun 25, 2017
Messages
8
Hello,

I face this issue with two servers. So a solution is necessary. Is there any doc for manually migrate the contents of an account ( each contents , conf etc..) ?
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
8,961
I did see that error a week ago with one server running CloudLinux.
CL often has a symlink protection feature enabled, which does not allow a symlink to be created by the User (eg: while extracting a tar as the user), if it points to a non-user owned file.
In the previous case, it was pointing to a root-owned commands.deny file (and the link was also broken), so the backup stored the link, but couldn't be extracted as the User, since it would have been created by the User pointing to a root owned file, so that broke tar.


  1. Check the tar.gz for any symbolic links that might fall into this category
  2. If it's CL, try disabling the fs.enforce_symlinksifowner
  3. If that's not enough, also disbale fs.protected_symlinks_create (same method as above)
  4. Beyond that, try extracting it as the User to see what's going on. Call this while in ssh as root:
    Code:
    sudo -H -u xtextuserx /bin/bash -c '/bin/nice -n 19 /bin/tar xzfp /home/admin/admin_bacukps/user.admin.xtextuserx.tar.gz -C /home/xtextuserx/backups backup'
Oddly, running #4 did output the error, but DA wasn't able to catch the output with stderr.. even though the command was run with 2>&1 at the end of it..
Let us know what you get for #4, as it should tell us what's up one way or another.

John
 

suhesh

New member
Joined
Jun 25, 2017
Messages
8
Hello,

Thanks, it helped to resolve the issue after adding the following entries in the sysctl.conf.

fs.enforce_symlinksifowner = 0
fs.protected_symlinks_create = 0
 
Top