/config must be unique

Keyakinan

Dabbler
Joined
Jul 24, 2018
Messages
39
When trying to mount a volume into /config i get this error. I want to safe my config files outside the container (for obvious reasons).
What is going wrong here and how can I fix it? thanks in advance.

middlewared.service_exception.CallError: [EFAULT] Failed to install chart release: Error: Deployment.apps "sabnzbd" is invalid: spec.template.spec.containers[0].volumeMounts[1].mountPath: Invalid value: "/config": must be unique
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,471
When trying to mount a volume into /config i get this error. I want to safe my config files outside the container (for obvious reasons).
What is going wrong here and how can I fix it? thanks in advance.

middlewared.service_exception.CallError: [EFAULT] Failed to install chart release: Error: Deployment.apps "sabnzbd" is invalid: spec.template.spec.containers[0].volumeMounts[1].mountPath: Invalid value: "/config": must be unique

That error means you already have a dataset to mount to /config. You can't have multiple volumes / datasets mounted to the same endpoint, I.E. /config, inside the container. Otherwise they stack on top of each other and the one mounted first is unused.

You'd instead mount each datasets to a sub-directory, I.E> /config/myfiles & /config/myconfig or something similar to that.
 

Keyakinan

Dabbler
Joined
Jul 24, 2018
Messages
39
That error means you already have a dataset to mount to /config. You can't have multiple volumes / datasets mounted to the same endpoint, I.E. /config, inside the container. Otherwise they stack on top of each other and the one mounted first is unused.

You'd instead mount each datasets to a sub-directory, I.E> /config/myfiles & /config/myconfig or something similar to that.

Thanks for your reaction! This has always worked, same with docker compose. It is in the docs as well.
But when if i mount it to a sub-directory, the configuration will not be automatically saved at the right spot right? When I restart a container it will not load from the sub-directory but from /config?
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,471
Can you share with us what the host volume configuration page looks like in this instance? The issue is that you already have a host-volume on config, and it think's you are trying to mount a 2nd host volume on top of the same one...
 

Keyakinan

Dabbler
Joined
Jul 24, 2018
Messages
39
Can you share with us what the host volume configuration page looks like in this instance? The issue is that you already have a host-volume on config, and it think's you are trying to mount a 2nd host volume on top of the same one...

Not sure if you mean this, this atleast what I try.
 

Attachments

  • Screenshot 2021-10-05 at 18-04-00 TrueNAS - 192 168 2 140.png
    Screenshot 2021-10-05 at 18-04-00 TrueNAS - 192 168 2 140.png
    6.8 KB · Views: 486

shadofall

Contributor
Joined
Jun 2, 2020
Messages
100
answered my own question after looking at the screenshot closer

your using the truecharts sabnzb install,

By Default it creates a PVC based Storage that automaticly mounts to /config (in the case of sabnzbd)

so you cant attach a second hostpath storage to /config

you can change the PVC to a hostpath. but thats an advanced config not really suggested to do as it breaks the rollback feature, and would break some features in the future. and some apps may not like it in a k8s environment
 
Last edited:

Keyakinan

Dabbler
Joined
Jul 24, 2018
Messages
39
answered my own question after looking at the screenshot closer

your using the truecharts sabnzb install,

By Default it creates a PVC based Storage that automaticly mounts to /config (in the case of sabnzbd)

so you cant attach a second hostpath storage to /config

you can change the PVC to a hostpath. but thats an advanced config not really suggested to do as it breaks the rollback feature, and would break some features in the future. and some apps may not like it in a k8s environment
Thanks for your explanation!

Is that the only way to use a external config?
Do you recommend just using another image (like I did before, and worked) and not try it this way?
 

shadofall

Contributor
Joined
Jun 2, 2020
Messages
100
Thanks for your explanation!

Is that the only way to use a external config?
Do you recommend just using another image (like I did before, and worked) and not try it this way?

yes. with truecharts all config paths default to PVC, if you want to use an external path you have to change it.

I've not messed much with the big blue button launching, but its fairly limited.

honestly i stick with the PVCs to avoid issues.
for apps like sonarr/radarr I can just use their internal backups and download them after I make changes/before an upgrade of the image
sabnzbd is just a single config.ini file that needs to be copied. pretty easy to shell in and copy it once I'm done making changes

for apps that arnt as easy (jellyfin), i've taken to mounting an additional host path called /configbackup then shell in and cp the config files to it.

and to edit configs. its not that difficult to shell in and edit a config file if needed.

I havent had to use the Rollback yet my self. but it is kinda nice to know if an app like Sonarr, on its next update reconfigured its DB, but the update was broken, i can just rollback and it would rollback the the DB to its pre upgraded state as well. all with out worrying about my last backup,
with out a PVC that would break.

For something like nextcloud that's really touchy. that rollback feature will be a must i'd say

of course as a backup admin I do deeply understand the desire of file level recovery on top of snapshot recovery

just as of note of clarification the PVC is outside of the container. so its not going to get wiped on an update, the PVC just is not as easily accessible as say shelling in to scale and cd /mnt/pool/path

But it does get deleted if the app is deleted. not 100% sure if a snapshot lingers around or not that could be restored. that's a question to look in to my self
 
Last edited:

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
for apps that arnt as easy (jellyfin), i've taken to mounting an additional host path called /configbackup then shell in and cp the config files to it.

and to edit configs. its not that difficult to shell in and edit a config file if needed.

I havent had to use the Rollback yet my self. but it is kinda nice to know if an app like Sonarr, on its next update reconfigured its DB, but the update was broken, i can just rollback and it would rollback the the DB to its pre upgraded state as well. all with out worrying about my last backup,
with out a PVC that would break.

For something like nextcloud that's really touchy. that rollback feature will be a must i'd say

of course as a backup admin I do deeply understand the desire of file level recovery on top of snapshot recovery
@shadofall is correcthere :)

Thougb there is another backup option:
you can also use local zfs send and zfs recieve, to copy datasets on a fixed schedule to a "backup dataset" that sits out of k8s control, in case you're worried of k8s blowing your stuff up :)
 
Top