I
Immich•23h ago
AstroB

Removed all photos, still have data

Hey. I removed all my photos from inmich but I still have 804 MB of data in my data directory. Encoded videos, thumbs and uploads of a specific UUID. How can I get rid of it and why doesn't that happen automatically?
35 Replies
Immich
Immich•23h ago
:wave: Hey @AstroB, 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. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: 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.
Mraedis
Mraedis•21h ago
How did you remove your files? Try to empty the trash if you didn't
AstroB
AstroBOP•20h ago
I emptied it All photos were on an external library I removed all files in that external library I actually just now cleaned my internal "data" directory
Mraedis
Mraedis•20h ago
Do you have multiple users perhaps?
AstroB
AstroBOP•20h ago
Yeah that's an interesting point My old username was "admin" And I changed it And the leftover stuff was under "admin"
Mraedis
Mraedis•20h ago
You changed the username or the storage template label?
AstroB
AstroBOP•20h ago
Username I don't think I messed with any template label? I did configure the storage template iirc i don't think a username is part of it
Mraedis
Mraedis•20h ago
Weird, in any case if you don't have multiple users and you don't have any files... just delete the rest Though I don't understand why you would go that route instead of a fresh install 😛
AstroB
AstroBOP•20h ago
Why would I do a fresh install? I just wanted to avoid complexities of restoring things that I already configured I had the beta versions but updated to 2.0.0
Mraedis
Mraedis•20h ago
Because you removed all photos 👀
AstroB
AstroBOP•20h ago
Yeah I was just using that instance to test immich until a stable release happened Do you think that this can cause corruption and/or problems with future use of my server? And thanks for helping! 🙂
Mraedis
Mraedis•20h ago
I spy @Sergey Katsubo in the thread somehow He might have a simple SQL query to list the assets the server thinks exist If there are none, it should be clear to delete the files, apart from the .immich files
AstroB
AstroBOP•20h ago
I saved the file names containing the UUID looking names
Mraedis
Mraedis•20h ago
The folders with UUID should match your own user's UUID
AstroB
AstroBOP•20h ago
They match And the only paths that contained "admin" somewhere in the name are data/library/admin/* stuff Everything there was empty folders
Mraedis
Mraedis•20h ago
Sounds good, no orphaned files with the wrong user ID
AstroB
AstroBOP•20h ago
Yeah so after I got rid of them I'm just not sure if future problems / data corruption will arise for some reason
Sergey Katsubo
Sergey Katsubo•20h ago
docker exec immich_postgres psql -U postgres -d immich -c 'select "originalFileName", "originalPath", "isOffline", "deletedAt" from asset'
docker exec immich_postgres psql -U postgres -d immich -c 'select "originalFileName", "originalPath", "isOffline", "deletedAt" from asset'
AstroB
AstroBOP•20h ago
running shortly thanks! None of the paths are what I actually deleted I only deleted things under encoded-video, upload and thumbs
Sergey Katsubo
Sergey Katsubo•20h ago
thumbs live in another table in DB
docker exec immich_postgres psql -U postgres -d immich -c 'select "originalFileName", "originalPath", "isOffline", "deletedAt", path, af.type from asset a join asset_file af on a.id = af."assetId"'
docker exec immich_postgres psql -U postgres -d immich -c 'select "originalFileName", "originalPath", "isOffline", "deletedAt", path, af.type from asset a join asset_file af on a.id = af."assetId"'
^^ last 2 columns about those thumbs Anything in uploads is supposedly just your transient experiments with uploading. If you mainly focused on external library. okay, this one to cover both thumbs and encoded-video
docker exec immich_postgres psql -U postgres -d immich -c 'select "originalFileName", "originalPath", "encodedVideoPath", "isOffline", "deletedAt", path, af.type from asset a join asset_file af on a.id = af."assetId"'
docker exec immich_postgres psql -U postgres -d immich -c 'select "originalFileName", "originalPath", "encodedVideoPath", "isOffline", "deletedAt", path, af.type from asset a join asset_file af on a.id = af."assetId"'
AstroB
AstroBOP•20h ago
Wait now I realize that something is weird
Mraedis
Mraedis•20h ago
Could you have archived pictures perhaps?
AstroB
AstroBOP•20h ago
Files from the command you sent looked like: /data/thumbs/<uuid>/<hex>/<hex>/<uuid>-preview.jpeg Files I deleted look like /data/thumbs/<uuid>/<hex>/<hex> but they can be more than 70MB in size Are these directories with large .immich files? wut?
Mraedis
Mraedis•20h ago
.immich files are top level and only contain a unix timestamp
AstroB
AstroBOP•20h ago
what do you mean top level?
Mraedis
Mraedis•20h ago
there's one in thumbs, one in encoded-video ...
AstroB
AstroBOP•20h ago
alright
Mraedis
Mraedis•20h ago
not in the UUID folders or the subfolders
AstroB
AstroBOP•20h ago
then i have no idea what i touched i can dig in a snapshot and see Alright, there were some videos and images? find didn't see any files for some reason? I'm confused Or I just missed them None of the thumb file names match anything in the DB encodedVideoPath is empty for everything Is that good?
Mraedis
Mraedis•20h ago
Doesn't make encodes if there's no encode policy that applies
AstroB
AstroBOP•20h ago
Alright so it sounds like my server is alright to use... Thanks!
Sergey Katsubo
Sergey Katsubo•20h ago
Btw if you'd like to start from scratch with 0 asset records in the database you can TRUNCATE TABLE asset CASCADE;
AstroB
AstroBOP•19h ago
Yeah I won't do that, I already started syncing stuff from my phone and I'm going to add more users... Wait Will immich re-scan my existing data directory? Will I lose pics / videos?
Mraedis
Mraedis•19h ago
No it doesn't know anything exists in the data directory if it's not in the database
AstroB
AstroBOP•19h ago
I'll keep the state as is then Thanks!

Did you find this page helpful?