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

Telegram Broken #5891

Closed
MerlionRock opened this issue Jan 27, 2017 · 8 comments
Closed

Telegram Broken #5891

MerlionRock opened this issue Jan 27, 2017 · 8 comments

Comments

@MerlionRock
Copy link
Contributor

Errors occur with telegram with new installation. Assuming some package errors but not able to fins out which one.

Here's the error:
Traceback (most recent call last):
File "pokecli.py", line 865, in
main()
File "pokecli.py", line 202, in main
formatted='Starting bot...'
File "/Users//PokemonGo-Bot/pokemongo_bot/event_manager.py", line 77, in emit
handler.handle_event(event, sender, level, formatted_msg, data)
File "/Users/
/PokemonGo-Bot/pokemongo_bot/event_handlers/telegram_handler.py", line 579, in handle_event
self.tbot.sendMessage(chat_id=uid, parse_mode='Markdown', text=msg)
File "/Users//PokemonGo-Bot/pokemongo_bot/event_handlers/telegram_handler.py", line 123, in sendMessage
self._tbot.sendMessage(chat_id=chat_id, parse_mode=parse_mode, text=text)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/telegram/bot.py", line 125, in decorator
result = func(self, args, kwargs)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/telegram/bot.py", line 151, in decorator
result = self._request.post(url, data, timeout=kwargs.get('timeout'))
File "/Users//PokemonGo-Bot/lib/python2.7/site-packages/telegram/utils/request.py", line 207, in post
urlopen_kwargs)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/telegram/utils/request.py", line 132, in _request_wrapper
resp = self._con_pool.request(args, kwargs)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/request.py", line 70, in request
urlopen_kw)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/request.py", line 148, in request_encode_body
return self.urlopen(method, url, extra_kw)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/poolmanager.py", line 244, in urlopen
response = conn.urlopen(method, u.request_uri, kw)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/connectionpool.py", line 588, in urlopen
conn = self._get_conn(timeout=pool_timeout)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/connectionpool.py", line 241, in _get_conn
if conn and is_connection_dropped(conn):
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/util/connection.py", line 27, in is_connection_dropped
return bool(wait_for_read(sock, timeout=0.0))
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/util/wait.py", line 33, in wait_for_read
return _wait_for_io_events(socks, EVENT_READ, timeout)
File "/Users/
/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/util/wait.py", line 22, in _wait_for_io_events
with DefaultSelector() as selector:
File "/Users/
**/PokemonGo-Bot/lib/python2.7/site-packages/urllib3/util/selectors.py", line 431, in init
self._kqueue = select.kqueue()
AttributeError: 'module' object has no attribute 'kqueue'

Anyone has the same problem?

The bot seems to work fine when telegram is disabled.

@davidakachaos
Copy link
Contributor

davidakachaos commented Jan 27, 2017 via email

@MerlionRock
Copy link
Contributor Author

@davidakachaos I guess same error. Mac uses kqueue, other OS uses epoll.

@davidakachaos
Copy link
Contributor

davidakachaos commented Jan 27, 2017 via email

@MerlionRock
Copy link
Contributor Author

Anyone found any solution yet? I have no idea what causes it.

@davidakachaos
Copy link
Contributor

No, I've searched Google but haven't found a solution yet. I updated the Telegram bot dependency to 5.3.0 but that didn't help. So the search continues....

@ashleykleynhans
Copy link
Contributor

@MerlionRock The issue lies with version 1.20 of urllib3.

Add the following line to requirements.txt:

urllib3==1.18

Then run

setup.sh -u

And the telegram bot will function again.

@MerlionRock
Copy link
Contributor Author

MerlionRock commented Jan 31, 2017

@ashleykleynhans Thank you so much! Finally!

Will do a PR for this for those who are facing the same problem.

@ashleykleynhans
Copy link
Contributor

@MerlionRock I opened a PR for it #5895

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

3 participants