Community discussions

MikroTik App
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Home Assistant container on RouterOS - fails to extract and start

Mon Jan 13, 2025 11:09 am

Complete rookie when it comes to containers, Docker and DoH, but slowly trying to explore this somewhat blurry terrain...

HW used is RB3011 with ROS 16.2, Sandisk 16GB USB3 stick.
Basically I have followed the guide at
https://help.mikrotik.com/docs/spaces/R ... eAssistant

I start extracting the container using the command
/container/add remote-image=homeassistant/home-assistant:stable interface=veth1 root-dir=/usb1/ha mounts=ha_config envlist=ha_env logging=yes
and I can see the progress of downloading each .tar.gzip file in usb1/pull. After download of each archive CPU rises for a period of time, indicating extraction of archives is performed, but only the almighty Lord above knows where the extracted files are placed..

I have repeated the process quite a few times now, and often the process stops with one small archive (171 bytes) in /usb1/pull and status stuck at "extracting" like this:
MT_HA.jpg
Occasionally the extraction process appears to have completed with container status "Stopped".
However it is not possible to start the container, simply nothing happens, no error message, no log entry.

Root dir for the container is set to /usb1/ha, am I supposed to have files stored there? It is always empty.

Can anyone please shed some light on this?

Will I be better off trying to download and extract the container manually, if possible?
Where do I go to find it?
You do not have the required permissions to view the files attached to this post.
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Re: Home Assistant container on RouterOS - fails to extract and start

Wed Jan 15, 2025 9:21 am

