Undefined subroutine &server_manager::virtualmin_ui_show_cron_time

I get the following on Ubuntu 10.04 LTS running Cloudmin 4.6 as the master. It itself is running under a controlled and clean kvm session.

The problem occurs when I try to setup Virtualmin replication, when adding a replication configuration, at the bottom of the page under the Replication schedule. With this bug, it's a serious show-stopper as I cannot create a replication schedule of any kind.

Following is the Replication configuration section output of the error:

HTTP/1.0 500 Perl execution failed Server: MiniServ/0.01 Date: Sat, 24 Jul 2010 14:02:32 GMT Content-type: text/html Connection: close

Error - Perl execution failed

Undefined subroutine &server_manager::virtualmin_ui_show_cron_time called at /usr/share/webmin/server-manager/edit_vsync.cgi line 92.

Status: 
Closed (fixed)

Comments

Oh, BTW, this is for Cloudmin for Physical Servers.

By ripping the virtualmin_ui_show_cron_time and virtualmin_ui_parse_cron_time from virtualmin's vui-lib, I was able to get this temporarily working (yes, I made a backup of the original server-manager-lib-funcs.pl just in case), except for one thing.

I ran the replication manually after creating the schedule, and this is the output. The issue's already been reported and resolved, and I figured it out from the other ticket: https://www.virtualmin.com/node/13826

Backing up virtual servers on source system .. .. backup failed : Unknown --virtualmin option. Available options are : config templates email custom scheds chroot

Perhaps some checking to not show incompatible options like that would be a very wise and pleasing approach?

Also to add to it. The cron_chooser.cgi doesn't exist either for the more "advanced" schedules, so that might need to be kept in mind as well. :)

Any information on that function in your vui-lib.pl file?

Basically as a temporary fix, from Virtualmin GPL's vui-lib.pl, I copied the subs for virtualmin_ui_show_cron_time and virtualmin_ui_parse_cron_time into Cloudmin's server-manager-lib-funcs.pl near the end of the code, (and before the final $done_server_manager_lib_funcs = 1;

It's just a straight copy of those subs, nothing more. And it's only a very base minimum band-aid, as the "advanced" schedule editor does not work as there's more to it than just that.

Ok .. but so I can debug this further, would it be possible for you to attach the vui-lib.pl file from your Cloudmin system to this bug report? For some reason it appears to be in-complete..

Wait, I see it now .. it looks like the current Cloudmin 4.6 package is missing that whole vui-lib.pl file.

I will fix this in the next release. Let me know if you'd like to get a pre-release version or patch.

I don't even think it's designed to use the vui-lib.pl at all, the way that in Cloudmin it calls it using &server_manager::subname suggests that anyway.

I didn't just copy vui-lib.pl from virtualmin to cloudmin, I took the subroutines from vui-lib that was being called for in cloudmin, and put them into server-manager-lib-funcs.pl directly.

I can try to just copy the vui-lib.pl from virtualmin into it and see if that resolves that issue.

I'm more than willing to test out anything to get this going good and proper, so patches, temporary fixes before release, I'm all for it. My cloudmin itself is in a virtual machine so if it goes crazy, I can just roll it back to a previous version of the vm.

Yes, there were a couple of other fixes I had to make in addition to adding the missing file.

The quick fix is to save the file attached to this bug as /usr/share/webmin/server-manager/vui-lib.pl , and also edit server-manager-lib-funcs.pl and change line 20 to :

"repl", "scheduled", "dhcp", "failover", "vui") {

then run /etc/webmin/restart

Okay, I have confirmed this works after restoring the original server-manager-lib-funcs.pl and doing the change and putting in the vui-lib.pl.

The simple schedule works as expected. The Complex part however is still not functional due to lack of cron_chooser.cgi.

When copying the virtualmin gpl cron-chooser.cgi over, it depends on virtual-server-lib.pl, so, after copying virtual-server-lib.pl over I finally get:

Undefined subroutine &server_manager::master_admin called at ./virtual-server-lib.pl line 33. Compilation failed in require at /usr/share/webmin/server-manager/cron_chooser.cgi line 5.

I've attached those two missing scripts to this bug report - you can save them in /usr/share/webmin/server-manager as cron_chooser.cgi and cron_select.cgi . You will need to change the first line to :

#!/usr/bin/perl

Okay, this is confirmed to be working as expected now.

Great!

Attached is a replacement for /usr/share/webmin/server-manager/edit_vsync.cgi for the other problem you reported. You will need to adjust the first line to #!/usr/bin/perl , and then select "Virtual server configuration" in the list of features to replicate.

Alright.

With this change and selecting the new option to replicate the virtual server configuration, replication seems to be fully functional. domain2 that wasn't on cweb2 is now present and fully replicated as I'd hoped for.

Great! These fixes will also be in the next Cloudmin release..

Automatically closed -- issue fixed for 2 weeks with no activity.