collectinfo.pl Undefined subroutine &virtual_server::collect_system_info

After installing virtualmin on CentOS 5.4 based on the howto on this page the collectinfo.pl cron job reported the error in $subject. After checking /usr/libexec/webmin/virtual-server dir i had to add a require './collect-lib.pl' right after the other require. Now it works.

Status: 
Closed (fixed)

Comments

What is the full path to the collectinfo.pl cron job that is failing? It sounds like it might be run with the wrong path.

Also, what is the exact error message you are getting related to $subject ?

Hi!

The exact error message: Undefined subroutine &virtual_server::collect_system_info called at /usr/libexec/webmin/virtual-server/collectinfo.pl line 25.

The cron job runs /etc/webmin/virtual-server/collectinfo.pl

This was exactly done: totally clean CentOS5 with that script. Virtualmin version: 3.76.gpl; Webmin version: 1.500

If you look at the file /usr/libexec/webmin/virtual-server/collect-lib.pl , is there a line like sub collect_system_info at the top?

Yes, the subroutine is there. The problem is that the require was missing from /usr/libexec/webmin/virtual-server/collectinfo.pl.

That require shouldn't be needed though, as collectinfo.pl already require's virtual-server-lib.pl, which in turn requires virtual-server-lib-funcs.pl and then collect-lib.pl.

After your fix, is everything else working OK?

Well, i can't see anywhere else mentioning that lib. But after adding that line it works.

So does the rest of Virtualmin work OK? I'm concerned that this fix may be just working around a deeper issue..

I don't really know what happened, but after reinstalling the opsys + virtualmin the problem did not came. The issue can be closed.