"homeassistant.components.mqtt: Unable to start broker and auto-configure MQTT.
16-07-06 23:34:19 homeassistant.bootstrap: component mqtt failed to initialize
16-07-06 23:34:19 hbmqtt.broker: Broker startup failed: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 1883): only one usage of each socket address (protocol/network address/port) is normally permitted
16-07-06 23:34:19 homeassistant.components.mqtt.server: Error initializing MQTT server
Traceback (most recent call last):
File "C:\Python34\lib\asyncio\base_events.py", line 905, in create_server
sock.bind(sa)
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted"
As per the error looks like you’re trying to bind to a port already in use. Have you checked the netstat output?
Also any one have any idea why my config is getting evaluated as a string? Manually forcing values into the “broker.py” it looks like the service tries to rebind several times. The MQTT does run at this point even though an error is reported.
I’ve tried minimizing the config down as much as possible with no joy. Previously that configuration worked. It’s like there’s something around the "split at ‘:’ " routine that needs addressing so the types don’t get mixed up. As before though even when I do assert the correct types straight into the variables other errors start to pop up. Looking at most configs it appears most people use an external broker so maybe this is a new issue?
Gave up in the end and went back to using Mosquitto.
There seems to be some fundamental problems either in parsing the configuration or starting the embedded server. Even in the default unconfigured state generate_config(hass, passwd): from server.py should generate a working config but this bails out as well.
Hi I am having the same issue. Has anyone found a solution to this issue yet?
I am running Home Assistant on Docker image 0.28.2
Here is my log entry:
16-09-21 09:35:54 homeassistant.components.mqtt.server: Error initializing MQTT server
Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 257, in start
loop=self._loop)
File "/usr/local/lib/python3.4/asyncio/streams.py", line 116, in start_server
return (yield from loop.create_server(factory, host, port, **kwds))
File "/usr/local/lib/python3.4/asyncio/base_events.py", line 946, in create_server
sock.bind(sa)
TypeError: an integer is required (got type str)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/mqtt/server.py", line 53, in start
loop.run_until_complete(start_server)
File "/usr/local/lib/python3.4/asyncio/base_events.py", line 361, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.4/asyncio/base_events.py", line 331, in run_forever
self._run_once()
File "/usr/local/lib/python3.4/asyncio/base_events.py", line 1295, in _run_once
handle._run()
File "/usr/local/lib/python3.4/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/local/lib/python3.4/asyncio/tasks.py", line 308, in _wakeup
self._step()
File "/usr/local/lib/python3.4/asyncio/tasks.py", line 240, in _step
result = coro.send(None)
File "/usr/src/app/homeassistant/components/mqtt/server.py", line 24, in broker_coro
yield from broker.start()
File "/usr/local/lib/python3.4/site-packages/hbmqtt/broker.py", line 279, in start
raise BrokerException("Broker instance can't be started: %s" % e)
hbmqtt.broker.BrokerException: Broker instance can't be started: an integer is required (got type str)
16-09-21 09:35:54 homeassistant.components.mqtt: Unable to start broker and auto-configure MQTT.
Same problem here. I used the all in one installer (0.39.3) on a fresh Raspbian install.
mqtt:
embedded:
Results in:
17-03-09 00:07:44 ERROR (MainThread) [hbmqtt.broker] Broker startup failed: [Errno 98] error while attempting to bind on address ('0.0.0.0', 1883): address already in use
Tried all of the fixes on the links above, including setting the http host to 127.0.0.1, moving the embedded port to 1888. But the one thing I have noticed is that 0.0.0.0:1883 is already in use by Mosquitto - this is not something I’ve installed, but I guess must be in by default.
What I’m completely stuck with is how to stop mosquitto using it? I find mosquitto_pub and mosquitto_sub commands quite useful, which again, must in either HA or Raspbian by default.