Page 1 of 1

Issue Found - Unable To Login! (Fix Included)

Posted: Fri Oct 24, 2014 6:16 am
by marijuanatech
Hey Vesta! Love your product, but this bug I'm having is a little strange!

Login as admin fails - no error message is displayed. However, it says "incorrect password" if I enter the wrong password. I've reset the password through the web interface and through the /usr/local/vesta/bin command.

I check the logs...

FastCGI sent in stderr: "PHP message: PHP Warning: Invalid argument supplied for foreach() in /usr/local/vesta/web/login/index.php on line 33 ...

I checked line 33, and it looks like the issue is with it not being able to json decode the results of the "v-list-sys-config json"

I ran the results of the v-list-sys-config json command through a json validator and compared to the results off another (working) server. The bad bit seems to be a comma after FIREWALL_SYSTEM.

NON WORKING SERVER

Code: Select all

....
                "FIREWALL_SYSTEM": "iptables",

WORKING SERVER

Code: Select all

....
                "FIREWALL_SYSTEM": "iptables"
I was able to fix this issue by changing lines 30-35 to the following: The fix was adding a str_replace before the json_decode.

Code: Select all

// Check system configuration
exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var);
// add in a str_replace to remove the infringing comma from the json output!
$data = json_decode(str_replace('"FIREWALL_SYSTEM": "iptables",', '"FIREWALL_SYSTEM": "iptables"', implode('', $output)), true);
$sys_arr = $data['config'];
foreach ($sys_arr as $key => $value) {
    $_SESSION[$key] = $value;
}

Re: Issue Found - Unable To Login! (Fix Included)

Posted: Wed May 27, 2015 2:34 pm
by skurudo
This error can be from broken sudo:
viewtopic.php?f=10&t=8349&p=27113#p27113