Bug - Fixed Login stops at "Seeing what's still trendy today..."

Parody

New member
Last night (after rollover) I started up KoLmafia 15.1 (10583) and logged in. The login process got to "Seeing what's still trendy today..." and stopped. I let it sit for 15-20 minutes before I killed it. Tried it again this morning with what was the current build (10684) and got the same thing.

My character is in a Trendy run.

Thanks!
 

Attachments

  • DEBUG_20120301_a.txt
    9.4 KB · Views: 59

fronobulax

Developer
Staff member
I thought this had been squashed and 10583 is pretty old. Would you consider updating to the latest daily build and trying again?
 

Veracity

Developer
Staff member
Yes. You are running stock 15.1, straight off of sourceforge.

Your stack trace says we got back something from login.php that made us think we had successfully logged in, but we had not, so when we tried to do the rest of the requests to refresh your status, KoL told us we were not logged in.

Login handling has been seriously whacked in more recent builds. Update and try again, please. Thanks.
 

Parody

New member
As mentioned in my original post, I did try a fresh build from this morning. (10684) There's also two stack traces in the file I uploaded, one from each build I tried. (Sorry if I should have separated them, but that's how KoLmafia writes them.)
 
Last edited:

Veracity

Developer
Staff member
Ah, yes. The second stack trace is usable.

You were logging in perfectly well, we fetched your inventory, and then we asked for typeii.php to check if something was trendy, and KoL redirected you to login.php?notloggedin=1

Puzzling.
 

Parody

New member
I finally got the chance to log into KoL normally tonight. When I tried to go to the Trendy schedule page, I got a 502 Bad Gateway error. I've reported it via the in-game bug reporting setup.

Would a 502 response cause what we're seeing here? Obviously the trendy check isn't going to work, but it'd be nice if it errored instead of hanging.

Hope this helps,

Mike

PS: I didn't try this in the morning because I forgot my password and got locked out! I've been using KoLMafia too long, it's just too darn useful. Thanks for the great work! :)
 
Last edited:

Veracity

Developer
Staff member
Interesting. I'm not in a trendy run, but I tried looking at typeii.php in the Relay Browser:

Code:
Requesting: http://www.kingdomofloathing.com/typeii.php
3 request properties

Field: Cookie = [PHPSESSID=0qfqsureifekhn9spu4frsorj6]
Field: User-Agent = [Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7]
Field: Connection = [close]

Retrieving server reply...
Time out during response (typeii.php).

That's not what happened to you, though. Your stack trace:

Code:
java.lang.Exception: typeii.php => login.php?notloggedin=1
	at net.sourceforge.kolmafia.StaticEntity.printStackTrace(StaticEntity.java:389)
	at net.sourceforge.kolmafia.request.LoginRequest.executeTimeInRequest(LoginRequest.java:347)
	at net.sourceforge.kolmafia.request.GenericRequest.handleServerRedirect(GenericRequest.java:1741)
	at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1630)
GenericRequest.java:1630:

Code:
				shouldStop = this.responseCode == 302 ? this.handleServerRedirect() : true;
You got a code 302 - a redirect. And the exception told us exactly what the redirect was:

Code:
class java.lang.Exception: typeii.php => login.php?notloggedin=1
KoL redirected you to login.php.

In other words, it looks to me like KoL booted you out.

This is clearly an issue in KoL itself. I'd suggest making an in-game bug report to tell them what you just reported: your failure to go to the Trendy schedule in a normal browser.
 

Veracity

Developer
Staff member
I just submitted a bug report:

I'm currently logged in (duh) right through Safari - no KoLmafia, no Greasemonkey. In my location bar, I entered:

http://www.kingdomofloathing.com/typeii.php

since I wanted to see the current "trendy" list. My browser gave me:

502 Bad Gateway

Oops! What's up with that?
Unfortunately, I don't get this when I submitted it through the Relay Browser. Instead, I apparently got an IOException, which KoLmafia logged as "Time out during response (typeii.php)" and auto-redirected to main.php.

What YOU got, according to your log file, was an actual 302 redirect to login.php?notloggedin=1 which made us attempt to time-in your session, which failed (LoginRequest.java line 347) because you were in the process of logging in. After having logged that, we attempted a KoLmafia.quit(), which SHOULD have forcibly logged you out and exited the program. Apparently, that did not work and it "hung" for you.
 

Veracity

Developer
Staff member
Yes! In GenericRequest.retrieveServerReply(), I stuck a StaticEntity.printStackTrace inside the IOException trap. I got the following:

Code:
java.io.IOException: Server returned HTTP response code: 502 for URL: http://www.kingdomofloathing.com:80/typeii.php
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
	at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1556)

So, we certainly do have the ability to distinguish different causes for IOExceptions. They are not all simply "time out during response". Some are real, hard I/O errors.

I propose that if we get a hard I/O failure - like this one - that we process it differently than for a real "time out" - which is probably a 408: Request Time-Out.

Hola: any thoughts on this? An IOException on an HttpURLConnection is not automatically a "timeout".
 

Veracity

Developer
Staff member
OK. I attempted to distinguish between a SocketTimeoutException and a general IOException. In the latter case, I attempt to retrieve the responseCode, log the error, stop retrying, and, hopefully, return a blank page.

I'm curious to see if this will let you log in successfully as Trendy during this time of KoL server bugs. We won't have any idea of what's Trendy, so all the code to not let you try to use outmoded familiars and equipment won't work, but hopefully you can log in at least.

Revision 10708
 

DiscoDancing

New member
I got the same bug, and i can log in (thanks Veracity), but all automatisation failes: Server returned response code 502 for typeii.php
 

Veracity

Developer
Staff member
Revision 10709 will detect when typeii.php returns a blank page (as it does now, when KoL returns a 502 error) and, hopefully, will give up retrying, again and again, to fetch it. Tell me how it works!
 

Veracity

Developer
Staff member
So it does not say "KoL returned a blank page. Giving up."?
Get me a debug log, please. Thanks.
 

Veracity

Developer
Staff member
Try revision 10710

Edit: my test:

> ash is_trendy( $item[ snorkel ] )

Seeing what's still trendy today...
Server returned response code 502 for typeii.php
KoL returned a blank page. Giving up.
Returned: true
 
Last edited:
Top