Errors after the latest update

Setup: Docker Swarm on multiple nodes (including a Synology NAS)
36 Replies
ExtremeInspection
ExtremeInspectionOP•3y ago
Error log from immich_server
Alex Tran
Alex Tran•3y ago
Can you post your setup? Also if you bring down and bring up the whole stack again, would it help?
ExtremeInspection
ExtremeInspectionOP•3y ago
I tried that multiple times, after prune buit that didn't seem to help
Alex Tran
Alex Tran•3y ago
Ah it seems to have an issue with migrations @Zack @jrasm91 do you guys have any pointers?
Zack
Zack•3y ago
That's very odd The database is somehow in an unexpected state, where shared_links doesn't exist where it is expected to Wait... That's saying the entire shared_links table doesn't exist @ExtremeInspection have you ever gone into your database and manually changed anything?
ExtremeInspection
ExtremeInspectionOP•3y ago
Nope. I'm not that adventurous 🙂
Zack
Zack•3y ago
Well I'm really not sure how that table could be missing Do you know how to connect to a database and run queries?
ExtremeInspection
ExtremeInspectionOP•3y ago
Yes I can do that
Zack
Zack•3y ago
If you could connect then run describe on the shared_links table I believe \d shared_links is shorthand for that which should work Make sure you're in the immich database context before running it
ExtremeInspection
ExtremeInspectionOP•3y ago
Did not find any relation named "shared_links".
Zack
Zack•3y ago
Yea, that makes sense... Hmmm
jrasm91
jrasm91•3y ago
Can you restart the stack?
Zack
Zack•3y ago
What version did you just upgrade from? They've already done that, if TypeORM is trying to apply this migration, it's because it believes all previous ones have been applied correctly
jrasm91
jrasm91•3y ago
Maybe try starting only the server container
Zack
Zack•3y ago
But somehow the shared links table is missing Could you run \d user_token for me?
ExtremeInspection
ExtremeInspectionOP•3y ago
I'm not too sure.. I have an auto-update set up with Shepherd.. I can look up the version with the signatures, if it is important
Zack
Zack•3y ago
If you've been keeping up with the versions, it's not that important. I was just wondering if it jumped a bunch of versions at once somehow Although even that shouldn't cause a problem
ExtremeInspection
ExtremeInspectionOP•3y ago
immich=# \d user_token ERROR: cache lookup failed for relation 16410
Zack
Zack•3y ago
Uhhh That's a scary error, lemme look up what that means Can you shut down the server and microservice instances then try run the command again? Could you also retrieve the postgres server logs? I notice you are using NFS for your underlying filesystem. Is this setup with async or sync on fstab?
ExtremeInspection
ExtremeInspectionOP•3y ago
Just tried... Same error immich=# \d user_token ERROR: cache lookup failed for relation 16410
Zack
Zack•3y ago
FYI I have about 10 minutes before I need to head off This one is the most important question
ExtremeInspection
ExtremeInspectionOP•3y ago
nfs: driver: local driver_opts: type: "nfs4" o: addr=10.20.11.5,rw,nolock device: ":/volume1/Docker-Data/immich"
Zack
Zack•3y ago
Have you had any issues with the server hosting the NFS share going down, or the connection between the servers being unstable? It looks like the connection is over your local LAN so probably only the former is relevant
ExtremeInspection
ExtremeInspectionOP•3y ago
Double checked on the server side.. It is set to async
Zack
Zack•3y ago
Ah Async makes things faster but is much more prone to corruption or data loss Due to it not finishing writing to the actual server before responding saying everything is done Basically, what I think has happened is some kind of data corruption. I'm not sure how else the database could be in this state. Our migration software believes it has created this table and is on a later script. postgres stores tables in seperate files, so I believe it's possible that the migration table wasn't affected but the shared_links table has been deleted in the underlying storage
Zack
Zack•3y ago
I'm not sure how else to diagnose this really. My suggestion would be to start fresh and re-import your assets (and probably don't run postgres over NFS) However, if you did want to try and repair your current setup, you could do so by manually running the scripts to create the shared links table
ExtremeInspection
ExtremeInspectionOP•3y ago
I can try that route
Zack
Zack•3y ago
Oh god Yes your database is fucked 🤣 That log is full of permanent write errors
ExtremeInspection
ExtremeInspectionOP•3y ago
😄 Alright.. rebuilding the db then
Zack
Zack•3y ago
Good to know my educated guess was bang on 🤣 So I would suggest spinning up a new immich cluster, and using the CLI to import all the files from the old storage folder And probably disable the async option for NFS Or even better, don't use NFS for your database storage xD
ExtremeInspection
ExtremeInspectionOP•3y ago
Well.. I'm running a docker swarm with storage on a NAS for HA... Let me see how best to handle this... For import via CLI is there a CLI for immich that you are referring to here?
Zack
Zack•3y ago
Yea, there is a cli tool with a docker image for running it There is documentation on the docs site I think there may be an issue with it since the latest version,but it may have been fixed already Yea, that bug is already fixed. Anyway I have to head to bed, good luck with the re-build!
ExtremeInspection
ExtremeInspectionOP•3y ago
Thank you. Let me spend some time to go through that. Thanks for the help though!!

Did you find this page helpful?