As we all already know, in ElectricEel, if you want to update an app that is not running you get this error message:
[EFAULT] In order to upgrade an app, it must not be in stopped state
Since this is not a bug (NAS-133168) but intended behaviour, I’m interested in understanding why is it build this way? What is the reasoning behind it?
With other systems and Docker in general this is not a requirement.
This doesn’t really answer the question. No, you don’t want your database to suddenly go out to lunch and restart while the application is running, so why is doing so required by TrueNAS?
The safest way to do that would be to ensure they are turned off before applying the update. [emphasis mine]
Right, this makes sense, except that the subject here is:
As we all already know, in ElectricEel, if you want to update an app that is not running you get this error message: [emphasis mine]
So if it’s safer to turn services off before upgrading (which makes sense to me), then why is this not allowed? TN requires that services be turned on to upgrade them. That’s why brankko is asking this question.
Just to add, when you set up your docker-compose services in Dockge, it’s normal to upgrade them when they’re not running, unlike TrueNAS.
I’m actually not sure either, but I am not an expert.
This error message is generated here in the code:
These code comments exist:
# In order for upgrade to complete, following must happen
# 1) New version should be copied over to app config's dir
# 2) Metadata should be updated to reflect new version
# 3) Necessary config changes should be added like context and new user specified values
# 4) New compose files should be rendered with the config changes
# 5) Docker should be notified to recreate resources and to let upgrade to commence
# 6) Update collective metadata config to reflect new version
# 7) Finally create ix-volumes snapshot for rollback