API results not matching whats in database

Does anyone have any idea while I see two rows when querying the database directly as per below:
SELECT *
FROM asset
WHERE "originalFileName" = '20220216_143303_79FC8348.mov';
SELECT *
FROM asset
WHERE "originalFileName" = '20220216_143303_79FC8348.mov';
But when performing an API call to https://immich/api/search/metadata with:
{
"originalFileName": "20220216_143303_79FC8348.mov"
}
{
"originalFileName": "20220216_143303_79FC8348.mov"
}
I am getting 0 results:
{
"albums": {
"total": 0,
"count": 0,
"items": [],
"facets": []
},
"assets": {
"total": 0,
"count": 0,
"items": [],
"facets": [],
"nextPage": null
}
}
{
"albums": {
"total": 0,
"count": 0,
"items": [],
"facets": []
},
"assets": {
"total": 0,
"count": 0,
"items": [],
"facets": [],
"nextPage": null
}
}
13 Replies
Immich
Immich4w ago
:wave: Hey @Jack Brown, 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. :blue_square: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: 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.
Zeus
Zeus4w ago
please show the full database output of those two rows you get also please show the output of SELECT * from public.user; also what permissions did you give your API key?
Jack Brown
Jack BrownOP4w ago
in database visibility = hidden, could that be it?
Zeus
Zeus4w ago
yep
Jack Brown
Jack BrownOP4w ago
what would cause that?
Zeus
Zeus4w ago
could be the video of a live photo you should share all the queries I asked about if you want more info
Jack Brown
Jack BrownOP4w ago
To give more context of how I run into / found this issue: 1) I have existing Immich instance with external library only, I want to change from 'external' to normal / default / internal library. 2) To achieve this I navigated to folder of my external library and used immich cli import command 3) Once everything had been imported I then wanted to ensure I didn't lose all my immich albums when I removed my external library 4) I wrote a script that looped through all assets in albums, searched for the new asset and add new asset Id to album 5) End result should be that all albums have an asset count of DOUBLE the original, effectively each asset in album would be duplicated, one from external library and one internal. 6) A few albums had a couple of assets missing....the first one I found was for asset with file name '20220216_143303_79FC8348.heic' 7) I used database and could only find 1 asset with file name '20220216_143303_79FC8348.mov' which was external library 8) On my ubuntu instance I manually tried to import the file again but got the below:
jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ immich upload 20220216_143303_79FC8348.heic -j
Crawling for assets...
Hashing files | ████████████████████████████████████████ | 100% | ETA: 0s | 1/1 assets
Checking for duplicates | ████████████████████████████████████████ | 100% | ETA: 0s | 1/1 assets
Found 0 new files and 1 duplicate
All assets were already uploaded, nothing to do.
{
"newFiles": [],
"duplicates": [
{
"id": "5e9710a9-6460-433b-8cef-80c8d4d515e6",
"filepath": "/mnt/chamber/photoprism/originals/2022/02/20220216_143303_79FC8348.heic"
}
],
"newAssets": []
}
jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ immich upload 20220216_143303_79FC8348.heic -j
Crawling for assets...
Hashing files | ████████████████████████████████████████ | 100% | ETA: 0s | 1/1 assets
Checking for duplicates | ████████████████████████████████████████ | 100% | ETA: 0s | 1/1 assets
Found 0 new files and 1 duplicate
All assets were already uploaded, nothing to do.
{
"newFiles": [],
"duplicates": [
{
"id": "5e9710a9-6460-433b-8cef-80c8d4d515e6",
"filepath": "/mnt/chamber/photoprism/originals/2022/02/20220216_143303_79FC8348.heic"
}
],
"newAssets": []
}
9) I then got down this rabbit hole of fidning the file had been renamed to '.mov' and trying to figure out why......but maybe this isn't the case?
Zeus
Zeus4w ago
most likely a live photo based on what you said they should have a heic + a mov for the motion usually the same name
Jack Brown
Jack BrownOP4w ago
yes i have both
jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ ls 20220216_143303_79FC8348.
20220216_143303_79FC8348.heic 20220216_143303_79FC8348.mov
jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ ls 20220216_143303_79FC8348.
20220216_143303_79FC8348.heic 20220216_143303_79FC8348.mov
when I run
SELECT *
FROM asset
WHERE "originalFileName" = '20220216_143303_79FC8348.heic';
SELECT *
FROM asset
WHERE "originalFileName" = '20220216_143303_79FC8348.heic';
I only see the file from external library.....immich import CLI doesn't seem to import the .heic, I think because the checksum matches the same as .mov so it's seeing as duplicate
Zeus
Zeus4w ago
those two files should not have the same checksum, but tbh I do not know how we handle external live photos. I think they are only really supported via the app anyway, that's definitely related to what is going on here just not sure how to piece it apart properly
Jack Brown
Jack BrownOP4w ago
jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ sha1sum 20220216_143303_79FC8348.heic
59cfd3535967471d07a53b5e9a8e6c0e08bf5cf1 20220216_143303_79FC8348.heic

jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ sha1sum 20220216_143303_79FC8348.mov
59cfd3535967471d07a53b5e9a8e6c0e08bf5cf1 20220216_143303_79FC8348.mov
jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ sha1sum 20220216_143303_79FC8348.heic
59cfd3535967471d07a53b5e9a8e6c0e08bf5cf1 20220216_143303_79FC8348.heic

jack@truenas-ubuntu-vm:/mnt/chamber/photoprism/originals/2022/02$ sha1sum 20220216_143303_79FC8348.mov
59cfd3535967471d07a53b5e9a8e6c0e08bf5cf1 20220216_143303_79FC8348.mov
Zeus
Zeus4w ago
well that's just an issue with your source data sorry to say, that does not make any sense to me
Jack Brown
Jack BrownOP4w ago
yes....that may be the case.... seems nothing to do with immich

Did you find this page helpful?