truenas / apps

GNU Lesser General Public License v3.0
74 stars 22 forks source link

cannot deploy home assistant with usb device #539

Closed blaineoliver closed 1 month ago

blaineoliver commented 1 month ago

I have tried to deploy home assistant on TrueNAS-SCALE-ElectricEel-BETA - TrueNAS SCALE ElectricEel 24.10 BETA

The deployment has an error if I try to add device /dev/ttyUSB0 to the container. It will deploy fine without the device, however I need this for my HA config. I assume theres a typo but I cannot see what it is.

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/middlewared/job.py", line 469, in run await self.future File "/usr/lib/python3/dist-packages/middlewared/job.py", line 513, in __run_body rv = await self.middleware.run_in_thread(self.method, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1356, 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 1353, 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 265, in do_update app = self.update_internal(job, app, data, trigger_compose=app['state'] != 'STOPPED') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/crud.py", line 295, in update_internal update_app_config(app_name, app['version'], new_values, custom_app=app['custom_app']) File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/ix_apps/lifecycle.py", line 57, in update_app_config render_compose_templates( File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/ix_apps/lifecycle.py", line 48, in render_compose_templates raise CallError(f'Failed to render compose templates: {cp.stderr}') middlewared.service_exception.CallError: [EFAULT] Failed to render compose templates: Traceback (most recent call last): File "/usr/bin/apps_render_app", line 33, in <module> sys.exit(load_entry_point('apps-validation==0.1', 'console_scripts', 'apps_render_app')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/catalog_templating/scripts/render_compose.py", line 47, in main render_templates_from_path(args.path, args.values) File "/usr/lib/python3/dist-packages/catalog_templating/scripts/render_compose.py", line 19, in render_templates_from_path rendered_data = render_templates( ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/catalog_templating/render.py", line 36, in render_templates ).render({'ix_lib': template_libs, 'values': test_values}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1301, in render self.environment.handle_exception() File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "/mnt/.ix-apps/app_configs/home-assistant/versions/1.2.13/templates/docker-compose.yaml", line 126, in top-level template code devices: {{ ix_lib.base.resources.get_devices(values.resources, values.home_assistant.devices) | tojson }} ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/.ix-apps/app_configs/home-assistant/versions/1.2.13/templates/library/base_v1_1_2/resources.py", line 77, in get_devices host_device = device.get("host_device", "").rstrip("/") ^^^^^^^^^^ AttributeError: 'str' object has no attribute 'get'

blaineoliver commented 1 month ago

i've temporarily worked around this by adding the device in via portainer to the container.