Community discussions

MikroTik App
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Home Assistant container does not starts

Mon Jun 24, 2024 10:13 am

I have RB5009 and I want to setup Home Assistant there.
There is a USB flash installed and used for container
[admin@MikroTik] > disk print 
Flags: B - BLOCK-DEVICE; M - MOUNTED
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE
#    SLOT  MODEL                    SERIAL                    INTERFACE                     SIZE
0 BM usb1  Kingston DT microDuo 3C  408D5CBF8874E7A0895E075A  USB 3.20 5000Mbps  248 034 361 344
[admin@MikroTik] > 
I have successfully installed the image
[admin@MikroTik] > container export 
# 2024-06-24 10:11:11 by RouterOS 7.15.1
# software id = 82T1-PVIK
#
# model = RB5009UPr+S+
# serial number = XXXXXXXXX
/container mounts
add dst=/config name=ha_config src=/usb1/ha_config
/container
add envlist=ha_env interface=veth2 logging=yes mounts=ha_config root-dir=usb1/ha
/container config
set registry-url=https://registry-1.docker.io tmpdir=/usb1/pull
/container envs
add key=TZ name=ha_env value=Europe/Kyiv

[admin@MikroTik] > container print 
 0 name="7d52c00c-6c85-439b-9e52-efdcb90a2842" tag="homeassistant/home-assistant" os="" arch="" interface=veth2 
   envlist="ha_env" root-dir=usb1/ha mounts=ha_config dns="" logging=yes status=stopped 


However, whatever I do it does not starts...
No log records appears when I'm trying to start it.

Any ideas how to make it running?
Last edited by smotrov on Mon Jun 24, 2024 10:59 am, edited 1 time in total.
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:20 am

Have you tried enabling logging "container,debug"? Maybe he'll show what he's missing?
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:28 am

Have just logging=yes in the container it salves.
Can you give me a hint how to enable debug logging?
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:34 am

/system logging add topics=container,debug action=memory
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:38 am

Thank you, but does not helps. No records in log after container start 0
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:44 am

Also check if all the points specified in this article are followed.
https://help.mikrotik.com/docs/display/ ... eAssistant
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:49 am

When I'm pulling the image it does shows log records
You do not have the required permissions to view the files attached to this post.
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:52 am

Has the container been downloaded completely? No errors at the end? (this happens sometimes)

Is container mode enabled?
/system/device-mode/update container=yes
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Mon Jun 24, 2024 10:56 am

It it has status "extracting" for a while and I can see how it is pulling layers in the log.
Than the status is tiring into "stopped".

Sure containers are enabled otherwise I won't be able to pull an image.
[admin@MikroTik] > /system/device-mode print 
  mode: enterprise
  container: yes
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Mon Jun 24, 2024 11:03 am

Can you please provide your full configuration?
/export file=config
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Mon Jun 24, 2024 11:03 am

The last message in the log before container status turns to "stop" is
getting layer sha256:aa900376fa4645b30a0d731f2962ade576b143016fc7e8b4d4f12bbd34c30fca
In all other layers such record is followed by downloaded record. But not this one.

Previous layers are like this
getting layer sha256:e0989a23912da051dea50b9091f0c93d4493d425c7b5bd55c88729eaf83b3a08
layer sha256:e0989a23912da051dea50b9091f0c93d4493d425c7b5bd55c88729eaf83b3a08 downloaded
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Mon Jun 24, 2024 11:17 am

Also i think your container is not properly deployed, from your recording it is visible that OS and arch is missing.
name="7d52c00c-6c85-439b-9e52-efdcb90a2842" tag="homeassistant/home-assistant" os="" arch="" interface=veth2 
   envlist="ha_env" root-dir=usb1/ha mounts=ha_config dns="" logging=yes status=stopped 
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Mon Jun 24, 2024 11:18 am

Try removing the container completely. Format USB and try again
 
massinia
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jun 09, 2022 7:20 pm

Re: Home Assistant container does not starts

Mon Jun 24, 2024 11:39 am

I've had the same problem for months, I've never been able to figure out where the problem was.
I tried to format the USB disk also changing the filesystem but nothing to do, it always stops at the same point:
mikrotik ha.png
The file download always stops at 171B
I don't know if it's a ROS bug...
You do not have the required permissions to view the files attached to this post.
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Mon Jun 24, 2024 11:59 am

I'm trying to pull stable image.
Errors a totally random every time.
Some times it pulls arch and os and some times it is not.
I was trying all formats of the flash. With and without MBR.
What is consistent is it is always stuck on this layer.

