Telegram component not working after upgrading to 0.43.1

After updating to 0.43.1, the Telegram Notify component stopped working.

17-04-25 20:22:01 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform telegram
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/notify/__init__.py", line 101, in async_setup_platform
    None, platform.get_service, hass, p_config, discovery_info)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/notify/telegram.py", line 49, in get_service
    username = bot.getMe()['username']
  File "/home/homeassistant/.homeassistant/deps/telegram/bot.py", line 125, in decorator
    result = func(self, *args, **kwargs)
  File "/home/homeassistant/.homeassistant/deps/telegram/bot.py", line 174, in getMe
    result = self._request.get(url)
  File "/home/homeassistant/.homeassistant/deps/telegram/utils/request.py", line 170, in get
    result = self._request_wrapper('GET', url)
  File "/home/homeassistant/.homeassistant/deps/telegram/utils/request.py", line 132, in _request_wrapper
    resp = self._con_pool.request(*args, **kwargs)
  File "/home/homeassistant/.homeassistant/deps/urllib3/request.py", line 66, in request
    **urlopen_kw)
  File "/home/homeassistant/.homeassistant/deps/urllib3/request.py", line 87, in request_encode_url
    return self.urlopen(method, url, **extra_kw)
  File "/home/homeassistant/.homeassistant/deps/urllib3/poolmanager.py", line 303, in urlopen
    conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme)
  File "/home/homeassistant/.homeassistant/deps/urllib3/poolmanager.py", line 219, in connection_from_host
    return self.connection_from_context(request_context)
  File "/home/homeassistant/.homeassistant/deps/urllib3/poolmanager.py", line 232, in connection_from_context
    return self.connection_from_pool_key(pool_key, request_context=request_context)
  File "/home/homeassistant/.homeassistant/deps/urllib3/poolmanager.py", line 245, in connection_from_pool_key
    pool = self.pools.get(pool_key)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/_collections_abc.py", line 425, in get
    return self[key]
  File "/home/homeassistant/.homeassistant/deps/urllib3/_collections.py", line 53, in __getitem__
    item = self._container.pop(key)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/collections/__init__.py", line 178, in pop
    if key in self:
TypeError: unhashable type: 'list'
1 Like

I have the same issue.

Same here.

i did a fresh installation of HA and the same problem still happens. I don’t understand how to implement your fix.

Use dev branch or wait until next release. Although installing urllib3 version 1.20 should also solve it.

How to use dev branch?

You should check the version of urllib3 after upgrading.

1 Like

when there will be next release?. I’m having the same issue with telegram webhook.

thanks. telegram works now.

I’m sorry. how to do that?

pip3 show urllib3

Thanks. It shows… Version: 1.9.1. All good?

Point or bugfix releases aren’t scheduled. They will happen once one of the core developers thinks it’s necessary and finds time to do so.

The regular release schedule for minor releases is every two weeks.

Well it’s not 1.21 which was the version with the problem. I can’t say if 1.9.1 will work. I’ve only heard that 1.20 works.

I’m running 1.9.1 as well (obviously not working for me as I opened this thread).

As always when you run commands to install home assistant or install or check your home assistant dependencies, make sure you do so in the environment where home assistant is installed and with the correct user.

If python-telegram-bot version 5.3.1 is installed it should have installed urllib3 version 1.20.

homeassistant@raspberrypi:/home/pi$ pip3 show urllib3
Name: urllib3
Version: 1.9.1
Summary: HTTP library with thread-safe connection pooling, file post, and more.
Home-page: http://urllib3.readthedocs.org/
Author: Andrey Petrov
Author-email: [email protected]
License: MIT
Location: /usr/lib/python3/dist-packages
Requires:

Am I looking at the wrong place?

I was having the same error but solved it.

First of all, did you upgrade python telegram ?

pip3 install python-telegram-bot --upgrade

Did it work ?

If not, like me . I did the following and it worked

pip3 install urllib3==1.20 --upgrade --target /home/homeassistant/.homeassistant/deps/

Thanks.

I just upgraded to 0.43.2 and that also solves the problem (urllib3 version still being 1.9.1).