Truenas user with update problems from old dataset
Hi, thank you for making Immich. We love using it, however have been bit by the upgrade issue with Truenas. I have followed this document for the update: https://main.preview.immich.app/docs/install/truenas/#updating-the-app
However, I am still receiving the error
Error: Invalid upgrade path. For more information, see https://immich.app/errors#typeorm-upgrade
. I usually am pretty good at this stuff, but I've reached this wall a number of times now that I feel I need some assistance to move forward. Truenas sadly does not let us "pick a version between the range of 1.132.0 and 1.136.0" anymore, so I feel like I missed the boat on that migration opportunity big time.
I copied the files from the old dataset to the new dataset, unticked the box, I believe the permissions are correct, and the data storage and postgres storage datasets should be set to the correct locations. /mnt/primary/apps/immich_data
and /mnt/primary/apps/immich/postgres_data
respectively. The first item is the new location where everything was copied to, and the second is the postgres data folder of the old dataset. I was not sure if I need to give the postgres a brand new fresh dataset -- it's possible this is part of the issue I'm having?
I have attached the logs of the server
component upon startup. I think they're too long to inline. I am happy to provide any other information necessary.153 Replies
:wave: Hey @spectrum,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.version upgrade was from
1.7.25 (v1.125.7)
to
1.9.24 (v1.141.1)
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
You did the
Breaking Change
for 1.13X.X ?
Correct way is v1.125.7 -> v.1.13X.X -> 1.141.1
and whats your docker-compose.yml
and .env
file btwI am trying to digest the breaking change link information; is the immich article I linked to not an accurate pathway from what I was trying to do?
And since truenas doesn't give us access to a docker compose or env file, I believe I need to show you part of the
user_config.yaml
, if I understand correctly?
I guess maybe I'm starting to regret having used the truenas apps and not rolling my own docker containers. but since my data is already there, I'm not sure what the best course of action should be
I have no idea how to digest the github link for breaking changes for 1.13X.X. I feel lost in these postsWith a DB Backup you can technically still use Immich in a Docker Container and Restore all Files + DB.
Am i right, @Mraedis ?
So I guess that article I used was not applicable to my situation? :sweat:
I know that the
path
has changed in V.1.13X.X
.
So without your docker-compose.yml
and .env
is "hard" to tell.I'll grab the section of the user_config which I believe is like a docker compose file
my understanding is that this is like a "rendered" docker compose with env applied to the variable spots, so it should technically contain what is needed
Looks like a kinda old
docker-compose.yml
but tbh, never used TrueNAS Apps, so not 100% sure.You need at least one version between 133 and 136 for safe upgrades
truenas has a whole different issue
There's about a gazillion topics about it
Truenas sadly does not let us "pick a version between the range of 1.132.0 and 1.136.0" anymore, so I feel like I missed the boat on that migration opportunity big time.
I suggest you search the help desk for truenas with path issues, as it's literally what I would do
Perhaps it's worth me investing in moving this off to a direct docker setup. I can control the versions that way. However by trying to update via truenas, did that do a partial migration or anything like that? Am I good to do that you think?
There's loads of topics in here that @Xiticks answered with your exact question, @spectrum if you search for his messages you'll find guides 🙂
If you still stuggle I could help
You can convert a TrueNAS app to a composé and then change the version there
Or directly use a custom compose and point the mountpoins to the correct datasets
Thanks I'll give it a try
My mistake was trying to update before my vacation, thinking I was getting only security updates.
Yes, it is recommended to frequently check your apps for updates (at least once a month)
I already guided multiple people to convert to a custom app and then update manually
Afterwards you could reinstall from the catalog, or keep using the custom app
If you need help lmk
if there's a fast track, that would be immensely helpful. I honestly did this to myself with the timeline though, as we leave in like four hours -- so if we can't get it to work, it is on me and i take that accountability
Are you on the latest version of TrueNAS (or at least FangTooth?)
ElectricEel-24.10.2.2
so, I guess not
Aarrff
So the custom button doesn't exist I think
On your Immich app, is there a 3dots menu next to edit?
I have a portainer install, if that helps
If that is the case when you click on it, is there "convert to custom app"
for custom docker composes
I don't believe I have the conversion ability in truenas
Yeah, but the objective here would be to convert Immich to a custom compose, so it's "easier"
ah I see okay
Check, as it is present in Fangtooth
Otherwerwise you could try to firt upgrade to fangtooth

doesnt seem like three dots
Yeah, well so it is present in Fangtooth
I do not know what the risks are of updating the OS at this time and am worried that is a riskier path with the time I have left
Do you have any VMs?
no vms
Well I can't guarantee that it will work 100%, but I never had any issue upgrading
(and you can still rollback, as long as you don't update your zfs pools)
I would give it a shot, it should be relatively fast anyway
I'm giving it a shot, wish me luck.

Yes!
I'm assuming next we go with the conversion
Yes, there you'll be able to change the version used
But as there have been changes in 1.137, you might have to do multiple changes, not only version
okay
that's alright
Also just to make sure to communicate clearly, I did already try to move many of the folders to separate the immich data from the postgres data
some form of:
postgres_data is still in the
/mnt/primary/apps/immich/postgres_data
spotand dit you already change that in the config?
(before converting to custom I meant)
yes before the conversion, I had already done
* "In the Storage Configuration section, untick the Use Old Storage Configuration (Deprecated) checkbox."
* For the Data Storage, select Host Path (Path that already exists on the system) and then select the new dataset you created for Immich data storage, for example, data.
* For the Postgres Data Storage, verify that it is still set to the dataset you created for Postgres data storage, for example, pgData.
(referencing: https://main.preview.immich.app/docs/install/truenas/#updating-the-app )
immich is now converted
I can share the current "custom config"
(I have redacted all passwords)
Yeah, share it, it could help
You could try at lines 396 and 165
to replace v1.141.1 by v1.136.0
(I hope this works, otherwise we will have to go back more in the versions)
Do you remember which version were you on before?
v1.125.7
ok, so it should be fine
okay im gonna change those lines to 136
[EFAULT] Failed 'up' action for 'immich' app. Please check /var/log/app_lifecycle.log for more details
(result of saving)sudo tail /var/log/app_cycle.log
in your truenas terminalof the host machine?
yes
the shell
that's all thats in there :spectr239Think:
but just the machine learning one
what did you replace the version with ?
L 165 is:
ah
the .1
thats on me sorry
try with .0 on both maybe
yeah that lets me move forward; sorry about that
np
okay so it saved, and is stopped. i will start the app so it can run the migrations (hopefully)
do we expect this to "work"? or does it still also need the update to 1.141.1 in order to function?
well it should work
but once it is, you should/could upgrade again to 141
immich.server exited on boot
container logs, something about primary keys
MMMhhh
Good thing is that the migration started
Keep the container running
But "bad thing" is that I don't exatcly know what it is/how to fix it
okay. it seems like the server container is boot looping
ill leave it alone for now
"alternatively first upgrade to 1.132.3" sounds like the ideal case
to avoid manually running sql
shall we try that?
Yep
I hope the rest stays "fine"
:spectr239Plead:
okay wait this looks MORE promising
it's failing on boot
BUT
the error seems more obvious
part of the article above focused on was ensuring there was an
uploads
folderOooh well
but I previously had an
upload
(no s) folder for whatever reasonYeah that's a change in 1.136
so I could rsync uploads back to upload
no no
In your compose, keep 1.132 version, but change lines 416 and 345
replace the /data by /usr/src/app/upload
target: /usr/src/app/upload
ok
those the only 2 changes?yes
maybe it needed to be
/usr/src/app
(one less upload?)No, it should be correct (yes it's strange, that is why it has been changed
Here
can you, from truenas shell do
ls -la /mnt/primary/apps/immich_data/uploads/
So the file exists
and inside immich container?
Could you do ls
well, first do
cd upload
im a little lost, trying to figure this out
singular
upload
no s?
okay I see, inside the container -- might be a little hard because it shuts itself down
Oh
that is the issue
it appears to be hitting that failure point, shutting down, and then trying to restart itself
yeah no problem
2 sec, Im' just checking smth
your rsync command is wrong
/mnt/primary/apps/immich_data/uploads/
should have been upload without the S
so within truenas shell again, you can do
sudo mv /mnt/primary/apps/immich_data/uploads /mnt/primary/apps/immich_data/upload
ooooo
re-reading the article i dont see the S either. now I can't remember what happened to make me want to do that
immich is up!
:yay:
On an old version xD
So now we (you) can update
i will take this progress gratefully lol
yeah that's better than not working
Did the migration finished?
I'm not 100% certain how to verify that, the logs have way more in it now, and I was able to actually view the site/app
Share the logs so I can verify
this is everything in there
Oh yeah, it looks fine
So now, go back to /data instead of the usr
and change version to 136
L 345, 416
L 165, 396
just verifying
yep
And after that, once Immich starts and works you can change the version again to the latest (I believe 1.141.1)
error on startup
Mmmh
might be a non issue
it is reboot looping
can you do that again
but replace with encoded-video instead of upload?
did you replace it in both lines to /data?
going to re-confirm
yes
both lines
And it keeps boot looping? you can't access the immich terminal for x minutes?
correct, it is currently in the exited state
i guess the fact that it's inside of the upload folder is an artifact of before when we had two layers of upload
yeah
On the Immich side you can for create the docker, but wait
I will wait; just need to take a short 5 min break to help my partner get ready (multi tasking this between last minute packing lol)
Remove the healthcheck
(line 389 to 395)
and no problem
okay going to remove (comment out?) the healthcheck
comment yes
This way you can enable it back afterwards
But it should stop the bootlooping (I suppose)
it's not looping, but
server
is exited
I imagine that the goal is that we are able to inspect inside the containerexactly
but you can't? :/
shell wont open for an exited container sadly
idk why it exited still
i would have expected it to remain open with the failed state
Me too 😄
Could you maybe try to enable back the healtchckec and change version to the latest?
I' can't remebmer exactly, but it might have been a change that avoided this falure
(Immich will probably still complain but that is fixable
the health check is gone, oddly enough ...
i would not have expected the comment out to result in a deletion
It should not either -_-
thinking that commenting out would just stay there, i did not save a copy of the healthcheck lines
you shared the whole file without the passwords
ah right ty
You can reuse that
got it, ty
and then bring version up after that right
to... v1.141.0 ?
dicretly 1.141.1
v1.141.1
okay
as 1.141.0 doesn't exist, and the breaking change from 136/137 can be done in 141 if it boots
letting it rip
immich is functioning in the web app
ok nice, but check the logs
Your photos might not load?
photos are viewable; logs show:
So it already migrated the path ? Mmmh
:sweat:
is that a good thing? lol
Hum yes, but I would still run the command to be certain
what command shall we run?

Yes

Ok, that is done now!
Immich is working
do I need to follow the volume mount/etc instructions?
No
okay just restarting it after that change JUST to make sure
Now you can either keep this custom app, or "reinstall" immich from the catalog so you can update it with a simple button
I would also to that haha
i think im keeping this as custom from now on
if i cant trust the simple update button to not break a thing, it is not a simple update button hehe
(i think that is more on truenas's side)
It is simple and generally doesn't break stuff if you do it frequently
and that is on TrueNAS side
I admittedly did not do it often enough; life got in the way etc
Immich isn't responsible for that (and I agree that we should be able to choose the version)
yeah agreed
I'm very grateful for your time effort and assistance
So yeah, custom app
You could/should also use dockge or portainer and use the mode simple compose from Immich (once you're back from your vacation)
And no problem, I'm happy that I was able to help you
Yeah I do want to move to a portainer stack or something like that. I use that for my other apps, immich was just an "early install" on this server before i got more into portainer
I imagine I just need to /close the ticket?
Yes, you can
Btw I do'nt think portainer is recommended for Immich though (saw some issues) you could try dockge on TrueNAS for Immich
Or just use a custom compose
oh huh I didn't realize there were differences
I'll have to research that more when I'm back
thanks again.
This thread has been closed. To re-open, use the button below.