Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

iclouddrive: fix "Index has invalid data" error listing iCloud Photos

Nick Craig-Woodffd36fc2d7bd
diff --git a/backend/iclouddrive/api/photos.go b/backend/iclouddrive/api/photos.go
index 4c3e2457d..7b31da02b 100644
--- a/backend/iclouddrive/api/photos.go
+++ b/backend/iclouddrive/api/photos.go
@@ -606,6 +606,13 @@ func (ps *PhotosService) discoverLibraries(ctx context.Context) (*libraryDiscove
continue
}
name := zone.ZoneID.ZoneName
+ // Only PrimarySync and SharedSync-* are photo libraries. Other
+ // zones (e.g. CMM-* shared-album zones) appear in changes/database
+ // but have no CPLAlbumByPositionLive index, so querying their
+ // albums returns BAD_REQUEST / "Index has invalid data".
+ if name != "PrimarySync" && !strings.HasPrefix(name, "SharedSync") {
+ continue
+ }
// SharedSync-* found in private takes precedence over shared
if _, exists := result.libraries[name]; exists {
continue