Docker - What the hell just happened?

Debian 5.1 and docker 20 install running for years! Until today.

I was updating my frigate install in docker and things got a bit weird with my home assistant docker. Cameras wouldn’t load, the log file was seeing uncaught errors with firefox. CPU Utilisation maxed out.

Usually weird is sorted by restarting the container. But the HA container wouldn’t start.

Opening the home-assistant.log I see one line

/init: exec: line 39: illegal option --

That’s it.

So I removed the container and image, and restarted with a fresh download, exactly the same problem.

I tried restarting other containers including frigate, zb2mqtt,zwjs all running no problem.

Thinking I must have done something dumb in the config files. I restart the container pointing to a clean directory.

/init: exec: line 39: illegal option --

This is getting frustrating.
I reinstall docker - same problem and error
I backup and purge the docker /var/lib folder
Reinstall docker
Run HA pointing to an empty directory

/init: exec: line 39: illegal option --

I fire up another system running ubuntu
Install docker 25.0,
run the docker run command…and guess what ?

/init: exec: line 39: illegal option --

Exactly the same problem and error. On a completely different system with a completely clean install.

So I’m back to living in my house like a peasant while trying to work out why home assistant won’t run in my home !

Any suggestions gratefully received, I contribute a bit over a /r/home-assisting so hoping I’ve earned enough karma for a bit of help!

Cheers

I believe there is a post floating about somewhere about downgrading docker, until this is fixed.

What Andrew said. There is snafu related to Docker as of late. Related to the Docker version.

I’ve seen that, something to do with supervisor ?

Well my main host that first showed the problem is a bit out of date on Debian bullseye and docker is version Docker version 20.10.5. The ubuntu system is on docker 24.

So, I’m not using docker 25.

So hmmm.

The minimum supported version is currently 20.10.17, why I couldn’t say, I run HAOS.
The only vaguely related errors I can find online, are from people editing a docker-compose file with Windows and uploading it to a linux host, but forgetting to set the line endings to Unix instead of the default Windows - which upsets Linux greatly.

I’ve seen the same posts.

Tried running the docker container as root, same problem.

I have another couple of systems I can try it on tomorrow.

Thanks for the input!

1 Like

Good morning.

Still no working HA and no idea why.
Today - so far

Update the server from bullseye to bookworm.
Started HA with the already downloaded image:

/init: exec: line 39: illegal option --1

Removed container and image and downloaded a ‘fresh’ image

/init: exec: line 39: illegal option --1

Fired up wsl debian on a windows machine
installed docker
run the ha start script

/init: exec: line 39: illegal option --1

The start script has not been changed!

Installed docker on my desktop Debian Bookworm again.
Installed HA

/init: exec: line 39: illegal option --1

Here’s the ha script to start the docker container:

docker run \
  -d \
  --name="home-assistant" \
  --net=host -p 8123:8123 \
  --log-opt max-buffer-size=100m \
  --privileged \
  -v /run/dbus:/run/dbus:ro \
  -v /home/hass/.homeassistant:/config \
  -v /etc/localtime:/etc/localtime:ro \
  ghcr.io/home-assistant/home-assistant:latest \
  # homeassistant/home-assistant:latest

SOLVED

I still do not understand why a script that has been running for years would suddenly stop working. Nothing was updated apart from the frigate container!

So the problem was the script starting home assistant.

It used to look like this :

docker run --restart always -d \
	--name="home-assistant" \
	-v /run/dbus:/run/dbus:ro \
	-v /home/hass/.homeassistant:/config \
	-v /etc/localtime:/etc/localtime:ro \
	--net=host -p 8123:8123 \
    ghcr.io/home-assistant/home-assistant:latest

#	homeassistant/home-assistant:stable

And it used to work, goddamit!

So I changed it to reflect the instructions on the home assistant site :

and it now looks like this :

docker run -d \
  --name homeassistant \
  --privileged \
  -e TZ=Europe/London \
  -v /home/hass/.homeassistant:/config \
  -v /run/dbus:/run/dbus:ro \
  --network=host \
  ghcr.io/home-assistant/home-assistant:latest \
  # homeassistant/home-assistant:latest
#  --log-opt max-buffer-size=100m \
#  --restart=unless-stopped
#  -v /etc/localtime:/etc/localtime:ro \

And of course everything is back to normal again.

Speechless … actually not speechless, swearing a lot…

1 Like

Not certain if you are an experienced admin or just a tech user. If you do not follow guidelines as tech changes things might no longer work as expected. Because something works outside guidelines today, does not mean it will work forever.

Most admins learn this the hard way. You just had first person experience of what happens when you do your own thing instead of following guidelines or ignoring changes as tech develops.

Workarounds are not you best fiend long term either.

1 Like

You are overriding the command with something that is invalid.

  ghcr.io/home-assistant/home-assistant:latest \
  # homeassistant/home-assistant:latest

Backslash at the end of the line means that the command continues on the next line.

    ghcr.io/home-assistant/home-assistant:latest

#	homeassistant/home-assistant:stable

Of course this used to work because it doesn’t have a backslash after the image name, overriding the command.

1 Like

I’ve been using linux for 15+ years at the compiling kernel level, so, yeah, sort of admin-ey. And if anything had changed, if I’d updated the HA image or changed the script, I’d absolutely agree with you, but in this instance, as far as I can see nothing changed except the frigate image update, and the script stopped working when it used to.

Anyway lesson learned. Go back to the docs if all else fails!

I’d agree with except the new script has the same # comments after the last \ and it works !

The two changes I can see are :slight_smile:

#  --log-opt max-buffer-size=100m \
#  -v /etc/localtime:/etc/localtime:ro \

Removing these lines and adding the correct TZ environment variable

Thanks for the input!