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

Got exception while listening #175

Closed
JarbasAI opened this issue Jul 6, 2017 · 4 comments
Closed

Got exception while listening #175

JarbasAI opened this issue Jul 6, 2017 · 4 comments

Comments

@JarbasAI
Copy link
Contributor

JarbasAI commented Jul 6, 2017

happens randomly, not sure how to reproduce

i have a bot running 24/7, today it was down and this was last log, i know it has happened before and i just ignored it

2017-07-06 04:56:21,530 - client - ERROR - Got exception while listening Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/fbchat/client.py", line 1430, in doOneListen content = self._pullMessage(self.sticky, self.pool) File "/usr/local/lib/python2.7/dist-packages/fbchat/client.py", line 1242, in _pullMessage j = checkRequest(self._get(ReqUrl.STICKY, data)) File "/usr/local/lib/python2.7/dist-packages/fbchat/utils.py", line 157, in checkRequest raise Exception('Error when sending request: Got {} response'.format(r.status_code)) Exception: Error when sending request: Got 502 response

@madsmtm
Copy link
Member

madsmtm commented Jul 9, 2017

Seems like something that's virtually impossible to fix, like #130. If anyone figures out why, I'd love to know, but other than that, I think the only thing we can do is just catch the error, and the do a re-login, or simply just re-login every, say, 6 hours.

@Bankde
Copy link
Contributor

Bankde commented Jul 9, 2017

Im working on this one right now (since I need 24/7 too haha)

I observe that facebook starts sending weird response that contains fb_dtsg after running like days.
I think this issue is same with this one and they have already fixed it.
Schmavery/facebook-chat-api#202

Here is the code:
#178
Pray that there's nothing wrong with it XD
I think I still need to test for few weeks. I will confirm it here then you can merge that pull request.

PS: It's funny that I also thumb-up'ed the comment in that issue. Somehow I completely forgot about it. -facepalm-

@madsmtm
Copy link
Member

madsmtm commented Jul 9, 2017

Thanks for you work, this'll become really handy :)

@Bankde
Copy link
Contributor

Bankde commented Aug 6, 2017

Note: I recently met an error IF nothing had been sent for 3 days then I sent a message.
Exception: Error #1357004 when sending request: Please try closing and re-opening your browser window.
It seems that updating fb_dtsg from message isn't enough in case that fbchatClient is afk'ing for long time.
Request facebook.com to get new fb_dtsg could help. Im quite busy right now, will test and fix this later.

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

No branches or pull requests

3 participants