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.
 
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.
 
Backup size is 411M
Yes, already extracted and confirmed the "backup" directory is present in the tar files.
 
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..) ?
 
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
 
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
 
Beyond that, try extracting it as the User to see what's going on. Call this while in ssh as root:
You've made a typo in the command, having admin_bacukps instead of admin_backups

When correcting the typo, I'm getting the following error:

Code:
sudo -H -u userhere /bin/bash -c '/bin/nice -n 19 /bin/tar xzfp /home/admin/admin_backups/user.admin.userhere.tar.gz -C /home/userhere/backups backup'
/bin/tar: /home/userhere/backups: Cannot open: No such file or directory
/bin/tar: Error is not recoverable: exiting now

I've tried all of the steps above, nothing worked for me

I am not sure where it's going wrong, as I don't really know exactly what the command does too, other than unzipping in its designated /home/admin/admin_backups place

Edit: The folder did not exist, therefore, how can it copy to that folder? mkdir folder and then chowning that stuff did the backup for me. Now what? I'm left with a bunch of files that I can't use in /home/userhere
 
Last edited:
It's solved for me

Oke so here's what happened in my case

DirectAdmin did not fully delete the user when I did this in the gui. Some files were left over, namely the following:
Code:
/var/named/userdomain1.com.db /var/named/userdomain2.com.db - Deleted
/usr/local/directadmin/data/users/userhere - Deleted
/etc/virtual/domains with all domains/pointers/aliasses - Removed relevant domains/userhere data
/etc/virtual/domainowners with all userhere domains - Removed relevant domains/userhere data
/etc/named.conf with all userhere domains - Removed relevant domains/userhere data
sudo userdel userhere
sudo service directadmin restart
I've restored the user with the following error, though this is completely fine as the domain pointers were alright being there
Error restoring domain: Error while restoring domains pointers: Cannot create symlink, file already exists: /etc/virtual/domainpointer1.com

I hope this will help anyone who has this problem in the future!
 
Back
Top