From it's size I can see it is that one
40.  RUN |1 QEMU_CPU= /bin/ash -o   295.15 MB
In some cases it shows this at the end
was unable to import, container 8e14971f-a423-4ae1-8b05-d584e1568386
You do not have the required permissions to view the files attached to this post.
 
User avatar
marsbeetle
newbie
Posts: 48
Joined: Sun Feb 19, 2023 9:57 am

Re: Home Assistant container does not starts

Mon Jun 24, 2024 12:22 pm

I had issues with my HASS container not starting on my hAP AX3 and after some debugging I determined that I needed to disable jemalloc which is described here - https://www.home-assistant.io/installat ... imizations

You can disable it by simply adding the env variable DISABLE_JEMALLOC=1

Might not be your case but thought it worth mentioning. Runs fine after this is set for me.
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Mon Jun 24, 2024 1:56 pm

You can disable it by simply adding the env variable DISABLE_JEMALLOC=1
Thank you, but it doesn't helps in my case.
If the flash is formatted with MBD it always ends up with error status.
If the flash is formatted without MBD it always ends up with stopped status and not starts no matter what.

(Sure I'm changing path everywhere accordingly usb1/usb1-part1)
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Tue Jun 25, 2024 11:49 am

Try to load as a file. With no luck so far...

After command
/container/add file=usb1-part1/docker/ha_stable.tar interface=veth2 root-dir=/usb1-part1/containers/ha mounts=ha_config envli
st=tz,mem logging=yes 
I see in the log
11:42:18 container,info,debug importing tar archived image: ha_stable.tar
 11:42:18 container,info,debug error getting layer file
 11:42:18 container,info,debug failed to load next entry
 11:42:18 container,info,debug import finished but no image found
However the file created using buildx looks on on the host machine
docker buildx build --platform linux/arm64 -t homeassistant/home-assistant:latest --load .
docker save -o ha_stable.tar homeassistant/home-assistant:latest 
➜  Downloads tar -tzf ha_stable.tar   
blobs/
blobs/sha256/
blobs/sha256/089bcd0e76ff34a78b2d3ea7720796a7c78d56e7905166946deb9ecc15aeb883
blobs/sha256/0b428f02d932bb619d00cb44e832e90bac821ca585b51a723cfd164c7bb97493
blobs/sha256/1ce2b149aa42c9648dea843a1d6a357f243cc98fc6dff3f127ade4a7932977ca
blobs/sha256/2bcb6d9605f15ca89685e17dea0d85c1ec34d74216f0c0f0cef5556d93534206
blobs/sha256/2d9a48781ec1a9e471f32f83780efc4a499e4e5a2d837b8ac10e6c1dd3dfb328
blobs/sha256/31da2b26774818938b6809cd3d46d34e1b64273ea84d91364d6d9729b323b8d1
blobs/sha256/3df2116198045c13b4a5686e1547dc430d41c029907c83f068b8194a96b24b3c
blobs/sha256/3fcdbfacc4a9b25a485e84dfb54712d873b83eda4f7c237135fa60a3b3f41880
blobs/sha256/4938e607b6d78689af7fdeb343e7fc955c317ca7ad1345a0992cb8668c18f866
blobs/sha256/4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
blobs/sha256/5765303681ca44fd73671d2d677816f9ee76a5f138cba58315544f4e5c597e44
blobs/sha256/66b066939690947e97de35014d9346b46f2e7873e20626e99b182bf7273659b0
blobs/sha256/6718b0d2600aa668dffa4ac25c5f2d794a5a978bf96d8afc399d788a5e2f32af
blobs/sha256/6c1deb6d01089cf88e1d430b154a1d1b58aee580e708f7964fc972ac02770455
blobs/sha256/6f5034e08dd7913e475e27e218473a20e6960f071c19db6c5f78eb5ff1e9a82b
blobs/sha256/6fef378a8ecbc81681350e322a5e0a135bd4a81e58dffd9c6426bd6bb6b0c5ed
blobs/sha256/73c5fcf46683d9eca12f93709bc6f49e206bb3f5363c7290878e20b98902c47e
blobs/sha256/7510e47ef9afab6c762b8ff4a33af1b5d9204b50ed7d84beee23bf97b08ed5f0
blobs/sha256/75aa6da3016aef71bd1d129fe2fb667d240c06bfc611079b30d29cccf53e4ac8
blobs/sha256/77024b8c709d61bbdfadde2749d713d23a2fb292112eed377170ab9209588a80
blobs/sha256/79f326c1b5bf84081f88d80457cc50d8399c750836c8d89ae5eaa774b5f441a0
blobs/sha256/97b8596a4cf5199f4185ce8edfd57ada7a58368d6a7faef1ba5a4b4d0e721eb6
blobs/sha256/aa900376fa4645b30a0d731f2962ade576b143016fc7e8b4d4f12bbd34c30fca
blobs/sha256/bac8bb614983e301adbcce34a2c8cda1ee3c05ccafd3724c8bf25fe779f606ca
blobs/sha256/bca4290a96390d7a6fc6f2f9929370d06f8dfcacba591c76e3d5c5044e7f420c
blobs/sha256/bcb19f2aaa8ba275a9b27a2699111c7392c07b2ceec984d99d3ab0a0b002c716
blobs/sha256/c3b6c4007cc2ec1091c55140712b40b9e8fc6c43e261713f6a65e2389ee8211f
blobs/sha256/d0dab9d61593c322f6725686d2bd925a9fa5fc55faad1e75cea7e3345bdc5d97
blobs/sha256/e0989a23912da051dea50b9091f0c93d4493d425c7b5bd55c88729eaf83b3a08
blobs/sha256/e2788bb47bb3bcde9b1f02f81309c24ba64f28d94b5e592bb7d2665ba0f925f7
blobs/sha256/fb64257fde615a7834ae3fb0137d3bafc4411a20fb74d56b99f36d8747d824c6
blobs/sha256/fc06312c1f7a144fec5167a933d18c4e43432dace9386343620095c643e734ae
index.json
manifest.json
oci-layout
 
massinia
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jun 09, 2022 7:20 pm

Re: Home Assistant container does not starts

Tue Jun 25, 2024 1:23 pm

Try to load as a file. With no luck so far...
I also tried to load as file a few weeks ago without success... at this point only MikroTik support can help us, have you already created a ticket?
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Tue Jun 25, 2024 1:39 pm

..only MikroTik support can help us, have you already created a ticket?
No. I do not think they will help with 3rd party software which HA is.
 
massinia
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jun 09, 2022 7:20 pm

Re: Home Assistant container does not starts

Tue Jun 25, 2024 2:00 pm

Out of curiosity I tried now with a hAP ax3 and it works perfectly!
ha2.png
ha1.png
You do not have the required permissions to view the files attached to this post.
Last edited by massinia on Tue Jun 25, 2024 3:03 pm, edited 1 time in total.
 
User avatar
Kanzler
Member Candidate
Member Candidate
Posts: 135
Joined: Wed Oct 05, 2022 6:55 pm
Location: Ukraine

Re: Home Assistant container does not starts

Tue Jun 25, 2024 2:24 pm

I checked on hAP ac3 and everything works. Perhaps something with the RB5009, but I don't have it to check
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Wed Jun 26, 2024 4:35 pm

It is interesting, is anybody has positive experience installing HA on RB5009? :?
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4490
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Home Assistant container does not starts

Wed Jun 26, 2024 5:48 pm

It is interesting, is anybody has positive experience installing HA on RB5009? :?
In a quick test on RB5009 (arm64), I get a layer error (specifically, "error getting layer: resolving error" when downloading a layer). On RB1100Ahx4 (arm/v7), it imports and goes to start.

There is a Traefik container that works fine on same RB5009, so /container is enabled/working otherwise. You might want to try an older tag of HA instead of latest, dunno.

It should work since Mikrotik specifically documents how to set it up: https://help.mikrotik.com/docs/display/ ... eAssistant
 
User avatar
smotrov
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Mon Dec 26, 2022 8:55 pm
Location: Ukraine 🇺🇦

Re: Home Assistant container does not starts

Thu Jun 27, 2024 12:35 pm

Finally make it work... :D
a) Reset docker settings
b) docker pull homeassistant/home-assistant:latest@sha256:17d159928122e6f374bd39b0e75904522bc7d7c2a64e88b248948734e4c4d444 on my host machine
c) docker save -o ha_arm64.tar
d) Upload it to router
e) /container/add file="usb1/img/ha.tar" interface="veth1" envlist="envha" cmd="python3 -m homeassistant --config /config" hostname="homeassistant" workdir="/config" root-dir="usb1/containers/homeassistant" mounts="homeassistant" logging=yes

