Failed to create HTTP server at port 8123... address already in use

I set up a HA server running on Lubuntu 16.10 in a Virtualbox VM, then used VMWare converter to convert and migrate it to my ESXi host. Following the conversion I shut down the Virtualbox VM and fired up the new VM on my ESXi host. While the Lubuntu O/S booted fine, HA didn’t seem to start correctly. When I checked the status I saw this:

"ERROR (MainThread) [homeassistant.components.http] Failed to create HTTP server at port 8123: [Errno 98] error while attempting to bind on address ('0.0.0.0', 8123): address already in use"

Since the old server is definitely not running I can’t understand the error. Can anyone advise on what the problem might be?

I don’t know if this is relevant, but after rebooting both my router and the new HA VM this message popped up in the VM:

Network service discovery disabled. Your current network has a .local domain, which is not recommended and incompatible with the Avahi network service discovery. The service has been disabled

run sudo netstat -plant |grep 8123 to find out what process is using that port.

That’s an error message that starte popping up on my desktop a few weeks back, just ignore it.

Netstat returns this:
tcp 0 0 0.0.0.0:8123 0.0.0.0:* LISTEN 1842/python3

I just noticed that my original homeassistant VM also shows this message, so I guess this is a red herring. The problem is that I can’t access the homeassistant web console on the new VM (I get “This site can’t be reached”, and this was the only error message that I could find when I checked the status of HA.
Any ideas for how I can diagnose this further? At this stage it seems that HA is running on the new VM but access to the web console is disabled.

I can access the web console if I open a browser on the HA server VM itself, but can’t access it from any other machines on the LAN. I’ve tried both Chrome and Edge browsers (both on Windows 10)

Doh! I just discovered the problem. For some reason the new VM had 2 ethernet adapters defined. I have no idea why, as the machine it was cloned from only had 1. Anyway the 2nd adapter was picking up a DHCP address, and it seemed to override the static address that was configured for the first adapter.
It looks as if the VMWare converter program applied some “smart” logic when it configured networking for the new VM.
Anyway, I deleted the 2nd ethernet adapter and I can now access the web console from other machines on the LAN. Many thanks for your feedback.

Why would you build it in vbox and then convert it and move?

Why didn’t you just build it in esxi?

Why not just run docker where you can move the config from computer to computer and it doesn’t matter?

The answer is that I changed my mind about the target platform. The original intention was to install it on a Linux file/media server that I already have up and running, but to check it out first in a virtual environment, to avoid messing up the existing server if the HA experiment went badly.
As the HA install was more complex than I expected I decided to host it in a standalone VM on my ESXi host.
I’ve never heard of docker, but just googled it and it looks interesting. Are pre-built dockers available with HA pre-installed?

HASSIO actually runs in docker, and there is a home assistant build in docker. Going the Docker route has made the entire home assistant process so much easier for me.

Good grief I wish I had known about that before I started! Would I still have been able to set up and implement an SSL cert for my HASS server if it had been installed in a docker container?

Absolutely. You don’t need the certbot to run IN the same container. The system just needs access to the certificates.

You can do that with bind mounts. Docker is amazing. It really is. You should look into it. It saves so much time. I never have to worry about an upgrade breaking because of dependencies.

1 Like

ERROR (MainThread) [homeassistant.components.http] Failed to create HTTP server at port 8123: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 8123): address in use

My netstat shows,

tcp        0      0 0.0.0.0:8123            0.0.0.0:*               LISTEN      1855/python3    
tcp        0      0 172.30.32.1:8123        172.30.32.2:52122       ESTABLISHED 1855/python3    
tcp        0      0 192.168.1.118:8123      159.255.234.169:55476   ESTABLISHED 1855/python3    
tcp6       0      0 :::8123                 :::*                    LISTEN      1855/python3    

What should I do ? I’m quite noobie on Ubuntu.

Same boat here.

Sorry Thomas,
do you have an solution for this topic.
Is there a hint from you to prevent booting the home-assistant-container and prevent the installation during booting ?

1 Like

I recently became a member in this problem!!! While away on holiday, I found my HA not responsive. Although I can resolve the :4357 Supervisor (all good), there is no way to resolve :8123. Tried just about EVERYTHING. Any help for a relative newbie GREATLY APPRECIATED.