Backup Virtual Servers fails with strange " failed to create temporary backup directory" error

On a new Virtualmin GPL install running only cPanel/WHM imported virtual servers our scheduled daily full backup fails with weird errors about directories not existing.

Also, only subdomains suffer from this problem.

The weirdest part is all the other domains backup successfully, and overall the backup says it succeeded, but these subdomains are not backedup, because of this error.

And these subdomains are only used for email, and maybe ftp access. They have no websites.

There is a /home//homes directory on each virtual server home directory, but there is not a /home//domains directory. Is this a bug? Should this directory exist. Should the importer have created it?

Redacted backup output is below.

Creating backup for virtual server sub.domain.com

… failed to create temporary backup directory /home/username/domains/sub.domain.com/.backup : mkdir: cannot create directory `/home/username/domains/sub.domain.com/.backup’: No such file or directory

… completed in 0 seconds

Are ALL imported subdomains affected by this, or only some? If the "“domains” directory under “/home/parentdomain” is missing, and that subdomain is REALLY a sub-server as per Virtualmin’s terminology, something did go wrong during import.

In that case though, the subserver would not work at all, you wouldn’t be able to fetch its contents in a browser, since Virtualmin expects subservers to be living in “/home/parentserver/domains/subserver”.

First you should check if what you call “subdomains” was really imported as a “sub-server” in Virtualmin. The two concepts are different; subdomains as in domain naming scheme do not have to be sub-servers, and vice versa.

I didn’t quite know how to check to see if they’re subservers, but when I list them in virtualmin it lists their home directory as /home/username/domains/domainname. So they are subservers that don’t have a proper home directory. The “domains” directory doesn’t exist in either parent virtual server.

However, In Server Configuration a “Convert to Sub-server” option exists, but their home directories indicate that they already are sub-servers, because their home directories are /home/username/domains/domain.

I clicked the “Convert to Sub-server” option, and actually ran it on one of the domains, but it did not create a directory in /home/username/domains. /home/username/domains still does not exist.

I also listed each domain that has these subdomains sub-servers using Administration Options -> List Sub-Servers, and all of the domains were listed, but their description said “Migrated cPanel sub-domain”, which kinda implies that they are not subservers, but are actually sub-domains.

Also, each one of these subdomains does not have a directory in a domains directory, but each one does have a directory in a “homes” directory that only contains email.

I think cPanel may have listed these as its version of sub-servers, but they only were used for email, so during import their configuration was improrted as a sub-server, but since they only had email no proper domains directory was created for them. For example they all have apache configurations listed for having a public_html directory inside the parents domains directory, but this directory doesn’t exist.

Does that possiblilty fit? What are your ideas on how to fix this?

Thanks,
Dave.

What you’re describing sounds to me like there was a problem during the import from cPanel. If the domains have their home directory set to a sub-server naming scheme, but you get “Convert to sub-server” in the “Move Virtual Server” command, it’s clear that something got mixed up there.

Unfortunately I’m not familiar with importing servers from cPanel, nor with its handling and conversion of sub-domains. The developer team will best take a look at this, since it sounds like a possible bug to me. Eric will hopefully read this, otherwise you might want to open an Issue, declare it as a bug report, and describe the outcome you see and explained here.

I unfortunately don’t know what’s going on there… it does sound like sometime went awry during the import.

Maybe the way cPanel was setup had some sort of unexpected setting, or it may be a bug – either way, you shouldn’t be seeing errors after an import, so we may want to get Jamie to assist with that :slight_smile:

I think go with the suggestion Locutus made, and file a bug report in the Support tracker, where Jamie can work with you to get that straightened out.

And then if it’s a bug of some sort, he’ll apply that to the next Virtualmin version.

Thanks!

-Eric

Bug report created. See link below.

https://virtualmin.com/node/22081

Thanks,
Dave.