Now it works and I can access it.
However I have 2 questions to solve

a) I need ffmpeg inside of the docker. It eats like it is not there.
b) The container is in 10.10.0.1 and all my devices are in 192.168.88.1. And it seams like 10.10.0.1 is not visible from within 192.168.88.1. So I can't add the home assistant as a hub to Apple Home so far.

UPDATE:

ffmpeg is there but working with some errors. But it is not related to Mikrotik for sure :-)
 
makrob
just joined
Posts: 4
Joined: Sun Dec 10, 2023 12:44 pm

Re: Home Assistant container does not starts

Sun Jul 28, 2024 8:50 pm

To all:
It is not possible to pull the latest image or even stable image of homeassistant for arm64 on Mikrotik RB5009, because the size of image is more then 1.5GB, but the storage on RB5009 is only 1GB,
you must change your settings in container to use usb disk for pulling-downloading images:
container/config/set tmpdir=usb1/pull
Best regards!
 
allankhouri
just joined
Posts: 1
Joined: Tue Apr 02, 2024 6:10 pm

Re: Home Assistant container does not starts

Tue Aug 20, 2024 2:12 am

Finally make it work... :D
a) Reset docker settings
b) docker pull homeassistant/home-assistant:latest@sha256:17d159928122e6f374bd39b0e75904522bc7d7c2a64e88b248948734e4c4d444 on my host machine
c) docker save -o ha_arm64.tar
d) Upload it to router
e) /container/add file="usb1/img/ha.tar" interface="veth1" envlist="envha" cmd="python3 -m homeassistant --config /config" hostname="homeassistant" workdir="/config" root-dir="usb1/containers/homeassistant" mounts="homeassistant" logging=yes

