Total images retrieved through pagination doesn't match "total"
Hi everyone,
First of all, I want to thank you for this amazing app, it's incredibly useful and works really well!
I have a question about API usage. I'm trying to retrieve data for people/faces using the /people endpoint. I currently have 46655 images, so I’m querying them in batches of 1000 (the max allowed). However, the process stops working after approximately 42000 images. Subsequent batches return 0 results, and the
hasNextPage
field is set to False
.
To calculate the number of pages, I’m dividing the total number of images by the batch size, i.e., 46655/1000, resulting in 47 batches in total. However, starting from batch 43 (inclusive), I consistently get 0 results.
Does anyone know why this is happening? Any insights would be greatly appreciated!14 Replies
:wave: Hey @MrMaps,
Thanks for reaching out to us. Please follow the recommended actions below; 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 compose ps
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
Checklist
1. :ballot_box_with_check: I have verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: I have read applicable release notes.
3. :ballot_box_with_check: I have reviewed the FAQs for known issues.
4. :blue_square: I have reviewed Github for known issues.
5. :ballot_box_with_check: I have tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: I have uploaded the relevant logs, docker compose, and .env files, making sure to use code formatting.
7. :ballot_box_with_check: I have 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)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.Presumably a filter is excluding some assets
Do you mean using
withHidden
? Or what kind of filters? I only have 1 hidden image, but a difference of 5k still seems pretty significantJust a general observation, it's impossible to give any specifics without you giving more detail
I don't see any relevant data about the requests in the logs of docker, is there any way to check what filters are being used when querying the
people
endpoint?
Do you have the log level set to verbose?
I'll start from that, thank you
Could you be more precise about which requests you're making in the first place? You were saying you make requests against /people, but then you also talk about total asset count and I am confused
Sorry, I'm referring to the "total" field you get when querying the
/people
endpoint
Above is the request for page 43, with size 1000.
This is normal request (page 0):
Oh I see
That's a known bug actually
The total count does not take the minimum amount of faces into account
#13245
Thank you very much for the insights! I'll switch to use the
hasNextPage
field instead of relying in the total
counter.That's generally always a good idea when using paginated endpoints :)
This thread has been closed. To re-open, use the button below.