core: Hangouts messaging stops working with "Session is closed" error

Home Assistant release with the issue: 0.77.3

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io on raspberry Pi 3

Component/platform: /homeassistant/components/hangouts

Description of problem: Hangouts messaging stops working after a while, issuing a “Session is closed” error when it tries to send a message. It seems that hangouts closes the http session with home assistant, maybe after a timeout? Restarting home assistant fixes the issue, until the next “Session is closed” error occurs after a while (it can be after a few hours or a few days).

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


Traceback (if applicable):

Error executing service <ServiceCall hangouts.send_message (c:f3ad6e04fb744412b045b63ed3aac16a): target=[OrderedDict([('id', 'UgzwnEarphuuyGVOAwN4AaABAQ')])], message=[{'text': 'xxxxx', 'is_bold': True}, {'text': 'yyyyyyy', 'parse_str': True}]>

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1117, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/hangouts/hangouts_bot.py", line 245, in async_handle_send_message
    service.data[ATTR_TARGET])
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/hangouts/hangouts_bot.py", line 220, in _async_send_message
    await conv.send_message(messages)
  File "/usr/local/lib/python3.6/site-packages/hangups/conversation.py", line 439, in send_message
    await self._client.send_chat_message(request)
  File "/usr/local/lib/python3.6/site-packages/hangups/client.py", line 591, in send_chat_message
    send_chat_message_request, response)
  File "/usr/local/lib/python3.6/site-packages/hangups/client.py", line 417, in _pb_request
    request_pb.SerializeToString()
  File "/usr/local/lib/python3.6/site-packages/hangups/client.py", line 470, in _base_request
    'post', url, headers=headers, params=params, data=data,
  File "/usr/local/lib/python3.6/site-packages/hangups/http_utils.py", line 64, in fetch
    headers=headers, data=data) as res:
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 855, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 254, in _request
    raise RuntimeError('Session is closed')
RuntimeError: Session is closed

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@dshokouhi sorry, i messed up with the first mail about this issue, read the first time about it 😅 random issues are bad 🤔 i’ll have a look at it the next days. we should get a closed event, than we have to reconnect, if needed…

I’m having the same issue. Started a couple of days ago. No 2fa. This is a separate account just for HA.