Now it works and I can access it.
However I have 2 questions to solve

a) I need ffmpeg inside of the docker. It eats like it is not there.
b) The container is in 10.10.0.1 and all my devices are in 192.168.88.1. And it seams like 10.10.0.1 is not visible from within 192.168.88.1. So I can't add the home assistant as a hub to Apple Home so far.

UPDATE:

ffmpeg is there but working with some errors. But it is not related to Mikrotik for sure :-)
Using Docker for windows I got the first command to go thru but not the second listed below
docker pull homeassistant/home-assistant:latest@sha256:17d159928122e6f374bd39b0e75904522bc7d7c2a64e88b24

The error I get is:
PS C:\Users\allan> docker save -o ha_arm64.tar
"docker save" requires at least 1 argument.
See 'docker save --help'.

Usage: docker save [OPTIONS] IMAGE [IMAGE...]

Save one or more images to a tar archive (streamed to STDOUT by default)
 
User avatar
tangent
Forum Guru
Forum Guru
Posts: 1674
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Home Assistant container does not starts

Tue Aug 20, 2024 5:05 am

PS C:\Users\allan> docker save -o ha_arm64.tar

Even if "ha_arm64.tar" wasn't bound as the option to the -o flag, making it unavailable to be interpreted as the "IMAGE" argument, it it isn't an "IMAGE" in the context of that command at all. The -o flag names an OCI image archive, not the same thing. The "save" command wants the actual input image name:

docker save -o ha_arm64.tar homeassistant/home-assistant:latest

Beware the documented limitations of the HASS container. I faced this decision myself just yesterday, and while I found lack of one-click upgrades of little concern — the container engine handles that for you — lack of add-on support and broken backups doesn't work for me at all. I went with the HAOS VM image instead, now running on my NAS.
 
Fozzie
just joined
Posts: 3
Joined: Wed Sep 25, 2024 8:41 am

Re: Home Assistant container does not starts

Fri Sep 27, 2024 10:24 am

Has anyone found a solution to this problem. The image is showing in usb1/pull as a tar.gzip file, was around 300mb but now showing as 171B.
I am using Mikrotik L009 which supports container and advertises that it supports home assistant.
I am following the Mikrotik instructions to the letter.

Any help would be appreciated.
 
massinia
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jun 09, 2022 7:20 pm

Re: Home Assistant container does not starts

Sun Oct 13, 2024 1:24 pm

was around 300mb but now showing as 171B.
See my previous message:
viewtopic.php?t=208697&sid=87d3bc06e309 ... a#p1082019

I have the same problem with hAP ac2 and I have never been able to understand the cause.
 
foegra
just joined
Posts: 20
Joined: Wed Jan 31, 2024 6:53 pm

Re: Home Assistant container does not starts

Tue Dec 24, 2024 12:10 am

having same problem with caddy image on my hap ax3. worked for almost a year with no problem, but now - it manages to pull container every 5th time, otherwise - error.