Error running Home assistant container on Raspberry Pi OS Lite

Hi everyone,

I am on rapsberry pi 3 and I have used home assistant with this raspberry in the past, but I needed to make a clean install and now it is not working.
With this command , the container restarts all the time:

docker run -d --name="home-assistant" --restart unless-stopped -v /config-hass-config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant

the “docker log” says the following:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/src/homeassistant/homeassistant/", line 331, in <module>
  File "/usr/src/homeassistant/homeassistant/", line 281, in main
    args = get_arguments()
  File "/usr/src/homeassistant/homeassistant/", line 64, in get_arguments
    import homeassistant.config as config_util
  File "/usr/src/homeassistant/homeassistant/", line 19, in <module>
    from homeassistant import auth
  File "/usr/src/homeassistant/homeassistant/auth/", line 18, in <module>
    from .mfa_modules import MultiFactorAuthModule, auth_mfa_module_from_config
  File "/usr/src/homeassistant/homeassistant/auth/mfa_modules/", line 12, in <module>
    from homeassistant import data_entry_flow, requirements
  File "/usr/src/homeassistant/homeassistant/", line 14, in <module>
    import homeassistant.util.package as pkg_util
  File "/usr/src/homeassistant/homeassistant/util/", line 13, in <module>
    import pkg_resources
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/", line 74, in <module>
    from pkg_resources.extern import appdirs
ValueError: source code string cannot contain null bytes
[finish] process exit code 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

I have tried with multiple config locations and several container versions and the error is always the same.



  • run container without your configuration mounted to check if it is cause by your configuration
  • run container from image Docker Hub to check, if it’s cause by the image.

Thanks for the reply!


docker run -d --name="home-assistant" --restart unless-stopped  -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/raspberrypi3-homeassistant:stable

returns the same error

Sorry, out of ideas.

ehe thanks anyway!

The documentation says that you should use this:

docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -v /PATH_TO_YOUR_CONFIG:/config \
  --network=host \

I remember getting some weird errors when I tried running it without --privileged, so you might want to try adding that. I haven’t investigated it further, although I probably should have. I don’t like running Home Assistant as root inside a privileged container…

docker run  --name homeassistant  --privileged --restart=unless-stopped   -e TZ=PT   -v /PATH_TO_YOUR_CONFIG:/config   --network=host 

returns same error as well

with raspberrypi-3-homeassistant as well


docker pull

before you run it. The stable tag might not be what we think it is.

i did that and it returned that the image was already available, so i imagine it was correct…