This is my config:
# 2025-01-13 09:29:23 by RouterOS 7.16.2
# software id = ****-****
#
# model = RB3011UiAS
# serial number = ************
/container mounts
add dst=/config name=ha_config src=/usb1/ha_config
/disk
set usb1 media-interface=none media-sharing=no
/interface bridge
add name=bridge-ha
/interface veth
add address=172.19.0.2/24 gateway=172.16.0.1 gateway6="" name=veth1
/port
set 0 name=serial0
/container
add envlist=ha_env interface=veth1 logging=yes mounts=ha_config root-dir=/usb1/ha
/container config
set ram-high=800.0MiB registry-url=https://registry-1.docker.io tmpdir=/usb1/pull
/container envs
add key=TZ name=ha_env value=Europe/Oslo
/interface bridge port
add bridge=bridge-ha interface=veth1
/ip address
add address=192.168.0.200/24 interface=ether10 network=192.168.0.0
add address=172.19.0.1/24 interface=bridge-ha network=172.19.0.0
/ip dns
set allow-remote-requests=yes servers=192.168.0.1
/ip firewall nat
add action=dst-nat chain=dstnat dst-address=192.168.0.200 dst-port=8123 protocol=tcp to-addresses=172.19.0.2
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=192.168.0.1 routing-table=main suppress-hw-offload=no
/system clock
set time-zone-name=Europe/Oslo
/system identity
set name="Home Assistant"
/system logging
add topics=container,debug
And this is the command with which I try to create the container:
/container/add remote-image=homeassistant/home-assistant:stable interface=veth1 root-dir=/usb1/ha mounts=ha_config envlist=ha_env logging=yes
Any help would be highly appreciated, as I am completely stuck :(
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4499
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Home Assistant container on RouterOS - fails to extract and start

Wed Jan 15, 2025 11:08 am

Try using root-dir=usb1/ha (without the leading /).

RouterOS file paths do not start with a /, and while some item (like /container/mount) will ignore a leading slash /... root-dir= is very picky.
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Re: Home Assistant container on RouterOS - fails to extract and start

Wed Jan 15, 2025 12:01 pm

Try using root-dir=usb1/ha (without the leading /).

RouterOS file paths do not start with a /, and while some item (like /container/mount) will ignore a leading slash /... root-dir= is very picky.
Thank you for your reply :D

Tried without the leading "/" but still no cigar.
Extraction stops with the mentioned small .tar.gzip in usb1/pull.
Still no files in usb1/ha :?
MT_HA2.jpg
You do not have the required permissions to view the files attached to this post.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4499
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Home Assistant container on RouterOS - fails to extract and start

Wed Jan 15, 2025 5:09 pm

Hmm. Can you also change tmpdir=usb1/pull in /container/config (settings), to remove that slash too?

If that does not work, you could try to the the "layer-dir" in container settings this specifies where the layers are stored:
/container config set layer-dir=usb1/layers
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Re: Home Assistant container on RouterOS - fails to extract and start

Wed Jan 15, 2025 6:21 pm

Hmm. Can you also change tmpdir=usb1/pull in /container/config (settings), to remove that slash too?

If that does not work, you could try to the the "layer-dir" in container settings this specifies where the layers are stored:
/container config set layer-dir=usb1/layers
Changed paths as per your suggestion:
[admin@Home Assistant] /container/config> pr
      ram-high: 800.0MiB
  registry-url: https://registry-1.docker.io
        tmpdir: usb1/pull
      username: 
      password: 
     layer-dir: usb1/layers
However that did not change the outcome, it stopped after downloading the 171 bytes file, like it normally does.
For some reason the setting layer-dir is only visible in the cli, do you know why it is hidden from the config window in Winbox, and also not mentioned in the MT Container doc?

Regarding removing leading "/"s in pathnames: Tried to do the same to dst param in /container mount, but ROS re-added it automatically.

Here you can see the result of my last attempt.
One subdir is made for each file under usb1/layer, however with no files therein?
Also usb1/ha appears to be empty...
MT_HA3.jpg
I can see that an autosupout was created at the time the process halted..should I send it to MT for investigation?
You do not have the required permissions to view the files attached to this post.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4499
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Home Assistant container on RouterOS - fails to extract and start

Wed Jan 15, 2025 7:39 pm

I can see that an autosupout was created at the time the process halted..should I send it to MT for investigation?
Perhaps a case at support@mikrotik.com. The path and layer-dir= is about the only knobs I know to try here... Make sure to generate a new supout.rif with the current state and include that too.

Sometime RouterOS has trouble processing the OCI metadata in these "multi-platform" images – which has been fixed at various points – but since you're using a valid tag... it really should work. But looks like it isn't.

And, yeah, mounts does want or will add a / slash — why it's so confusing with the /
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Re: Home Assistant container on RouterOS - fails to extract and start

Thu Jan 16, 2025 12:28 pm

I can see that an autosupout was created at the time the process halted..should I send it to MT for investigation?
Perhaps a case at support@mikrotik.com. The path and layer-dir= is about the only knobs I know to try here... Make sure to generate a new supout.rif with the current state and include that too.

Sometime RouterOS has trouble processing the OCI metadata in these "multi-platform" images – which has been fixed at various points – but since you're using a valid tag... it really should work. But looks like it isn't.

And, yeah, mounts does want or will add a / slash — why it's so confusing with the /
Thanks once again, I sent an e-mail to support, then we'll se what they answer :-)
 
User avatar
sch
MikroTik Support
MikroTik Support
Posts: 85
Joined: Tue Feb 26, 2013 1:05 pm

Re: Home Assistant container on RouterOS - fails to extract and start

Thu Jan 16, 2025 12:46 pm

Have you tried to run without "layer-dir: usb1/layers"?
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Re: Home Assistant container on RouterOS - fails to extract and start

Thu Jan 16, 2025 1:08 pm

Have you tried to run without "layer-dir: usb1/layers"?
Yes, that's what I tried until Amm0 suggested to specify it yesterday.
As it is only visible in cli, not in Winbox, and also not mentioned in the docs, I was not aware of it until then.

Do you have any idea why no extracted files show up on /usb1, just the downloaded .tar.gzip achives?
From the behaviour, i.e. delay and CPU usage in between the archives, it looks like it is busy extracting, but no files are visible thereafter.
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Re: Home Assistant container on RouterOS - fails to extract and start

Tue Jan 21, 2025 1:14 pm

MT Support suggested Netinstall to clean things up.
No way I could get the RB3011 visible in Netinstall, despite “ether boot” in display.. so I moved to an RB5009.
Netinstalled 7.17 on it, installed Container package.
Based on at tip in from Amm0 I changed HA from branch “stable” to “latest”, installed HA container and it worked! 😊

Thank you for engaging in my problem, now I'm happier ;-)
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4499
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Home Assistant container on RouterOS - fails to extract and start

Tue Jan 21, 2025 5:34 pm

Based on at tip in from Amm0 I changed HA from branch “stable” to “latest”, installed HA container and it worked! 😊
from viewtopic.php?t=214037#p1120343
# ... add veth and networking config ...
# SSD is at "raid1/" and layer-dir= and tmpdir= explicitly use the "real" disk
/container/config set layer-dir=raid1/layers registry-url=https://registry-1.docker.io tmpdir=raid1/tmpdir
# had to use :latest - otherwise does error
/container add remote-image=homeassistant/home-assistant:latest root-dir=raid1/ha-root interface=veth-ha logging=yes    
and to be clear seeming using "remote-image=homeassistant/home-assistant" does NOT work, the tag must be specified (and match a valid tag on DockerHub), thus the ":latest" at the end.
 
Bomber67
Member
Member
Topic Author
Posts: 414
Joined: Wed Nov 08, 2006 10:36 am

Re: Home Assistant container on RouterOS - fails to extract and start

Wed Jan 22, 2025 7:38 am

and to be clear seeming using "remote-image=homeassistant/home-assistant" does NOT work, the tag must be specified (and match a valid tag on DockerHub), thus the ":latest" at the end.
Here I don't understand you....appearently a "branch" (or what you call it) named "stable" also exists on Dockerhub, the HA guide at https://community.home-assistant.io/t/i ... ers/522428 uses it.
I thought I was on the safe side picking a "stable" and it appeared to start extraction all fine.
But only the "latest" brought me there.

So what is the "stable" edition supposed to be used for?