Page 1 of 2

Error: invalid backup format

Posted: Wed Dec 07, 2016 5:45 pm
by SampleTacoInundation
Hello everyone,

We recently set up a vm web hosting server in order to prepare ourselves for taking down a physical server we have that has been having what seems like hardware issues.

The virtual server is set up with ubuntu, with vesta 0.9.8-17 installed. I copied over the backup tar files over from the old server to the new one, and placed them in the home/backup directory. When I try to use v-restore-user, I get an error saying "Error: invalid backup format ::" followed by the directory path describing the tar file I just tried to use.

I scoured the interwebs and these forums trying to find someone with a similar issue, but I have yet to find a similar situation. I tried:
  • - Changing the permissions attributes of the backup folder, the individual tar files, as well as v-restore-user script
    - Using a different tar file
    - Restoring a different user
    - Switching Active User
    - Copying the permission layout of the old server's backup files to the new server
    - Checking spelling on my commands
    - Using grep to find the error message (we found a similar error message within other code, but could not identify the source of our error)
If anyone could help or offer any tips toward getting our users restored it would be greatly appreciated :)

Re: Error: invalid backup format

Posted: Wed Dec 07, 2016 7:09 pm
by stiadmin
I'm finding the same issue as well. Looks like the cuprit is the regular expression in the is_user_format_valid() function in func/main.sh. Line number 508:

Code: Select all

 if ! [[ "$1" =~ ^[[:alnum:]][-|\.|_[:alnum:]]{0,28}[[:alnum:]]$ ]]
Anyone know what needs to be fixed to make this work?

Re: Error: invalid backup format

Posted: Wed Dec 07, 2016 8:10 pm
by stiadmin
More background information: This issue seems to persist across both our VESTA servers.

Server 1:
Ubuntu 14.0.4
VESTA 0.9.8 - 16


Server 2:
Ubuntu 16.0.4
VESTA 0.9.8 - 17

If I do a CLI backup and restore I get the same error message on both machines.

I am following this process:
https://vestacp.com/docs/#how-to-migrat ... her-server

Re: Error: invalid backup format

Posted: Wed Dec 07, 2016 8:32 pm
by skamasle
You may get error because you do something like this:

v-restore-user admin /backup/admin.ddddd.tar

You need enter to backup folder cd /backup and then run restore v-restore-user admin admin-dddddd.tar

If you run ubuntu 16 you need take care about this bug -> https://github.com/serghey-rodin/vesta/issues/959

Re: Error: invalid backup format

Posted: Thu Dec 08, 2016 8:49 pm
by stiadmin
Unfortunately neither of those resolved the issue for us :-( Interestingly enough the scheduled restore through the web GUI DOES work. But that doesn't help us since we are trying to migrate everything to a new server.

Re: Error: invalid backup format

Posted: Sun Dec 11, 2016 1:55 pm
by stiadmin
So I did a little bit of manipulation to get SOME progress on this, but still don't have a resolution.

I created a symbolic link in /bin to point to /user/local/vesta/bin/v-restore-user. Then I could run the command without needing the full path in the /backup folder or the /home/backup folder. Now I get a permission denied error when running the command even after I chmod 777 the file and run as root:

Code: Select all

>v-restore-user user user.2016-12-07.tar
Error: permission denied
Does anyone know what can be done to resolve this?

Re: Error: invalid backup format

Posted: Mon Dec 19, 2016 11:01 am
by tjebbeke
As wich user are you running the command? Does the files have the correct permission? Normally you do not have to setup the symbolic link in /bin.

Re: Error: invalid backup format

Posted: Wed Dec 28, 2016 9:30 pm
by twoup
stiadmin wrote: >v-restore-user user user.2016-12-07.tar
Error: permission denied[/code]

Does anyone know what can be done to resolve this?
Ubuntu uses dash as its default shell, whereas the c-* suite of binaries use bash.

Try prefixing the v-restore-user command with bash from within the /backup/ directory, e.g.

Code: Select all

bash v-restore-user user user-2016-12-25.tar
.

You can also update the default shell from dash to bash.The issue is caused by dash interpreting the path to the /backup/ directory as being /backup/backup/.

Re: Error: invalid backup format

Posted: Thu Dec 29, 2016 7:00 pm
by retronoodle
I have this issue too:

Code: Select all

root@cp:~# /usr/local/vesta/bin/v-restore-user dailycha dailychange.2016-12-29.tar
Error: permission denied
Has there been a resolution to this?

Also I should note that this is a new install of VestaCp - thanks!

Re: Error: invalid backup format

Posted: Thu Dec 29, 2016 7:07 pm
by retronoodle
It looks like the error might be coming from here:

v-restore-user:

Code: Select all

# Check backup ownership function
is_backup_available() {
    if ! [[ $2 =~ ^$1.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].tar$ ]]; then
         check_result $E_FORBIDEN "permission denied"
    fi
}

But I'm not clear on what that is checking for. Is it permissions of the backup file?

Thanks!