Restore Backup - flush_file_lines for Apache configs

Hi,

I just created a new VPS, where I’m trying to restore my virtual servers.

I started out by using CentOS, but I thought there was some issues with Apache, soi swapped it out with Debian 10 - just to be sure that everything was as expected.

But, after trying to restore one of my domains, it failed after the same step.

It’s failing after:

Checking restored PHP execution mode ..
.. mode FCGId OK for this system

The error is:

Restore failed : flush_file_lines called on non-loaded file /etc/apache2/sites-available/mydomain.com.conf

(In CentOS, it just reported problem with the primary /etc/httpd/conf.d/httpd.conf file, instead)

Here’s the CALL STACK TRACE:

FILE	LINE	FUNCTION
/usr/share/webmin/web-lib-funcs.pl	3540	WebminCore::error
/usr/share/webmin/virtual-server/feature-web.pl	1710	WebminCore::flush_file_lines
/usr/share/webmin/virtual-server/backups-lib.pl	2829	virtual_server::restore_web
/usr/share/webmin/virtual-server/restore.cgi	355	virtual_server::restore_domains
(eval 76)	6	(eval)
/usr/share/webmin/miniserv.pl	2552	(eval)
/usr/share/webmin/miniserv.pl	1000	miniserv::handle_request

I’ve tried to look in the code-base, but I’m not really sure what to look for: webmin/web-lib-funcs.pl at 35108b2ba4a156ee17dec8a7eaef2728f1f180f2 · webmin/webmin · GitHub

After the error has shown, the restore-process stops.

However, the /etc/apache2/sites-available/mydomain.com.conf file are created, if I take a look on the server.

It’s working fine with one domain

I’ve tried all the other virtual servers too, but they’re failing - except one.

According to the restore view, here’s the listed restored settings for the working - and failing one.

Here’s the one working just fine:


Virtual server password, description and other details
Administration user's password, quota and Cron jobs
Mail/FTP users and mail aliases
Apache webserver configuration
Webalizer configuration and schedule
Logrotate configuration for log file
Contents of server's MariaDB databases
Spam filtering
Webmin ACL files
Server's home directory and web pages
AWstats configuration file
DAV users file

And here’s an example of the pack if a failing restore:

Virtual server password, description and other details
Administration user's password, quota and Cron jobs
Mail/FTP users and mail aliases
Apache webserver configuration
Webalizer configuration and schedule
Apache SSL webserver configuration and certificate
Logrotate configuration for log file
Contents of server's MariaDB databases
Spam filtering
Webmin ACL files
Server's home directory and web pages
AWstats configuration file

The only thing I can spot, is the Apache SSL webserver configuration and certificate in the broken one, and DAV users file in the one working.

My bet it that it’s related to SSL… But… How?

Operating system: Debian 10, fully up-to-date fresh installed including Virtualmin, installed with the recommended script. Installed with no issues.

By running this, no errors shows up:

So, i rolled back my server, and started over - once again.

Finding:
By running a restore-job, where I’ve selected the “Restore all features”-option, it’s failing like we’ve seen a few times.

But… Hereafter, I can go back, and run this:

The restore-job shows no errors at all, this time.

What the… are causing that kind of error? It is related to the Apache webserver configuration-file, and if yes, how can I figure out what’s going on?

(For my own knowledge, but also, if something should be changed in the restore-solution)

After a few changes, I decided to disable the BIND DNS-feature (cause I won’t use it, right now).

I tried to save the changes, and now it’s reporting:

AH00526: Syntax error on line 93 of /etc/apache2/sites-enabled/mydomain.com.conf:
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

However… It doesn’t look like that the common reason, why it’s failing. Cause I have another domain, which are throwing the same error - and there’s no php_admin_value in the config-file.

If you apply this patch and restart Webmin with /etc/webmin/restart command, will it help?

I’ve already imported all, with the work-around.

But give me 5 minutes. I’ll dump the current state, and restore to a fresh instance and include your suggestion.

One moment, and I’ll get back :+1:

image

1 Like

Result - It’s working :partying_face:

image

Yes, it worked :slight_smile: Thanks!

I found one other problem, but that’s just caused of one hack I’ve done with one of my sub-domains (and not related to this).



Extra question

I’m not sure why the php_admin_value are in my option-files. Maybe that’s some legacy things?

I’ve removed the value from 7 of my .conf files now, so Virtualmin stops complaining about it.

php_admin_value engine Off in the config-files gives me:

AH00526: Syntax error on line 106 of /etc/apache2/sites-enabled/domainname.com.conf:
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.



Extra input

I imported one VM, where the quota was more than the allowed. I must have done something odd on the old instance, cause no complains was shown on the old env. Or… Maybe quota wasn’t implemented. (I unable to confirm that, cause the VM’s is burned up above the clouds… Yep… I’m one of the OVH-customers.)

But…

The import failed each time. It imported 1.3GB of data, where only 1GB was allowed.

DAV users file and more, couldn’t simply be imported, due to the quota was passed. But… Shouldn’t that be ignored, or at least, handled before the public_html file-import, to prevent this kind of annoying things? :slight_smile:

I’m not sure if the best thing is to have a “Ignore quota while restoring”-option, of if it’s better to change the order of each step, to get DAV users file and more imported, before the content of public_html (and so)…

I fixed my situation by importing half of the configs~ including the home-folder, changed the quote, and imported the last few pieces hereafter :slight_smile: .

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.