makerspace / memberbooth

Displaying member info on a public machine
2 stars 0 forks source link

Crashes continuously on boot if there is network problem #79

Closed emanuelen5 closed 4 years ago

emanuelen5 commented 4 years ago

Version

b5e216a

Stack trace:

2020-10-05 20:23:59,890 INFO [/home/memberbooth/memberbooth/src/gui/states.py:30]: Processing current state: WaitingForTokenState
2020-10-05 20:24:02,985 INFO [/home/memberbooth/memberbooth/src/util/token_config.py:45]: Client logged in
2020-10-05 20:24:33,831 ERROR [/home/memberbooth/memberbooth/memberbooth.py:78]: Traceback (most recent call last):
  File "/home/memberbooth/memberbooth/memberbooth.py", line 74, in main
    app.run()
  File "/home/memberbooth/memberbooth/src/gui/states.py", line 382, in run
    self.slack_client.post_message_alert("Application was restarted!")
  File "/home/memberbooth/memberbooth/src/util/slack_client.py", line 53, in post_message_alert
    self.post_message("@channel - " + msg)
  File "/home/memberbooth/memberbooth/src/util/token_config.py", line 65, in require_configured_wrapper
    return f(self, *args, **kwargs)
  File "/home/memberbooth/memberbooth/src/util/slack_client.py", line 39, in post_message
    self._post_message(msg)
  File "/home/memberbooth/memberbooth/src/util/slack_client.py", line 32, in _post_message
    link_names=True)
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/slack/web/client.py", line 559, in chat_postMessage
    return self.api_call("chat.postMessage", json=kwargs)
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/slack/web/base_client.py", line 171, in api_call
    return self._event_loop.run_until_complete(future)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/slack/web/base_client.py", line 214, in _send
    http_verb=http_verb, api_url=api_url, req_args=req_args
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/slack/web/base_client.py", line 244, in _request
    async with session.request(http_verb, api_url, **req_args) as res:
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/aiohttp/client.py", line 504, in _request
    await resp.start(conn)
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 860, in start
    self._continue = None
  File "/home/memberbooth/memberbooth/lib/python3.7/site-packages/aiohttp/helpers.py", line 596, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
emanuelen5 commented 4 years ago

Reduce timeout time and catch TimeoutError