Unable to change /downloads for Deluge app

Hi there,

I’m hoping someone can give me a hint on whether this is by design or a bug.

I just made the upgrade from Dragonfish to Electric Eel, and aside from one hiccup everything seems to have gone well.

I do have one issue that is related to said hiccup though. I also posted about it here:

But since this is a separate issue I don’t want to keep spamming that topic.

TLDR: In 24.04 I was already unable to change the “Deluge Downloads Storage” option. But I was able to add a Host Path mount which mounted to /downloads instead. Whether that was intended or a bug that worked in my favour I don’t know.
What I do know however is that this same method does not work in Electric Eel, as upon saving I am presented with this lovely error message:

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 287, 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 317, 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 59, in update_app_config
    render_compose_templates(
  File "/usr/lib/python3/dist-packages/middlewared/plugins/apps/ix_apps/lifecycle.py", line 50, 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/deluge/versions/1.1.8/templates/docker-compose.yaml", line 35, in top-level template code
    {% do c1.add_storage(store.mount_path, store) %}
  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/.ix-apps/app_configs/deluge/versions/1.1.8/templates/library/base_v2_1_14/container.py", line 273, in add_storage
    self._storage.add(mount_path, config)
  File "/mnt/.ix-apps/app_configs/deluge/versions/1.1.8/templates/library/base_v2_1_14/storage.py", line 89, in add
    raise RenderError(f"Mount path [{mount_path}] already used for another volume mount")
base_v2_1_14.error.RenderError: Mount path [/downloads] already used for another volume mount

Obviously I understand why this is happening, but I would really like to change the path this mounts to.

I’ve done a bit of digging already, and I did notice that the deluge app … configuration(?) (for lack of a better term) sets this path to be immutable:

However, I am wondering whether this is intentional or just a mistake that carried over from the old Kubernetes chart.
Of course I can understand that maybe the idea was to protect users from changing the downloads path which would result in “orphaned” files somewhere in the .ix-apps (and users “loosing” their download progress of course), but taking away the ability at all seems extreme for this? A warning what a change entails would probably be enough?

Does anyone have a hot tip for me if or how this path can be changed?

I may be wrong here but you can likely change it from an ixvolume to host path if you reinstall the app.

Why you can’t change it on-the-fly I don’t know, but there have been posted as a recurring issue in the forum.

I’ve considered that, but doesn’t deleting the app also wipe the ixVolume?

It’s an option as you remove the app.
I suggest you don’t check that box.

With that said, I do suggest you get your data out first. Why not copy it to the eventual host mount?

Final edit:
If you have time, please check this feature request out and feel free to cast a vote, it’s related to your issue:

1 Like

Huh, I guess that’s new… I remember when I deleted apps in the past it just yeeted the entire directory in ix-applications, that’s good to know.

There’s nothing in ixVolume for the /downloads, since on 24.04 I had already overriden that to a Host Path, i.e. everything that went to /downloads in the container is already in the Host Path :wink:

What I meant is that deleting the app deleted everything related to the app including its config directories.

I guess the better question is when I delete the app without deleting the ixVolumes, can those then be used for the re-install… I’d hope so :sweat_smile:

Not sure how Deluge is set up, but does it store its configuration files in a seperate ixvolume linked to an in-container /config?

Yes exactly:

So I guess what you’re saying is that I could delete the app, while not removing the ixVolume, and upon reinstalling just use the same name for the ixVolume? Problem is just I don’t know what the current name is :sweat_smile:

I would actually recommend going into your /mnt/.ix-apps/ path and grabbing your configuration files before you do any removing. It’s just less risk something unexpected will happen.

ixVolumes shouldn’t really be used at all except for quick tests and prototyping. You don’t want your config files stored there post reinstall, better create a host path dataset for them also.

TrueNAS essentially defaulting to ixVolumes is unfortunate due to how volatile they can be.

1 Like

Was planning to do that yea. It’s another very odd choice that this dataset is hidden from the UI. Creating a replication task for it requires a) knowing that path in the first place and b) entering that path manually because it doesn’t show up anywhere…
But obviously that’s a separate issue entirely.

While that link is nice, it would have taken me a timemachine to read it when I set this system up with 22.12 :wink:

Probably going to do that yea.

That’s exactly what I’m thinking… if they’re not supposed to be used why are they default and unchangeable.
The default part I get… set it up quick, change it later when it works. Except the changing part is the issue when they are locked in once set…

My experience in reinstalling apps is that’s it’s best to delete the config ixVolume and start completely anew unless it’s an app update that broke the app. Did not have your issue in upgrading Deluge from 24.04.02.5 to truenas 24.10.01 but then I had a working host path for /downloads set before the upgrade.