Invalid Auth status code recieved, token not refreshed?
Description: I'm using google auth and seem to be getting an exception regarding having an invalid auth code.
Steps to reproduce:
- Login with google account
- Run bot for more than around 2 hours
Expected behavior: It should continue to function
Actual behavior: Get the following stack trace:
Stacktrace (If it's a crash):
D/RequestHandler: Authenticated with static token
07 Aug 16:28:23 (default: ProfileLoop): Failed to update profile and inventories
D/RequestHandler: Authenticated with static token
07 Aug 16:28:24 (default: ProfileLoop): Error running loop ProfileLoop!
com.pokegoapi.exceptions.AsyncPokemonGoException: Unknown exception occurred.
at com.pokegoapi.util.AsyncHelper.toBlocking(AsyncHelper.java:45)
at com.pokegoapi.main.RequestHandler.sendServerRequests(RequestHandler.java:155)
at com.pokegoapi.api.inventory.Hatchery.queryHatchedEggs(Hatchery.java:66)
at ink.abb.pogo.scraper.tasks.HatchEggs.run(HatchEggs.kt:22)
at ink.abb.pogo.scraper.Bot.task(Bot.kt:221)
at ink.abb.pogo.scraper.Bot$start$3.invoke(Bot.kt:116)
at ink.abb.pogo.scraper.Bot$start$3.invoke(Bot.kt:33)
at ink.abb.pogo.scraper.Bot$runLoop$1.invoke(Bot.kt:169)
at ink.abb.pogo.scraper.Bot$runLoop$1.invoke(Bot.kt:33)
at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:18)
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.pokegoapi.exceptions.LoginFailedException: Invalid Auth status code recieved, token not refreshed?
at rx.exceptions.Exceptions.propagate(Exceptions.java:58)
at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:465)
at rx.observables.BlockingObservable.first(BlockingObservable.java:168)
at com.pokegoapi.util.AsyncHelper.toBlocking(AsyncHelper.java:37)
... 9 more
Version: I am using the Pokemon Go Bot v0.5.0 release
Operating System: OS X 10.11.4
Java version:
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
When you restart it, does it work again?
same. @toffaste1337 yes
Same issue here as well. When you restart it everything is back to normal, again for some time.
Exactly same issue here. Noticed the first time that it would recover after 2 minutes but now it hangs in this error.
Got the same error after the bot was running for some hours. When I restarted it was ok tho.
This is actually quite an issue for the bot since it can happen in an hour or after more than 3 hours, but makes it impossible to leave it run unattended.
@staurakis @fabioneves @remie2000 @smileytechguy
For now I've created a cron job that restarts the bot I run every 2 hours.
script:
kill -9 $(ps aux | grep [P]okemonGoBot | awk '{print $2}' )
cd /path/to/yourdir
screen -dmSL <nameofscreen> -java -jar PokemonGoBot-0.5.0.jar
crontab -e
0 0-23/2 * * * /path/to/script.sh
To view logs whenever you want:
screen -x <nameofscreen>
Using screen allows you to run multiple bots at once if you so please.
So far works, but definitely want to set allow_leave_start_area=false so that logging out and back in again doesn't get you soft banned from having wandered too far in two hours. If you're really worried about this you can always sleep 5m to make sure you don't jump too far in a short amount of time.
Hope that helps in the meantime.
i'm in windows but i've seen a batch file to execute the same..... Can't we solve it @jabbink you think?
There's an open issue about it on the API provider here: https://github.com/Grover-c13/PokeGOAPI-Java/issues/474
@Sieberkev as far as i understand (please correct if i'am wrong) the above link refers to google login/authentication. I am also receiving the error using ptc login.... Furthermore, i am not sure that this is an API fault since not all bots have the same issue as far as i know (i have not extensively tested other bots to be honest though).
One more thing after testing this.... I had the client for more than 7 hours without any issues before it crashed again.
@oliverswitzer
Currently I start my bot with the following command
cd /root/PokemonGoBot screen -dmS bot java -jar /root/PokemonGoBot/PokemonGoBot-0.5.0.jar --server.port=8090
What would the specific command for the autorestart be for me in my case?
Using Ubuntu 14.04 Server
I want to restart it ever 1 hour and 15 minutes with a sleep for 1 minute due to the sockets
Could you retry this with the new 0.5.1 (without the restarting script)?
could it actually be something weird like the fact the port is 8090 and some other application in the computer tries to use it and it gets closed leading to a delay in the infamous unknown6 where unknown22 was time sensitive leading to an error coming from there?
I get this as well, but using PTC login. Latest commit has been pulled as of this comment. it happens multiple times and seems to eventually crash the bot.