From ffd36fc2d7bd8ac15d1e554fff632991fbdb8e82 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 31 May 2026 09:39:59 +0100 Subject: [PATCH] iclouddrive: fix "Index has invalid data" error listing iCloud Photos Accounts with shared-album zones (named CMM-*) returned these zones in the photos changes/database listing alongside the real photo libraries. rclone treated them as libraries and queried their albums, but these zones have no CPLAlbumByPositionLive index so the query failed with BAD_REQUEST / "Index has invalid data", aborting the whole listing. Only PrimarySync and SharedSync-* zones are photo libraries, so skip any other zone during discovery. See: https://forum.rclone.org/t/sync-to-icloud-gives-index-has-invalid-data-errors/53852 --- backend/iclouddrive/api/photos.go | 7 +++++++ 1 file changed, 7 insertions(+) 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