iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

IITC Mobile always throws Error:Server Error #497

Open insanemal opened 11 years ago

insanemal commented 11 years ago

Build 0.5.4.2 I was using the latest stable but it also has the same problem.

When opening IITC Mobile it shows the Ingress.com/intel 'sign in' screen. It just sits there. If you click sign in, it breifly shows the google 'sign in' (asking for username and password) that you see when using a mobile browser on a google service. It then, very quickly, loads a page saying "Error: Server Error" and some text about reporting the issue to google/niantic.

It was doing this in the the phone browser until I did a clear data/cache on the browser. Doing The same on IITC has not helped resolve the issue.

I can/will provide debug logs and screenshots Just let me know what you want.

EDIT: Sorry hit enter early.

insanemal commented 11 years ago

golf clap

jonatkins commented 11 years ago

The fact it happens with the browser suggests it may not be an IITC issue.

Also, repeated retries of the login have been known to succeed eventually. I've personally seen it work after the third try, and a user reported it worked after five tries.

Cancelling the account prompt, and entering your email/password is a work-around.

insanemal commented 11 years ago

You sir, are a scholar and a gentleman. Canceling the automatic account prompt thingo did it..

Sorry for any bother!

Tho it could make a neat FAQ entry.

rmerom commented 11 years ago

Hi I'm experiencing the same problem and retrying doesn't help (have tried many times). I'm not very happy about entering my username/password in a web view.. Do you possibly know of any other trick that could solve this?

jonatkins commented 11 years ago

A few things to try, @rmerom - no guarantees though.

  1. Check your device time and timezone are set correctly
  2. Log in while connected to a WiFi network, rather than mobile data.
  3. Clear the IITC application cache (via the device settings->apps)
  4. Try toggling the 'force https' option in IITC. Usually, https on works most reliably, but there are cases where it's more reliable when off.
  5. Turn off all IITC plugins, and the 'show user location' option, until logged in successfully
  6. Try logging into the standard intel site with the browser on your phone then retry in IITC Mobile.
rmerom commented 11 years ago

Thanks Jon for the quick response. I've tried everything you mentioned (1,2 were true, 5 happens when automatically when clearing the cache). I thought that perhaps I'm getting this error because I have both Chrome and Chrome Beta, or because I was logged into another account in one of them. Tried to uninstall Chrome Beta, log in with the right account in Chrome, clear both IITC and Chrome app data, but unfortunately to no avail... What is this error anyway? is it Google not happy with an oauth2 token (just a wild guess)?

jonatkins commented 11 years ago

I'm not 100% sure - a lot of the specifics are hidden away in the Android APIs.

One thing I did notice recently though, is there used to be a second dialog, after choosing the account, where you confirm permission to access the account. This appears to start being displayed very briefly before being cleared and the error message displayed.

@fkloft - was this your code? Could there be something we're doing wrong? Any additional logging that could be added to determine what's going wrong?

fkloft commented 11 years ago

It is right that I implemented the login via Android API. But the dialog you mentioned is provided by Android. Have a look at (https://developer.android.com/training/id-auth/authenticate.html#RequestToken)[the docs]. When requesting a token, it may be that Android returns an Intent. If it did, you have to execute that intent, without knowing what it is, because the authenticator needs to talk to the user. It could be some sort of confirmation (e.g. the dialog you mentioned), but also a two-factor-authentication or a fingerprint or retina scan (might happen some time :-D).

After that, you re-request a token. Usually, this returns a URL which is then loaded into the webview. It will redirect back to the intel map.

Also I must say that I cannot reproduce this issue. Automatic login so far has always worked for me. Usually I don't use Chrome, but I just tried and that worked, too. But as long as people report that I doesn't work with Chrome (or Android Stock Browser), I don't think that we can fix this.

jonatkins commented 11 years ago

@fkloft well I'm getting it 100% at the moment (Nexus 7) - an uninstall/reinstall of IITC caused it to start happening. Any tips on debugging it?

fkloft commented 11 years ago

Not yet. I don't know either where to start searching. But anyway I'm working on a better debugging view, so let me finish that, then I'll have a closer look at this.

jonatkins commented 11 years ago

If we can't find a solution for this error, we should at least intercept it and do something more useful (a description of the work-around? link to the website FAQ entry? disable integrated authentication and reload, so the user can login manually?)

I'm loosing track of the number of times I'm answering questions about this now...

leCradle commented 11 years ago

How about intercepting the 500 error and redirecting to the FAQ entry? This should be only one line of code to add. I can do this if I'm back at my work station (in a few hours).

leCradle commented 11 years ago

Ok I decided to show an alert dialog describing the workaround instead of redirecting to the FAQ. This way the login is reloaded on dialogs cancel....should be more user friendly.

Frayden commented 11 years ago

Getting the same issue on Nexus 4. However, if I set Settings/Force Desktop Mode, the "permissions request" dialog then appears as it should and I am able "Allow access" to the weblogin request.

footballqq commented 11 years ago

I get 403 that's an error your client does not have permission to get URL /_ah/conflogin from this serer that's all we know.