Can't locate virtualmin-registrar-lib.pl (Chapter 2)

This is a fresh install Debian 9/Virtualmin. Please go to Webmin section then Networking. Click on "Virtualmin Domain Registration" link. I assume you already fixed this page to load its content with this solution: https://www.virtualmin.com/node/64627.

Now click on "List all registered domains" link. The loaded page will show this error message:

Error - Perl execution failed
Can't locate virtualmin-registrar-lib.pl in @INC (@INC contains: /usr/share/webmin /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/webmin/virtualmin-registrar/list.cgi line 9.

File list.cgi exists on server at this location /usr/share/webmin/virtualmin-registrar/list.cgi.

I suggest in line 9 adding a ./ in front of virtualmin-registratar-lib.pl. Here you go:

require './virtualmin-registrar-lib.pl';
Status: 
Fixed (pending)

Comments

WOW. It's been a year from reporting and this bug is still in the latest version.

Ilia's picture
Submitted by Ilia on Fri, 01/10/2020 - 16:27

Hi,

This is odd. I don't see this error on by Debian 9.

What is the output of:

dpkg -l 'webmin-*' |grep webmin-virtualmin-registrar

The output is :

root@server:~# dpkg -l 'webmin-*' |grep webmin-virtualmin-registrar
ii  webmin-virtualmin-registrar 2.5          all          Webmin module for 'Virtualmin Domain Registration'

Debian 10 Buster + Virtualmin latest in a VM for testing without any modification.

The error is now not in list.cgi file. See bellow:

500 - Error - Perl execution failed
Can't locate virtualmin-registrar-lib.pl in @INC (@INC contains: /usr/share/webmin /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/webmin/virtualmin-registrar/index.cgi line 10.

Checking the file system both files index.cgi and virtualmin-registrar-lib.pl are in the same folder. The require tag is pointing to a file into the same directory with index.cgi.

In order to fix this I used the absolute path:

#!/usr/bin/perl
# Show a list of accounts, and a menu to add a new one

use strict;
no strict 'refs';
use warnings;
our (%access, %text);
our @registrar_types;

require '/usr/share/webmin/virtualmin-registrar/virtualmin-registrar-lib.pl';

if (!$access{'registrar'}) {

... or if you don't like the full path to the required file you can use this fix too:

#!/usr/bin/perl
# Show a list of accounts, and a menu to add a new one

use strict;
no strict 'refs';
use warnings;
our (%access, %text);
our @registrar_types;

require './virtualmin-registrar-lib.pl';

if (!$access{'registrar'}) {

Also list.cgi should have the same fix require './virtualmin-registrar-lib.pl';

Ilia's picture
Submitted by Ilia on Sat, 01/11/2020 - 06:53

Assigned: Unassigned »
Status: Active » Fixed (pending)

Joe, the package for it, has to be updated and pushed to our repos.