[PVE-User] Problem logging in to PVE 2.1 with Iceweasel 10.0.6

Flavio Stanchina flavio.stanchina at ies.it
Tue Oct 23 23:54:46 CEST 2012


Well, I guess nobody has a clue about this as I got no answers, but today I
began migrating my PVE 1.9 servers to 2.x and I got *really* pXXXed off at
Iceweasel not being able to log in on PVE 2.x, so I dug until I reached the
bottom of the problem. It appears that it has something to do with HTML5's
"localStorage" stuff, whatever that is. Have a look at
Ext.state.LocalStorageProvider, around line 59886 of
/usr/share/pve-manager/ext4/ext-all-debug.js:

    getStorageObject: function(){
        try {
            var supports = 'localStorage' in window &&
window['localStorage'] !== null;
            if (supports) {
                return window.localStorage;
            }
        } catch (e) {
            return false;
        }
    }

So far so good, this tries to get the window.localStorage object and
returns false if it can't. However, the set() and clear() methods happily
reference the result of getStorageObject() without checking if it's
initialized. As far as I understand it, when this happens the JavaScript
engine errors out before PVE can set the authentication ticket and I'm
stuck at the login dialog. Not that surprising for code that tries to call
methods on an object set to false.

The attached patch fixes the problem for me, but please note that I don't
really know what I'm doing here: I don't know what localStorage is, I don't
know why my Iceweasel doesn't have it (looked for clues in the preferences
and in about:config but found nothing) and more importantly I don't
actually know JavaScript, but it looked enough like C/C++ that it appears I
can understand it. So beware of the patch as it could be breaking something
else.

Out of curiosity: how does one go about debugging large JavaScript
libraries such as Ext JS? I searched for a JavaScript debugger addon for
Iceweasel and found a thingie called Venkman, but it's far to slow to be
useful.

On 14/09/2012 01:10, Flavio Stanchina wrote:
> Today I set up a second server and even Firefox on Windows can't log in!
> 
> To sum it up:
> * server 1: Firefox on Windows does log in just fine, Iceweasel on Linux
> doesn't;
> * server 2: neither Firefox on Windows nor Iceweasel on Linux will log in!
> 
> Again, Chrome can log in just fine on both servers.
> 
> The symptoms are described in more detail below: this time I also looked at
> the Apache logs on the server but there's nothing wrong there.
> 
> If anyone has a solution or at least an idea on how to debug this, it could
> save the few hair remaining on my head.
> 
> On 04/09/2012 00:21, Flavio Stanchina wrote:
>> I can't log in to a PVE 2.1 server at the office with Iceweasel 10.0.6 from
>> my computer at home: after I enter the username (root) and password, the
>> progress thingie swirls for a second then I'm back at the login dialog. The
>> username and password are OK, I tried to enter a bad password on purpose
>> and I correctly get the "Login failed" message. It really seems like some
>> authentication-related token or such isn't being set correctly, but I tried
>> purging all my cookies and cookie blocks, then I wiped my profile
>> altogether (Adblock included) and still the same effect. I'm sure I could
>> log in before, but it's not something I do often so only $LORD knows what I
>> changed and/or updated in the meantime.
>>
>> FYI, Chrome can log in just fine.

-- 
Flavio Stanchina
Informatica e Servizi
Trento - Italy

Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ext-all-debug.js.diff
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.proxmox.com/pipermail/pve-user/attachments/20121023/fe91409b/attachment.bin>


More information about the pve-user mailing list