Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session stale, re-logging in #5712

Closed
gise88 opened this issue Sep 27, 2016 · 6 comments
Closed

Session stale, re-logging in #5712

gise88 opened this issue Sep 27, 2016 · 6 comments

Comments

@gise88
Copy link
Contributor

gise88 commented Sep 27, 2016

Expected Behavior

The bot remains logged in

Actual Behavior

Session stale, re-logging in. A lot of times

Your FULL config.json (remove your username, password, gmapkey and any other private info)

http://pastebin.com/marNFBVM

Output when issue occurred

http://pastebin.com/RyfmP1fm

Other Information

OS:
Arch Linux 4.7.4-1-ARCH #1 SMP PREEMPT Thu Sep 15 15:24:29 CEST 2016 x86_64 GNU/Linux

Branch:
dev

Git Commit:
4c380f2

Python Version:
Working with the original docker-compose

@gise88
Copy link
Contributor Author

gise88 commented Sep 27, 2016

I've just tried.. Happens the same with master branch!

@Gobberwart
Copy link
Contributor

Sounds like some sort of issue with your pokemongo account expiring sessions too quickly. Are you using google or ptc account?

@gise88
Copy link
Contributor Author

gise88 commented Sep 27, 2016

Ptc account. But it is weird! Trying it on another pc it works correctly... Could it be a docker problem?

@Gobberwart
Copy link
Contributor

Gobberwart commented Sep 27, 2016

Hmm, I didn't realise it worked with the same account on another PC.

Looking at the code, I'm wondering if it might be a timezone issue:

            remaining_time = \
                self.api._auth_provider._ticket_expire / 1000 - time.time()

            if remaining_time < 60:
                 <generate log message and re-login>

SO it gets ticket expiry from the api, and compares it with your local time, and thinks remaining_time is < 60 seconds... pretty much every time.

In my case, I get:
self.api._auth_provider._ticket_expire / 1000 = 1475015140
time.time() = 1475013349.07
remaining_time = 1790.93499994

@gise88
Copy link
Contributor Author

gise88 commented Sep 27, 2016

Fu*k! 😅 It is my old pc and I did not realize that the time was wrong.
timedatectl set-ntp true fix this!
Thanks for your time and sorry for this issue

@gise88 gise88 closed this as completed Sep 27, 2016
@Gobberwart
Copy link
Contributor

No worries, happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants