How to remigrate or dump "person" table
Hello all, I've done some digging and I think I understand this issue and how to resolve it, but I will need a little assistance.
I am running Immich via docker. I've attached the logs from the
immich_server
container as well as the immich_postgres
containers. I believe the issue is that a section of the "person" table is corrupted, resulting in this memory allocation error; obviously I cannot allocate 18446744057.229267 GB of RAM.
If possible, I'd like to fix this issue by wiping the "person" database, or at least a section of it, and I am not concerned about losing "person" or related face recognition data. Unfortunately, I've checked my $UPLOAD_LOCATION/backups
directory and there are no backups listed there, despite having enabled backups (screenshot attached).
Please let me know if there's any additional information I can provide. I believe the database corruption could be due to me performing a hard power reset of the machine due to other issues.
Thank you for your help!18 Replies
:wave: Hey @msc5,
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.
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:Try taking a backup manually
I'm guessing it errors out for this same reason
I think you should be fine to just delete & recreate the person table, then rerun the jobs, but I'm not entirely sure about the details so I'll tag in @sogan for that 😇
It doesn’t error out but it only creates a 4Kb file so I’m thinking something else is wrong
When I try to create a backup manually that is
The "reset" option for face detection in the job panel will truncate the table and re-process all assets. That might fix the issue
I believe this fails due to the same error. Here' s the logs:
Oh, it doesn't actually truncate anymore. It does a filtered delete + vacuum to avoid deleting faces sourced from metadata
Try
TRUNCATE asset_faces CASCADE;
I think that's worked. Now I can just re-scan for faces and do that all over again, thanks!
No problem!
I would be very cautious in that there is probably other corruption in your database, FWIW
so keep a close eye to see if dumps are able to be taken now
Hm, I think that running the "reset" job on face detection results in "No People" being shown on the people page
Seems like the table is still empty as well
It's processing assets right now. The facial recognition part will come once it's finished with face detection
Sorry, one more update. Faces now are working and re-generated, all I have to do is add names back. The
immich_postgres
services is failing healthcheck though, and here's what happens when I try to run a manual backup:
^
Unlikely that this is recoverable IMO
I see
Well thank you for the help anyways
It’s possible someone else has some ideas
But that error indicates missing data in a way that’s not easily fixable
Check your storage’s health. The thing the DB wrote isn’t being read back the same, so this might be happening with other data as well