New Server: Login Key Incorrect

I just set up a brand new Squiz Matrix Server on Debian Squeeze. The install was a breeze, but when I try to login, I get the error:

    Login Key incorrect


Right now I am just using the IP address, and everything seems to be fine. I am running on the new 4.4.0 version and trying to login with the default root/root.

Ideas?

Strange, it lets me login using Firefox, but not Safari.


Why would one browser have an issue and another not?

[quote]
Strange, it lets me login using Firefox, but not Safari.



Why would one browser have an issue and another not?

[/quote]



The issue is when you first download the VMWare Image for Squiz Matrix its configured to be using the hostname 'matrixdemo.squiz.net'. So when you access over the IP address only, it gives you a Login Key Incorrect warning and won't let you login because it is expecting you to be accessing over the domain name. You are right that Safari breaks but Firefox doesn't - but it appears to be a cookie storing issue (i think). You can see the loading issue clearly in the Safari Activity window - which will show the '_admin' login page trying to load content from 'matrixdemo.squiz.net' even though you are accessing over the IP.



Set your local hosts file following the Squiz quick start guide (http://matrix.squizsuite.net/quick-start-guide/) and you'l be on your way. You can tell if its working correctly if you get the styled login box instead of just black text on a white background.

[quote]
The issue is when you first download the VMWare Image for Squiz Matrix its configured to be using the hostname 'matrixdemo.squiz.net'

[/quote]



Hmm, I am not using the VM. I checked out 4.4.0 from the checkout.sh script and installed everything manually. This is strange, I have always used an ip address on past servers and things worked fine. I still don't get why it works in FF.

[quote]
Hmm, I am not using the VM. I checked out 4.4.0 from the checkout.sh script and installed everything manually. This is strange, I have always used an ip address on past servers and things worked fine. I still don't get why it works in FF.

[/quote]



Usually, the incorrect login key is when a server address does not match a system root address in the system configuration screen. Is the IP address list as a system root address? Although, it is strange how it works in one browser and not the other. I don't think there would be anything on the browser level interring with the login.

[quote]
Usually, the incorrect login key is when a server address does not match a system root address in the system configuration screen. Is the IP address list as a system root address? Although, it is strange how it works in one browser and not the other. I don't think there would be anything on the browser level interring with the login.

[/quote]



Yes, the IP is added as a system root address. The strange thing is I have built probably 10 Matrix servers always using the IP address to start building and I have never had this issue.



Is there a way to debug this?

[quote]
Yes, the IP is added as a system root address. The strange thing is I have built probably 10 Matrix servers always using the IP address to start building and I have never had this issue.



Is there a way to debug this?

[/quote]



Sure, in core/include/mysource.inc, look around line 1437. Check the variable $login_key and the output of the function loginKey(). Also getUniqueSessionKey() might show something too.



One thing I just noticed in the code, have you tried allowing an IP Change? Maybe the browser uses a different ip address?

[quote]
Sure, in core/include/mysource.inc, look around line 1437. Check the variable $login_key and the output of the function loginKey(). Also getUniqueSessionKey() might show something too.



One thing I just noticed in the code, have you tried allowing an IP Change? Maybe the browser uses a different ip address?

[/quote]



Allowing the IP to change didn't help.



There are some errors in the logs:


    12:06:56 - 11 Jul
    User: Root User (12)
    Level: MySource Notice
    	(/core/include/locale_manager.inc:547) - URL "http://50.57.108.153/_admin/\?http:/50.57.108.153/__lib/web/images/icons/stop.png\?" not found [SYS0218]
    12:07:16 - 11 Jul
    User: Root User (12)
    Level: MySource Notice
    	(/core/include/locale_manager.inc:547) - URL "http://50.57.108.153/_admin/\?http:/50.57.108.153/__lib/web/images/icons/stop.png\?" not found [SYS0218]
    12:07:16 - 11 Jul


This doesn't seem normal.

Here is the strange part, I logged the output from mysource.inc and here is what I found.

Safari:

    Raw Entry: 	[11-Jul-2011 12:28:12] Login Key: lbrnyyyzwpprqrqqnsjk Key Function: 


Firefox:

    Raw Entry: 	[11-Jul-2011 12:29:06] Login Key: qfcqgzjgstkvrhlysbhb Key Function: qfcqgzjgstkvrhlysbhb


So, it seems that in safari the $this->loginKey() function is returning nothing, so there is no match.

[quote]
Allowing the IP to change didn't help.



There are some errors in the logs:


    12:06:56 - 11 Jul
    User: Root User (12)
    Level: MySource Notice
    	(/core/include/locale_manager.inc:547) - URL "http://50.57.108.153/_admin/\?http:/50.57.108.153/__lib/web/images/icons/stop.png\?" not found [SYS0218]
    12:07:16 - 11 Jul
    User: Root User (12)
    Level: MySource Notice
    	(/core/include/locale_manager.inc:547) - URL "http://50.57.108.153/_admin/\?http:/50.57.108.153/__lib/web/images/icons/stop.png\?" not found [SYS0218]
    12:07:16 - 11 Jul




This doesn't seem normal.

[/quote]

This is the browser misreading the urls because the url, in the javascript space, when the url has quotes around it. Unfortunately, I have seen this, but never been able to reliably replicate the issue, but its completely harmless.

[quote]

Here is the strange part, I logged the output from mysource.inc and here is what I found.

Safari:

    Raw Entry: 	[11-Jul-2011 12:28:12] Login Key: lbrnyyyzwpprqrqqnsjk Key Function: 


Firefox:

    Raw Entry: 	[11-Jul-2011 12:29:06] Login Key: qfcqgzjgstkvrhlysbhb Key Function: qfcqgzjgstkvrhlysbhb


So, it seems that in safari the $this->loginKey() function is returning nothing, so there is no match.
[/quote]

Do you have cookies turned on in Safari?

[quote]
Do you have cookies turned on in Safari?

[/quote]



Yes, I can even see the new cookie that I got from trying to login, and it has the session ID.

[quote]
Yes, I can even see the new cookie that I got from trying to login, and it has the session ID.

[/quote]



The only think else I can think of, is maybe Safari is changing sessions somehow? I am really out of ideas at this point :blink:

[quote]
Yes, I can even see the new cookie that I got from trying to login, and it has the session ID.

[/quote]



Does a session file get created in the matrix/cache folder ? (sess_XXX). Does it work outside of matrix? Create a php page:


    
    <?php
    session_start();
    echo "session id is " . session_id() . "
\n"; if (!isset($_SESSION['abc'])) { echo "abc is not in the session
\n"; $_SESSION['abc'] = '123'; } else { echo "abc is " . $_SESSION['abc'] . "
\n"; }


If you hit that page in safari and then refresh, what happens?

The first hit should say "abc is not in the session", the second should say "abc is 123".

[quote]
Does a session file get created in the matrix/cache folder ? (sess_XXX). Does it work outside of matrix? Create a php page:

[/quote]



Yes, the session file is created, and matches my session cookie. Oh well, maybe I should just use Chrome or FF.

[quote]

    
    <?php
    session_start();
    echo "session id is " . session_id() . "
\n"; if (!isset($_SESSION['abc'])) { echo "abc is not in the session
\n"; $_SESSION['abc'] = '123'; } else { echo "abc is " . $_SESSION['abc'] . "
\n"; }


If you hit that page in safari and then refresh, what happens?

The first hit should say "abc is not in the session", the second should say "abc is 123".
[/quote]

This worked fine.

[quote]
This worked fine.

[/quote]



Around line 305 of core/include/mysource.inc it has session_start()



If you


    
    bam($_SESSION);


after that, what do you get? Compare with firefox, does it have the same things ?

Also around line 308 it has:

    
    if (isset($_SESSION['activated']) === TRUE && $_SESSION['activated'] === 1) {


Does it get into that section (a simple bam(__LINE__) will tell you) ?

[quote]

    
    bam($_SESSION);

[/quote]



This output a bunch of user and session info into the system log. As well as a string on the frontend: [Empty]




[quote]

    
    if (isset($_SESSION['activated']) === TRUE && $_SESSION['activated'] === 1) {


Does it get into that section (a simple bam(__LINE__) will tell you) ?
[/quote]

It doesn't seem to get to that point in Safari.

[quote]
This output a bunch of user and session info into the system log. As well as a string on the frontend: [Empty]

[/quote]



Anything different/missing when comparing what happens with firefox and safari?


[quote]

It doesn't seem to get to that point in Safari.

[/quote]



That's good, it's not clearing the session for some reason then. There's another session_start() in that if condition so that's why I wanted to check if it was getting in there or not.

[quote]
Anything different/missing when comparing what happens with firefox and safari?

[/quote]



FF shows a bunch of info, but it seems that Safari just returns [Empty]. At least that is what it shows real quick before it says login key incorrect.

[quote]
FF shows a bunch of info, but it seems that Safari just returns [Empty]. At least that is what it shows real quick before it says login key incorrect.

[/quote]



Oops - maybe try a



log_dump($_SESSION);



instead so it logs to data/private/logs/error.log



Sounds like safari doesn't get the same session id back which is weird. Anything in front of matrix (squid) ?

[quote]
FF shows a bunch of info, but it seems that Safari just returns [Empty]. At least that is what it shows real quick before it says login key incorrect.

[/quote]



Are you using the default cache handler or memcache?