Unable to Install Home Assistant as a Custom App via YAML

Here’s the yaml, straight out of the docker compose file used successfully on my Ubuntu server>

version: '3.0'

services:

  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - mnt/Apps/AppData/HomeAssistant/Config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host
    environment:
      - TZ=Europe/London

However, when using this to install HA as a custom app using yaml, I receive the following error>

[EFAULT] Failed 'down' action for 'homeassistant' app, please check /var/log/app_lifecycle.log for more details

more info…

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 509, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 556, in __run_body
    rv = await self.middleware.run_in_thread(self.method, *args)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1367, in run_in_thread
    return await self.run_in_executor(io_thread_pool_executor, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1364, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/service/crud_service.py", line 268, in nf
    rv = func(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 55, in nf
    res = f(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 183, in nf
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/crud.py", line 185, in do_create
    return self.middleware.call_sync('app.custom.create', data, job)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1665, in call_sync
    return methodobj(*prepared_call.args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/custom_app.py", line 88, in create
    raise e from None
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/custom_app.py", line 78, in create
    compose_action(app_name, version, 'up', force_recreate=True, remove_orphans=True)
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/compose_utils.py", line 36, in compose_action
    compose_action(app_name, app_version, 'down', remove_orphans=True)
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/compose_utils.py", line 57, in compose_action
    raise CallError(
middlewared.service_exception.CallError: [EFAULT] Failed 'down' action for 'homeassistant' app, please check /var/log/app_lifecycle.log for more details

I’m relatively new to TrueNAS, having only just installed TrueNAS Scale ElectricEel-24.10.1, so any help is much appreciated. Thanks

Why don’t you use the homeassistant app?
For homeassistant I personally set up a VM to run HAOS.
You can find a guide here:

What does the lifecycle log show?

Thanks for your replies.

Managed to achieve this using the custom app wizard, then making any required adjustments via Portainer.
I think the yaml option needs another look by the devs to get it working. Or else, just give us an option to store and run docker-compose file from the UI.

@Nordlicht-13 Yes, I could just install the app, but I’ve also other containers with this problem, which don’t have app alternatives available. Also, as I manage everything from Portainer, I don’t like the clutter of orphan containers the apps seem to leave laying around after they’ve started. Not sure Why these are required even.
example>