Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use a hash as a reference at /usr/local/webmin/authentic-theme/session_login.cgi line 188 #274

Closed
sdelgran opened this issue Oct 21, 2015 · 19 comments

Comments

@sdelgran
Copy link

First: Thank you so much for an awesome theme! Excellent work. I have been using it since your first release...

Version 17 gives me an error at login on an Archlinux ARM box (Webmin installed as generic Linux). It works correctly after I install the theme but once the server has been restarted, I get this message, as I try to connect to Webmin:

Can't use a hash as a reference at /usr/local/webmin/authentic-theme/session_login.cgi line 188
@sdelgran
Copy link
Author

Should have said also: Using Perl 5.22.

I found this in some reference material which might be of interest:

 Versions of perl
    <= 5.22.0 used to allow this syntax, but shouldn't have.  This was deprecated in perl 5.6.1.

@sdelgran
Copy link
Author

In the meantime and if someone needs a work-around until you get a chance to look at it, removing the password recovery group does the trick:

print '<div class="form-group">';
if ( -r $root_directory . "/virtualmin-password-recovery/index.cgi"
    && index( %miniserv->{'anonymous'}, 'virtualmin-password-recovery' )
    > -1 )
{
    print
         '<button onclick=\'window.open("/virtualmin-password-recovery", $
        . &text('login_reset')
        . '</button>' . "\n";
}
else {
    print
        '<button class="btn btn-danger pull-left" type="reset"><i class=$
        . &text('login_reset')
        . '</button>' . "\n";
}

@iliajie
Copy link
Collaborator

iliajie commented Oct 21, 2015

Can you please replace in that file:

%miniserv->{'anonymous'}

with

$miniserv{'anonymous'}

Is this alright now?

@sdelgran
Copy link
Author

Absolutely! It works fine. Thank you so much.

@iliajie
Copy link
Collaborator

iliajie commented Oct 21, 2015

You're welcome. It will be fixed in 17.01.

@iliajie iliajie closed this as completed Oct 21, 2015
@Stealch
Copy link

Stealch commented Jun 29, 2018

Hi! I have same problem with vboxctrl module for webmin. The module is very old and without support since 2011...
Error - Perl execution failed Can't use a hash as a reference at vboxctrl-lib.pl line 479. Compilation failed in require at /usr/share/webmin/vboxctrl/index.cgi line 5.
How i can make this module work?

@iliajie
Copy link
Collaborator

iliajie commented Jun 29, 2018

Can you show what is on line 5 of that file?

What is your Webmin version? What is your server OS?

@Stealch
Copy link

Stealch commented Jun 29, 2018

Line 5:
require 'vboxctrl-lib.pl';
OS: Ubuntu 16.04 amd64
Webmin always latest version -

1.881

@iliajie
Copy link
Collaborator

iliajie commented Jun 29, 2018

Okay, my bad, what is on the line 479 in that required file?

@Stealch
Copy link

Stealch commented Jun 29, 2018

`
sub GetHDDsFromVM_
{
my @USEDHDDS;
my ($USER, $VM) = @_;

    # collect all HDDs, return: ($USER:$VM:$FILE)
    my %HDDS = ListHDDS();

    foreach my $UUID(sort keys %HDDS)
            {
            if ($UUID =~ /^$USER\:/i)
                    {
                    #print "KEY: $UUID<br>";
                    #print "=> ".%HDDS->{$UUID}->{'State'}."<br>";
                    #print "=> ".%HDDS->{$UUID}->{'UUID'}."<br>";
                    #print "=> ".%HDDS->{$UUID}->{'Usage'}."<br>";

                    my $HDUUID = %HDDS->{$UUID}->{'UUID'};
                    my $USAGE = %HDDS->{$UUID}->{'Usage'};
                    #print "VM: '$VM' UUID: '$UUID' HDUUID: '$HDUUID' USAGE: '$USAGE'<br>";
                    #print "index('$USAGE','$VM'): ".index ($USAGE,$VM)."<br>";
                    if ($USAGE =~ /^$VM /i)
                            {
                            #print "<b> '$USAGE' '$VM' '$HDUUID'</b><br>";
                            my %HDINFO = GetHDInfo($USER,$HDUUID);
                            push (@USEDHDDS , \%HDINFO);
                            }
                    }
            }
    return @USEDHDDS;
    } `

the 479 string is my $HDUUID = %HDDS->{$UUID}->{'UUID'};

@iliajie
Copy link
Collaborator

iliajie commented Jun 29, 2018

Try changing it to:

my $HDUUID = $HDDS->{$UUID}->{'UUID'};

@Stealch
Copy link

Stealch commented Jun 29, 2018

I change %HDDS to $HDDS in lines 479 and 480 - module started succesfully, but it not see any VMs which are created on host.

@iliajie
Copy link
Collaborator

iliajie commented Jun 29, 2018

What do you see in /var/webmin log files related to your module?

@Stealch
Copy link

Stealch commented Jun 29, 2018

Nothing, except reports of saving module config (i'm enable debug mode).

@iliajie
Copy link
Collaborator

iliajie commented Jun 29, 2018

I have no idea what this module does and how it works.

You'd better write the original author.

You could also check browser's console for errors.

@Stealch
Copy link

Stealch commented Jun 29, 2018

You'd better write the original author.

Unfortunally that is impossible - they are stoped support since 2011 year (wrote "because we switch to VMWare")... i need just some functions - start, stop, status. But my coding skill is zero or even -1 =))
Thank you, i will try to start topics on ubuntu forum and webmin forum, may be there i will find working solution, even if the solution will be a "crutch".

@iliajie
Copy link
Collaborator

iliajie commented Jun 29, 2018

Just upload the module you use here. Does it have dependent software to work with? I will take a quick look a bit later. I can't promise that I will invest much time fixing but if it's possible to make it work quickly, I will.

@Stealch
Copy link

Stealch commented Jun 29, 2018

https://sourceforge.net/projects/webmin/files/VboxCtrl/V4.1.0.a/vboxmanagerv410a.wbm.gz/download

depends: webmin, perl, libswitch-perl
to test need virtualbox installed with extension pack

@iliajie
Copy link
Collaborator

iliajie commented Jun 29, 2018

I quickly read through the comments and here is want I found:

I really wanted to give this a good rating because there has been a long time a lacking of a Virtualbox management module for Webmin. Although this concept and the idea are fantastic, the support for the module falls short. The fact that it supports only CentOS or variants of Linux like CentOS is really a real disappointment. 

I think it just wasn't tested on Ubuntu. I can not right now invest time into its support.

https://sourceforge.net/projects/webmin/reviews?source=navbar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants