hangups icon indicating copy to clipboard operation
hangups copied to clipboard

Crash after start

Open doughdemon opened this issue 5 years ago • 5 comments

hangups crashes shortly after start with the following traceback:

Traceback (most recent call last):
  File "./bin/hangups", line 11, in <module>
    load_entry_point('hangups==0.4.9', 'console_scripts', 'hangups')()
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/ui/__main__.py", line 1207, in main
    args.manual_login
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/ui/__main__.py", line 130, in __init__
    loop.run_until_complete(asyncio.gather(*coros))
  File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/ui/__main__.py", line 155, in _connect
    await self._client.connect()
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/client.py", line 138, in connect
    await self._listen_future
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/channel.py", line 197, in listen
    await self._longpoll_request()
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/channel.py", line 298, in _longpoll_request
    await self._on_push_data(chunk)
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/channel.py", line 332, in _on_push_data
    await self.on_receive_array.fire(data_array)
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/event.py", line 59, in fire
    await gen
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/client.py", line 357, in _on_receive_array
    await self._add_channel_services()
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/client.py", line 397, in _add_channel_services
    await self._channel.send_maps(map_list)
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/channel.py", line 233, in send_maps
    'post', CHANNEL_URL, params=params, data=data_dict
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/hangups/http_utils.py", line 65, in fetch
    headers=headers, data=data) as res:
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/aiohttp/client.py", line 1005, in __aenter__
    self._resp = await self._coro
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/aiohttp/client.py", line 476, in _request
    timeout=real_timeout
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/aiohttp/connector.py", line 522, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/aiohttp/connector.py", line 854, in _create_connection
    req, traces, timeout)
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/aiohttp/connector.py", line 974, in _create_direct_connection
    req=req, client_error=client_error)
  File "/home/felix/Downloads/hangups/lib/python3.6/site-packages/aiohttp/connector.py", line 924, in _wrap_create_connection
    await self._loop.create_connection(*args, **kwargs))
  File "/usr/lib/python3.6/asyncio/base_events.py", line 734, in create_connection
    infos = f1.result()
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
TypeError: getaddrinfo() argument 1 must be string or None

Commenting out await self._channel.send.maps(map_list)' in client.py` prevents the crash (but makes hangups not very useful).

Have tested with python-3.5.5 and python-3.6.5.

doughdemon avatar Apr 27 '19 16:04 doughdemon

Not sure what could be causing this.

tdryer avatar May 09 '19 04:05 tdryer

How could I further debug this? The asynchronous nature makes it a bit hard to follow the program.

doughdemon avatar May 09 '19 16:05 doughdemon

You could try attaching the debugger and figure out what the incorrect argument to getaddrinfo is and where it's coming from. It might also be useful to create a script that's as simple as possible but still triggers the problem.

tdryer avatar May 10 '19 03:05 tdryer

Thanks.

import asyncio
import hangups
from pathlib import Path

cookies = hangups.auth.get_auth_stdin(str(Path.home()) + "/.cache/hangups/refresh_token.txt")
client = hangups.Client(cookies)
loop = asyncio.get_event_loop()
task = loop.create_task(client.connect())
loop.run_until_complete(task)

is already enough to trigger the problem.

The host argument to getaddrinfo is the number 10.

doughdemon avatar May 10 '19 18:05 doughdemon

I wanted to use hangups, first time trying it I ran into this same problem gentoo: emerge dev-lang/pip pip install hangups

payonel avatar Oct 21 '19 19:10 payonel