Undefined subroutine &virtual_server::init_config

20 posts / 0 new
Last post
#1 Tue, 07/08/2008 - 04:13
Murz

Undefined subroutine &virtual_server::init_config

After upgrade perl version from Debian 4.0 (perl v5.8.8) to Debian 5.0 (perl v5.10.0) I see this error in the many Virtualmin pages: [code:1]require virtual-server/virtual-server-lib.pl failed : Undefined subroutine &virtual_server::init_config called at /usr/share/webmin/virtual-server/virtual-server-lib.pl line 5.[/code:1]

This error shows on pages: Server Configuration (Edit Virtual Server, Change Domain Name, etc), Administration Options and Disable and Delete.

Other pages works good.

Anybody else see this error? Does this error depends on updated perl version or on something else? How can I fix it?

Tue, 07/08/2008 - 05:06
Murz

Another modules, that use function init_config() from webmin works normally, for example Firewall module:
/firewall/firewall-lib.pl starts with this code:
[code:1]# firewall-lib.pl
# Functions for parsing iptables-save format files
# - help pages

do '../web-lib.pl';
&init_config();
do '../ui-lib.pl';
[/code:1]
Same as in virtual-server/virtual-server-lib.pl
[code:1]# virtual-server-lib.pl
# Common functions for Virtualmin

do '../web-lib.pl';
&init_config();
do '../ui-lib.pl';[/code:1]<br><br>Post edited by: Murz, at: 2008/07/08 05:08

