PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

LoginFailedException: Error in API Url

Open dtitov opened this issue 10 years ago • 15 comments

Description: After ~1.5 hours of my bot running, it fails with LoginFailedException (see ST below).

Looks like it's similar to #241, but I don't get Refreshing token failed message - only Error in API Url message.

Steps to reproduce:

  1. Login via GoogleAutoCredentialProvider
  2. Continuously perform some actions (walking/looting/catching/etc.)

Expected behavior: Bot works correctly.

Actual behavior: Bot fails with LoginFailedException in about 90 minutes.

Stacktrace (If it's a crash):

[D/RequestHandler: Authenticated with static token

Error  in API Url 

com.pokegoapi.exceptions.LoginFailedException: Error  in API Url 
    at com.pokegoapi.main.RequestHandler.internalSendServerRequests(RequestHandler.java:204) ~[PokeGOAPI-Java-7166dcc.jar:na]
    at com.pokegoapi.main.RequestHandler.run(RequestHandler.java:277) ~[PokeGOAPI-Java-7166dcc.jar:na]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_45]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]](url)

Version: Revision 0c5e008 (included to project via jitpack.io).

dtitov avatar Aug 01 '16 09:08 dtitov

I have the exact same issue :) (Google 2FA)

Sieberkev avatar Aug 01 '16 09:08 Sieberkev

Hi, have the same issue (PTC account).

Start time: 2016-08-01 14:36:13.728 Exception time: 2016-08-01 15:06:30.311

Exception: com.pokegoapi.exceptions.LoginFailedException: Error in API Url at com.pokegoapi.main.RequestHandler.internalSendServerRequests(RequestHandler.java:204) ~[PokeGOAPI-Java-7166dcc.jar:na] at com.pokegoapi.main.RequestHandler.run(RequestHandler.java:277) ~[PokeGOAPI-Java-7166dcc.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_72] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_72] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]

marniks7 avatar Aug 01 '16 10:08 marniks7

Same issue here (G-Account).

thegimliboy avatar Aug 01 '16 13:08 thegimliboy

I am using PTC login and am experiencing the issue after exactly 2.5hours of runtime.

01 Aug 15:45:22: Error running loop BotLoop!
com.pokegoapi.exceptions.LoginFailedException: Error  in API Url
        at com.pokegoapi.main.RequestHandler.internalSendServerRequests(RequestHandler.java:216)
        at com.pokegoapi.main.RequestHandler.run(RequestHandler.java:289)
        at java.lang.Thread.run(Thread.java:745)
01 Aug 15:45:31: Getting map of (xx.36062370072102, x.x88219141054913)
D/RequestHandler: Authenticated with static token

nostyler avatar Aug 01 '16 13:08 nostyler

This message is thrown when the server sends status code 102 (invalid auth), are you guys providing refresh tokens?

Grover-c13 avatar Aug 01 '16 14:08 Grover-c13

Well, I guess no. Should we? Is it described somewhere?

dtitov avatar Aug 01 '16 14:08 dtitov

No thats fine, was just checking stuff :P

Grover-c13 avatar Aug 01 '16 14:08 Grover-c13

Will investigate in a few hours

Grover-c13 avatar Aug 01 '16 14:08 Grover-c13

Thank you!

dtitov avatar Aug 01 '16 14:08 dtitov

The PTC login credential don't have refresh token feature like Google Auth.

It always assume token is NOT expire yet if (tokenTimeExpired-5minutes > currentTime) But, in the reality, the PTC token "could" expire even before the "expired time" given when we get the information at the oauth login processed.

sphinxid avatar Aug 01 '16 14:08 sphinxid

By the way, sometimes proper work of my bot continues after such exception, but sometimes not, hm...

dtitov avatar Aug 01 '16 16:08 dtitov

I'm seeing this intermittently with a PTC account as well.

apottere avatar Aug 01 '16 16:08 apottere

I think PTC servers are down

Sail338 avatar Aug 01 '16 16:08 Sail338

Any update, guys?

dtitov avatar Aug 01 '16 21:08 dtitov

#442

Grover-c13 avatar Aug 02 '16 10:08 Grover-c13