synesthesiam/homeassistant-satellite

Instant crash with the latest version

Closed this issue · 3 comments

Currently getting this error with the latest version from master and the application instantly exits (even when the token or ip isn't valid):

joe@raspberrypi:~/Documents/homeassistant-satellite $ script/run --host 192.168.2.39 --token toto
/home/joe/Documents/homeassistant-satellite/homeassistant_satellite/__main__.py:500: RuntimeWarning: coroutine 'main' was never awaited
  main()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Tried a old version with checkout bb2d930 and I'm getting the expected behavior instead:

 line 988, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.2.39:8123 ssl:default [Connect call failed ('192.168.2.39', 8123)]

Is the error reproducible on your side ?

I just experimented a little with the error and it looks like towards the very end of the main.py file "asyncio.run" was accidentally removed from running the main function. I'm not set up to easily do a PR, but the very end should look like:

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        pass

Should be fixed through 2ef6d12

The commit 2ef6d12 fixed it for me. Thanks !