Tue, 07/08/2008 - 05:21 (Reply to #2)
Murz

When I remove both virtualmin-htpasswd and virtualmin-mailman modules, virtual-server module goes to work without errors! And when I installs back any of this two modules, I see this error again.

Sun, 09/14/2008 - 06:37 (Reply to #3)
Joe
Joe's picture

If someone who is seeing this problem could provide me with remote root SSH access to their system, I should be able to debug it pretty quickly. Unfortunately, this is one of those annoying bugs that doesn't happen on any of our test boxes :-(

My email is jcameron@virtualmin.com

--

Check out the forum guidelines!

Sun, 09/14/2008 - 10:17 (Reply to #4)
joes

In case you read this first, I emailed you IP and passwords for SSH access to the machine described in the previous posting.

Mon, 09/15/2008 - 11:26 (Reply to #5)
joes

Virtual server is still available for debugging.

Off Topic Question:
Why do I keep getting double posts in this forum? I post to many forums and this is the only one that often doubles my post.

Also, can someone work on the forum edit feature please?

Sun, 06/07/2009 - 07:29 (Reply to #6)
Joe
Joe's picture

Thanks for the login - I found the problem, which was Virtualmin code that no longer worked under Perl 5.10. Fortunately this code is no longer needed, and so can be safely removed.

Just edit the file /usr/share/webmin/virtual-server/virtual-server-lib.pl, and remove lines 68 - 73, which contain :

[pre]
$original_hlink = $main::{'hlink'} ||
$virtual_server::{'hlink'} ||
$gpl_virtual_server::{'hlink'};
$main::{'hlink'} = \&checked_hlink;
$virtual_server::{'hlink'} = \&checked_hlink;
$gpl_virtual_server::{'hlink'} = \&checked_hlink;
[/pre]

--

Check out the forum guidelines!

Wed, 08/20/2008 - 00:54
212801

I've got the same problem. After installing the mailman module I also got this error. Does anybody have an idea how to fix it, so the mailman module can be used?

Thanks

Wed, 08/20/2008 - 02:41
charlie

same for virtualmin-svn and debian 5

Wed, 08/20/2008 - 06:00 (Reply to #9)
andreychek

Well, if you guys don't get any thoughts here on what the problem might be -- it sounds a bit "bug-like" as Joe likes to say, I might recommend filing a bug report.

Prior to doing that, I would make sure you don't have more than one copy of Webmin running (ps auxw|grep miniserv|grep webmin) -- that can cause issues like you're describing.
-Eric

Wed, 08/20/2008 - 10:59 (Reply to #10)
Joe
Joe's picture

The only time I've ever seen this error was with an SVN checkout that I didn't run the perl path correction on (and didn't have perl in the place the shebang line at the top of the lib was expecting). Which shouldn't be relevant to any install from deb or wbm package...unless the post install script failed to run for some reason.

How did you install the modules? Were there errors during installation of the modules?

I suspect always using the same install type for all modules will reduce the chances of anything going wrong during installation of other modules. For example, always use deb packages for installation of Webmin and the various modules on Debian/Ubuntu systems (we provide apt repositories), and RPM packages on Red Hat based systems (we provide yum repositories, too). But, if you installed Webmin using the tarball, you'll obviously need to use wbm packages.

So, this could very well be a bug in the installation process, or something else entirely.

What is the shebang line in some of the effected files? (e.g. the "#!/usr/..." line at the top of several of the files in the module directory) And what is the shebang of miniserv.pl in the Webmin executable directory? And, finally, what is in the perl-path file in /etc/webmin. I suspect one of those is confused somehow.

Oh, yeah, I can imagine one more scenario that could probably cause this issue:

You upgraded the system Perl and didn't restart Webmin afterward.

--

Check out the forum guidelines!

Wed, 08/20/2008 - 11:01 (Reply to #11)
Joe
Joe's picture

Oh, and after scanning this thread again, I want to clarify that Perl version doesn't matter to Webmin. It is compatible all the way back to 5.6 (and maybe even 5.005_4), and Virtualmin is compatible all the way back to 5.8.1, at least, and we historically target 5.6. Perl backward compatibility is very nearly flawless, so having a newer version does not matter.

--

Check out the forum guidelines!

Mon, 08/25/2008 - 00:16
Minase

i do have the same problem

require virtual-server/virtual-server-lib.pl failed :

Undefined subroutine &virtual_server::init_config called at /var/webmin/webmin-1.430/virtual-server/virtual-server-lib.pl line 5.

and i did not do nothing wrong,it just pooped out of nowhere (after perl upgrade + some plugins installed for perl)
restarted webmin even the box and the same thing

Wed, 09/10/2008 - 03:16
Murz

This bug is present in new version of Virtualmin 3.61 too.
System is Debian Lenny AMD64
I have already installed 3.60 version (installed on fresh Debian system with install script as in manuals) and update it to 3.61 with Virtialmin update interface.

Wed, 09/10/2008 - 11:41 (Reply to #14)
Joe
Joe's picture

You guys aren't providing answers to the questions I asked. I can't help you without further information...I don't see this problem on my test systems...so I don't know what's happening on yours.

--

Check out the forum guidelines!

Sat, 09/13/2008 - 15:26
joes

Same problem after upgrading debian

>>How did you install the modules? Installed on etch from install.sh also tried from tar and wbm. Both successful in etch.

>>Were there errors during installation of the modules? No, not in either install mode. No errors during apt-get dist-upgrade to lenny/sid either.

>>I suspect always using the same install type for all modules will reduce the chances of anything going wrong
Did use the same method and everything works fine in etch before upgrade.
These are fresh installs for virtualmin use only. Installed on a virtual client built using a minimal etch install as the base.

After the lenny/sid upgrade:

Linux version 2.6.26-1-amd64 (Debian 2.6.26-5) (waldi@debian.org) (gcc version 4.1.3 20080623 (prerelease) (Debian 4.1.2-23))
#1 SMP Wed Sep 10 15:31:12 UTC 2008

Debian GNU/Linux lenny/sid

BASH_VERSION='3.2.39(1)-release'

This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi

ii webmin-virtual-server 3.61.gpl Webmin module for 'Virtualmin Virtual Server
ii webmin-virtual-server-theme 6.1 Webmin theme 'Virtualmin Framed Theme'
ii webmin-virtualmin-awstats 3.8 Webmin module for 'AWstats Reporting'
ii webmin-virtualmin-dav 2.8 Webmin module for 'Virtualmin DAV'
ii webmin-virtualmin-htpasswd 1.7 Webmin module for 'Virtualmin Protected Dire
ii webmin-virtualmin-mailman 5.1 Webmin module for 'Virtualmin Mailman Mailin
ii webmin-virtualmin-svn 3.6 Webmin module for 'Virtualmin Subversion Rep

###:/usr/share/webmin/virtual-server# more check-config.pl
#!/usr/bin/perl

###:/usr/share/webmin/virtual-server# more check.cgi
#!/usr/bin/perl
# check.cgi

###:/usr/share/webmin/virtual-server# more edit_newfeatures.cgi
#!/usr/bin/perl

###:/usr/share/webmin# more perlpath.pl
#!/usr/bin/perl
# perlpath.pl

###:/usr/share/webmin# more miniserv.pl
#!/usr/bin/perl

###:/etc/webmin# more perl-path
/usr/bin/perl

Everything still appears to point to /usr/bin/perl and all other perl packages and the rest of webmin appear to work properly.

Restarted webmin and restarted server. Tried multiple installations

###:/var/webmin# tail miniserv.log
[13/Sep/2008:11:24:24 -0700] "GET /virtual-server/edit_newfeatures.cgi HTTP/1.1" 200 2107
[13/Sep/2008:11:25:08 -0700] "GET /virtual-server/check.cgi HTTP/1.1" 200 2023

###:/var/webmin# tail miniserv.error
Error: require virtual-server/virtual-server-lib.pl failed : <pre>Undefined subroutine &virtual_server::init_config called at /usr/share/webmin/virtual-server/virtual-server-lib.pl line 5.
</pre>
Error: require virtual-server/virtual-server-lib.pl failed : <pre>Undefined subroutine &virtual_server::init_config called at /usr/share/webmin/virtual-server/virtual-server-lib.pl line 5.
</pre>
***repeats once per request, only error present in miniserv.error
no errors in /var/log messages or syslog, for webmin/virtualmin or any other app running.

Mysql, apache, subversion, postgresql, bind, sshd, postfix and all other packagages appear to work normally after upgrade.

## To reproduce error ##
Download debian iso
http://cdimage.debian.org/debian-cd/4.0_r4a/amd64/iso-cd/debian-40r4a-am...

Install debian-40r4a-amd64-businesscard.iso to virtual machine with 2gb disk and 512mb ram.

Choose default options, guided entire disk, deselect all packages except for dns server.

Reboot to complete install

apt-get update, apt-get dist-upgrade - to bring everything up to date.

Download virtualmin install.sh and install virtualmin
install will error out on dependencies, run apt-get -f install and re-run install.sh
the third time the virtualmin install.sh should complete successfully

login to webmin from browser
networking - network configuration - set static ip address, gateway, dns and hostname/domain

run virtualmin check-config
will error on "no mysql root password"

use webmin - servers - mysql - to set the mysql root password

run virtualmin check-config
will be successful

create virtual host and test web,db,subversion and mail
successful

edit /etc/apt/sources.list change etch to sid
apt-get update
apt-get dist-upgrade

test virtual host web,db,subversion and mail
successful

access webmin from browser, all modules work except for some virtualmin modules
Undefined subroutine &virtual_server::init_config

*** Error display from browser accessing check.cgi ***
Checking Configuration

The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active ..

BIND DNS server is installed, and the system is configured to use it.

Mail server Postfix is installed and configured.

Apache is installed.

Webalizer is installed.

Apache is configured to host SSL websites.

MySQL is installed and running.

ProFTPd is installed.

Logrotate is installed.

SpamAssassin and Procmail are installed and configured for use.

ClamAV is installed and assumed to be running.

require virtual-server/virtual-server-lib.pl failed :

Undefined subroutine &virtual_server::init_config called at /usr/share/webmin/virtual-server/virtual-server-lib.pl line 5.

*** Error display from browser accessing check.cgi ***

Features and Plugins

This page allows you to select the core features and plugins that are available for use by virtual servers. The checkbox in the first column determines if it is available at all, while the box in the Default column controls whether or not it is enabled by default.

require virtual-server/virtual-server-lib.pl failed :

Undefined subroutine &virtual_server::init_config called at /usr/share/webmin/virtual-server/virtual-server-lib.pl line 5.

<- Return to previous page

Sat, 09/13/2008 - 15:30
joes

This forum woulnd't let me edit the previous entry.

The last page error was for edit_newfeatures.cgi.

Features and Plugins

This page allows you to select the core features and plugins that are available for use by virtual servers. The checkbox in the first column determines if it is available at all, while the box in the Default column controls whether or not it is enabled by default.

require virtual-server/virtual-server-lib.pl failed :

Undefined subroutine &virtual_server::init_config called at /usr/share/webmin/virtual-server/virtual-server-lib.pl line 5.

<- Return to previous page

Sat, 09/13/2008 - 18:14 (Reply to #17)
joes

Datapoint:
Just did an upgrade to lenny from the backup of the initial etch install.
Same results
upgrade goes smooth
apps including webmin still work
some virtualmin pages have error

require virtual-server/virtual-server-lib.pl failed :
Undefined subroutine &virtual_server::init_config called at /usr/share/webmin/virtual-server/virtual-server-lib.pl line 5.

I can post specific versions of anything if needed.

Sat, 09/13/2008 - 21:49 (Reply to #18)
joes

I tried another upgrade from etch to sid by hand this time using dpkg.

Upgrade everything except perl and anthing that depends on perl upgrade.
Virtualmin still works.

installing minimal amount of perl upgrade
perl_5.10.0-14_amd64.deb
perl-base_5.10.0-14_amd64.deb
perl-modules_5.10.0-14_all.deb

this breaks webmin, broken dependencies
install
libnet-ssleay-perl_1.35-1_amd64.deb
libauthen-pam-perl_0.16-1.1+b1_amd64.deb

Now webmin works again.
Virtualmin is broken at this point, one of the packages below breaks virtualmin on my system.
perl_5.10.0-14_amd64.deb
perl-base_5.10.0-14_amd64.deb
perl-modules_5.10.0-14_all.deb
libnet-ssleay-perl_1.35-1_amd64.deb
libauthen-pam-perl_0.16-1.1+b1_amd64.deb

These are the only packages left to upgrade on system-
libcompress-zlib-perl: Depends: perlapi-5.8.8
libcrypt-ssleay-perl: Depends: perlapi-5.8.8
libdbd-mysql-perl: Depends: perlapi-5.8.8
libdbd-pg-perl: Depends: perlapi-5.8.8
libdbi-perl: Depends: perlapi-5.8.4
libdigest-sha1-perl: Depends: perlapi-5.8.8
libhtml-parser-perl: Depends: perlapi-5.8.8
libio-pty-perl: Depends: perlapi-5.8.8
liblocale-gettext-perl: PreDepends: perlapi-5.8.8
libpg-perl: Depends: perlapi-5.8.8
librrds-perl: Depends: perlapi-5.8.8
libsocket6-perl: Depends: perlapi-5.8.8
libtext-charwidth-perl: Depends: perlapi-5.8.8
libtext-iconv-perl: Depends: perlapi-5.8.8
libxml-libxml-common-perl: Depends: perlapi-5.8.8
libxml-libxml-perl: Depends: perlapi-5.8.8

Upgrading the rest of the packages makes no difference.
Mysql, apache, postfix, ssh all appear to be working.
Webmin works
Portions of Virtualmin are broken with "Undefined subroutine &virtual_server::init_config" error.

Thu, 09/18/2008 - 02:36
Murz

Lastest patch works good for me on Debian Lenny with php 5.10.

Topic locked