ConnectionRefusedError kills Mycroft's start process

Is anyone else seeing error messages like this on (re)start? I’m running into this intermittently, but generally if I stop the Docker container (not remove the container, just stop it) and then start it again, this is more likely to happen.

I have a Mark 1 on my desk that dies on the regular. Could this be what’s causing it?

mycroft_1  | 2020-05-23 19:27:53.553 | ERROR    |    63 | mycroft.messagebus.client.client:on_error:81 | === ConnectionRefusedError(111, 'Connection refused') ===
mycroft_1  | Traceback (most recent call last):
mycroft_1  |   File "/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_app.py", line 254, in run_forever
mycroft_1  |     proxy_type=proxy_type)
mycroft_1  |   File "/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_core.py", line 220, in connect
mycroft_1  |     options.pop('socket', None))
mycroft_1  |   File "/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_http.py", line 120, in connect
mycroft_1  |     sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
mycroft_1  |   File "/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_http.py", line 190, in _open_socket
mycroft_1  |     raise err
mycroft_1  |   File "/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_http.py", line 170, in _open_socket
mycroft_1  |     sock.connect(address)
mycroft_1  | ConnectionRefusedError: [Errno 111] Connection refused
mycroft_1  | 2020-05-23 19:27:53.556 | ERROR    |    63 | mycroft.messagebus.client.client:on_error:88 | Exception closing websocket: ConnectionRefusedError(111, 'Connection refused')
mycroft_1  | 2020-05-23 19:27:53.557 | WARNING  |    63 | mycroft.messagebus.client.client:on_error:91 | Message Bus Client will reconnect in 5 seconds.

I have the same error:

Traceback (most recent call last):
File “/opt/mycroft/mycroft/messagebus/client/client.py”, line 84, in on_error
self.emitter.emit(‘error’, error)
File “/opt/mycroft/.venv/lib/python3.6/site-packages/pyee/init.py”, line 178, in emit
raise args[0]
File “/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_app.py”, line 254, in run_forever
proxy_type=proxy_type)
File “/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_core.py”, line 220, in connect
options.pop(‘socket’, None))
File “/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_http.py”, line 120, in connect
sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
File “/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_http.py”, line 190, in _open_socket
raise err
File “/opt/mycroft/.venv/lib/python3.6/site-packages/websocket/_http.py”, line 170, in _open_socket
sock.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

I setup the Mycroft docker on Debian 9. I’m trying to find some kind of solution, but I don’t have any luck for now.

Well at least I’m not alone. I’m afraid I don’t yet know much about the Mycroft internals, but I have a feeling this might have something to do with the message bus framework as it uses a websocket to do the work.

I make a little progress. I installed `PulseAudio:
https://www.freedesktop.org/wiki/Software/PulseAudio/ and the error was fixed. But still,I can’t figurate out why Mycroft doesn’t response. If you don’t have PulseAudio in your system, installed and try again.

I also had this issue. In my case, this turned out to be a permission problem with /var/log/mycroft/ and /tmp/mycroft. Anyone finding this in the future should make sure the user running mycroft has write access to those directories.