Status Update
Comments
jf...@google.com <jf...@google.com> #2
Thank you for the very detailed and comprehensive issue report!
Just to confirm - are all media items shown in the Google Photos apps (and with the correct dates)?
I have forwarded it to our engineering team for further investigation. We will reach out when we have any updates or have any further follow-up questions.
je...@padencolorado.com <je...@padencolorado.com> #3
I have found cases with more recent date ranges where more than 2 pages are returned, but the last page is still an empty response and not all of the expected media items have been returned yet.
In one particular case is when searching around 2018-08-31 in my library. On that day I have 294 images and videos which show in the Google Photos site. When I execute a search for 2018-08-30
to 2018-08-31
, I receive 9 pages with a total of 210 media items. The last page includes a nextPageToken, but if I retrieve that next page it returns an empty response. Interestingly, if I add a day to the search, 2018-08-30
to 2018-09-01
, then only 183 images are retrieved before encountering an empty page response. I have tried other various date ranges including Aug 31, starting as early as Aug. 1st, and the most I have been able to retrieve is 210 images. When I change the end date from Aug. 31 to Sept. 1, the media items are returned in a slightly different order, but it always seems to end with the same file, P8310169.JPG
. In the Google Photos site I compared this image to the surrounding images including those that are and are not returned. The photos are nearly identical, all of them taken together on the same camera with the same settings and uploaded together through Google Backup and Sync for Windows. There is no clear indication why it would stop at that file without returning the next few in sequence.
I have also found 6 other 1-month date ranges between 2016 and 2018 which also end in an empty responses when paging through the results and where not all of the media items for the given range are never returned.
je...@padencolorado.com <je...@padencolorado.com> #4
Hi, thanks for the response! Yes, all of the media items show on both the Google Photos site and Google Photos on Android including those that are not returned by the API. Please let me know if there is any additional data I can provide to help troubleshoot the issue.
je...@padencolorado.com <je...@padencolorado.com> #5
Hello! Is there any update on this issue? Please let me know if I can provide any additional information. Thanks!
pe...@gmail.com <pe...@gmail.com> #6
pe...@gmail.com <pe...@gmail.com> #7
fm...@gmail.com <fm...@gmail.com> #8
Crazily enough, sharing the album reset things, and the lists are coming back fine now. So that seems to be a solution.
fm...@gmail.com <fm...@gmail.com> #9
ic...@gmail.com <ic...@gmail.com> #10
Same issue here. I use pageSize 100 and when I use the nextPageToken as pageToken from the first request, I get empty result, even though there should be more photos. Sometimes I'm lucky to get more photos if I change the pageSize to another number from the first request. This is causing a lot of issues for my users.
ic...@gmail.com <ic...@gmail.com> #11
This also seems to be related to people uploading photos through our API, as it always seems to work with albums that have photos from other my phone.
Description
This is the issue tracker for developers using the Google Photos Library API:http://developers.google.com/photos
For issues with the Google Photos app, please see:https://support.google.com/photos/answer/6156065?hl=en
Before filing an issue, please read and follow these instructions carefully.
First, please search through existing issues to ensure that the bug has not already been reported. You can start the search here:https://issuetracker.google.com/savedsearches/5156057
If the issue has already been reported, you can click the star next to the issue number to subscribe and receive updates. We prioritize responding to the issues with the most stars. You can also comment on the issue to provide any details of your experience with it.
If your issue has not been reported, please delete this introduction and provide all of the following:
(Please enable Markdown for improved formatting of your report.)
Description
MediaItem search API endpoint is returning two pages of results, then the third page is an empty response. Changing the page size still results in only two pages of results with each page matching the page size. I am using a date range filter and have varied the size of the date range, ranging from a year, a couple months and a few days. In all cases, if the total number of expected media items is more than two pages, only two pages of results are returned. The second page includes a page token, but using that page token results in an empty response from the API. No errors are indicated and the HTTP response code is 200 OK. Even with a large page size, images are missing from the search results.
Detailed description
API calls
Call #1 - First page - POSThttps://photoslibrary.googleapis.com/v1/mediaItems:search
Call #1 response includes 25 media items and a next page token (items and page token redacted for brevity)
Call #2 using page token from Response #1
Response #2 with 25 more media items
Call #3 with page token from Response #2
Response #3 - Empty response - HTTP 200 OK
Steps to reproduce the problem
What steps will reproduce the problem?
What is the expected output?
The API is presenting a nextPageToken on the second page response, but the third page returns an empty object. I would expect additional items to be returned along with another page token as long as there are items to be returned. The steps described above return a total of 50 images when page size is 25 and 200 images when page size is 100. This shows that there are more than 50 images to be returned, but the API is not returning those items.
What do you see instead?
No error message is presented. The HTTP response code on the third request is 200 OK. Headers in the response match the headers in the previous responses. Not all images are being returned. I am able to find examples of images on photos.google.com within the date range I am searching which I do not receive in any of the pages of data returned.
Code sample
Execute the above requests in Google Photos API Documentation's "Try this API window". I also was able to replicate the issue using direct REST requests in a C# .Net application, using the Google API .Net SDK for Authentication.
Additional information
It appears the issue might be related to older items within the library. I am able to consistently reproduce this issue with searches having a date range prior to about March of 2003. When searching for more recent date ranges I do continue to get subsequent pages of images. Most of the older images were uploaded using the old Google photo sync desktop app for windows. Newer photos were uploaded through Google Backup and Restore or directly synced from photos on various Android devices. A few older images (from old photo albums) were scanned using the Google Photo Scan on an android device and synced directly with Google Photos within the last 6 months, then the date of the photos was changed in the Google Photos UI to reflect the date the photo was taken. The behavior is observed even with these photos that were uploaded recently but the date changed to prior to 2003.