Restore failed : Missing file to open at WebminCore...

Hi,

I have to retire an old Centos 5 server, and have a fairly large site I have backed up… about 20GB. I have today tried to retore it BOTH on a Centos 7 and Centos 6 VM, but failed both times.

I would get this error:

Restore failed : Missing file to open at WebminCore::…/web-lib-funcs.pl line 3163

This is after a very log wait each time… maybe 15 minutes.

Line 3163 is this:

if (!$main::file_cache_noflush{$f}) {
	no warnings; # XXX Bareword file handles should go away

3163>> &open_tempfile(FLUSHFILE, “>$f”);

The server has about 33GB of free space after the 20 GB file has been download. So I would think it would be enough. So I have no idea were to go with this. Could it be server size? Or something else? It obviously thinks a file is there that is not, as it mentions Missing file.

The log files in var/log/virtualmin are all empty, so I have nothing to go on. So I am posting here!

Thanks,

Steve

I got the site to restore. I ran a few tests on a smaller version of the backup, which allowed me to try it many times. The error would occur right after “Updating administration password and quotas”

Here is my revised code in the web-lib-funcs.pl file:

	no warnings; # XXX Bareword file handles should go away	
	if (length $f > 0){
	&open_tempfile(FLUSHFILE, ">$f");
		foreach my $line (@{$main::file_cache{$f}}) {
			(print FLUSHFILE $line,$eol) ||
				&error(&text("efilewrite", $f, $!));
			}
		&close_tempfile(FLUSHFILE);
		}
	}

I did a print $f on each variable as a test right before &open_tempfile(FLUSHFILE, “>$f”), and discovered that there were empty entries in $f. This must have been in the backup created on the Centos 5 server.

So, when I add the if (length $f > 0){ condition, it skipped any invalid entries, and the server restored OK!

I will do more tests, but all appears OK and the site started. It also appeared to restore without the above changes if I ran the restore a 2nd time on top of itself. But that was not a full restore.

Anyway, as long as nobody sees any dangers with the above, I will keep that mod in place for the time being.

Thanks!

Steve

Howdy,

I’m glad to hear you got it working!

You may want to go into Limits and Validation -> Validate Virtual Server, and run a validation on it.

If that reports that things look okay, and the website and email for that domain work – I think you’ll be in good shape!

-Eric

Hi Eric,

Yes, it passed limits and validation and seems to be running fine.

Do you suggest the above is submitted as a bug/fix/workaround or something? This was tough and who knows what was in this site that was added as a blank entry. I have backed up and restored many sites, and this was the first time it happened. Obviously it is not very common because Google did not show many returns on a query for this. But short of stopping the entry from getting there in the first place, the above is a quick fix.

Steve