Run into "virtual-server/postinstall.pl failed" error when updating Virtualmin on Debian

Hello there,

I run into an error when updating Virtualmin on several (not all) Debian systems.

It concerns the latest version, I make all my updates in command line: "apt-get update && apt-get dist-upgrade".

It happens on Debian 6 (yes, I know...), 7 and 8.

Here is the error :

The following packages will be upgraded: webmin-virtual-server 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 1 634 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? Get:1 http://software.virtualmin.com/gpl/debian/ virtualmin-universal/main webmin-virtual-server all 5.05.gpl [1 634 kB] Fetched 1 634 kB in 1s (1 246 kB/s) (Reading database ... 102785 files and directories currently installed.) Preparing to replace webmin-virtual-server 5.04.gpl (using .../webmin-virtual-server_5.05.gpl_all.deb) ... Unpacking replacement webmin-virtual-server ... Setting up webmin-virtual-server (5.05.gpl) ...

virtual-server/postinstall.pl failed : virtual-server::module_install failed : Failed to copy /etc/php5/apache2/php.ini to /home/domain/domains/domain.com/etc/php5/php.ini : cp: cannot create regular file `/home/domain/domains/domain.com/etc/php5/php.ini': No such file or directory

Is that harmless ?

All the best! Nico

Status: 
Closed (fixed)

Comments

Howdy -- hmm, it looks like it's having trouble copying the php.ini file into the etc dir of one of your domains. It looks like the directory may not exist.

What is the output of these commands:

ls -ld /home/domain/domains/domain.com
ls -ld /home/domain/domains/domain.com/etc
ls -ld /home/domain/domains/domain.com/etc/php5

You'd need to ensure that all those directories exist.

This is a bug in Virtualmin - it shouldn't be trying to generate missing php.ini files for alias domains. However, it's harmless and can be ignored.

We will fix it in the next release though.

Status: Active » Fixed

Hi Jamie,

We have tested the following fix but it didn't work,

In virtual-server-lib-funcs.pl on line 14032:

foreach my $d (grep { &domain_has_website($_)  &&  !$_->{'alias'}}
                                    &list_domains()) {
                        &save_domain_php_mode($d, &get_domain_php_mode($d));
                        &clear_links_cache($d);
                        }
                $config{'last_check_php_vers'} = join(" ", @newvernums);
                }

the change is :

from foreach my $d (grep { &domain_has_website($_)}
to foreach my $d (grep { &domain_has_website($_)  &&  !$_->{'alias'}}

Unfortunately the error come up when you try virtualmin Re-Check Configuration also. And because of that if you add new PHP version it can't be added to virtualmin and used.

So Jamie can you please post here the fix because we need to add new PHP version and with that error it won't get added to virtualmin configuration. Thanks in advance.

That should do it - but make sure you run /etc/webmin/restart after making this code change to apply it properly.

Hi Jamie,

I made a service webmin restart but it didn't help. The error was the same.

Hmm, what is the output of this command:

ps auxw | grep miniserv

Which PHP execution mode is the top-level domain using?

Hi Jamie ana Andreychek.

So there ware two issues. After Jamie mention the php execution mode. I use the console command: virtualmin modify-web --all-domains --mode fcgid to update all domain's php execution mode and with the fix the recheck went trough, slow but pass.

Hi again,

As I understand this recheck configuration try to regenerate all php.ini files for all domains. Why is that when if you try to change the php version for a website virtualmin automatically regenerate all php.ini files (if some does not exist) for this website. This regeneration will take more than an hour to regenerate php.ini files for a server with more than 1000 websites.

It doesn't re-generate all the files - just creates missing ones.

this is still a problem .... PHP versions have changed to 5, 7.0 since last check. Regenerating any missing php.ini files.

Failed to copy /etc/php5/apache2/php.ini to /home//domains/****/etc/php5/php.ini : cp: cannot create regular file ‘/home//domains/***/etc/php5/php.ini’: No such file or directory

Webmin version 1.831 Virtualmin version 5.05

deleted all alias, ran the Re-check configuration, success and then readded the alias, now i can run the re-check without problems.

Glad to hear that worked for you!

We haven't actually released a new Virtualmin version yet, though I think we're going to be doing that fairly soon now due to the number of pending bug fixes that are in it.