Apple iCloud is temporary refusing to serve icloudpd

Author: mmartinelloCreated Sep 17, 2025Updated Sep 9, 2026
Labelsbug

Overview

Executing icloudpd to download and delete pictures from iCloud, I'm getting the Apple iCloud is temporary refusing to serve icloudpd error.

Steps to Reproduce

Execute icloudpd with the following command:

/usr/local/bin/icloudpd --username [email protected] --directory /path/to/dest/dir --smtp-host smtp.host.name --smtp-no-tls --notification-email [email protected] --notification-email-from [email protected] --folder-structure "{:%Y/%m}" --keep-icloud-recent-days 365

Actual Behavior

After deleting a bunch of elements, icloudpd exits with the following error:

2025-09-17 20:20:12 INFO     Deleted IMG_4416.HEIC in iCloud
2025-09-17 20:20:12 DEBUG    /path/to/dest/dir/2024/07/IMG_4415.HEIC already exists
2025-09-17 20:20:12 DEBUG    /path/to/dest/dir/2024/07/IMG_4415_HEVC.MOV already exists
2025-09-17 20:20:12 DEBUG    Created date: 2024-07-20 10:44:41.211000+02:00
2025-09-17 20:20:12 DEBUG    Keep iCloud recent days: 365
2025-09-17 20:20:12 DEBUG    Age days: 424
2025-09-17 20:20:12 DEBUG    Deleting IMG_4415.HEIC in iCloud...
2025-09-17 20:20:12 DEBUG    POST https://p150-ckdatabasews.icloud.com:443/database/1/com.apple.photos.cloud/production/private/records/modify?clientBuildNumber=2522Project44&clientMasteringNumber=2522B2&clientId=auth-7e1115bc-1dfd-11f0-b0a7-d636566fed36&dsid=87167348&remapEnums=True&getCurrentSyncToken=True {"atomic": true, "desiredKeys": ["isDeleted"], "operations": [{"operationType": "update", "record": {"fields": {"isDeleted": {"value": 1}}, "recordChangeTag": "b7b9", "recordName": "9CF2EEB6-5C60-4E90-822F-0DA5AE65CF64", "recordType": "CPLAsset"}}], "zoneID": {"zoneName": "PrimarySync", "ownerRecordName": "_ae141a3d3887fe5d161ad7ed93c5d6c1", "zoneType": "REGULAR_CUSTOM_ZONE"}}
2025-09-17 20:20:12 INFO     Apple iCloud is temporary refusing to serve icloudpd
2025-09-17 20:20:12 DEBUG    {
  "request": {
    "method": "POST",
    "url": "https://setup.icloud.com/setup/ws/1/validate",
    "headers": {
      "Origin": "https://www.icloud.com",
      "Referer": "https://www.icloud.com/"
    },
    "cookies": {
      "X_APPLE_WEB_KB-TVWJDF0UV-LV5FVJZC2BSBQV5ES": "OBFUSCATED-4188383510",
      "X-APPLE-WEBAUTH-HSA-TRUST": "OBFUSCATED-2900195859",
      "X-APPLE-WEBAUTH-PCS-Events": "OBFUSCATED-1301120861",
      "X-APPLE-WEBAUTH-PCS-Documents": "OBFUSCATED-143103050",
      "X-APPLE-WEBAUTH-PCS-Photos": "OBFUSCATED-1493335619",
      "X-APPLE-WEBAUTH-PCS-Cloudkit": "OBFUSCATED-2501530526",
      "X-APPLE-WEBAUTH-PCS-Safari": "OBFUSCATED-357744836",
      "X-APPLE-WEBAUTH-PCS-Mail": "OBFUSCATED-3108097419",
      "X-APPLE-WEBAUTH-PCS-Notes": "OBFUSCATED-2657238636",
      "X-APPLE-WEBAUTH-PCS-News": "OBFUSCATED-2333277385",
      "X-APPLE-WEBAUTH-PCS-Sharing": "OBFUSCATED-3199067108",
      "X-APPLE-UNIQUE-CLIENT-ID": "OBFUSCATED-1936143824",
      "X-APPLE-WEBAUTH-LOGIN": "OBFUSCATED-3116237021",
      "X-APPLE-WEBAUTH-VALIDATE": "OBFUSCATED-1488094886",
      "X-APPLE-WEBAUTH-TOKEN": "OBFUSCATED-1896279137",
      "X-APPLE-WEBAUTH-USER": "OBFUSCATED-3920202897",
      "X-APPLE-DS-WEB-SESSION-TOKEN": "OBFUSCATED-1669379686"
    }
  },
  "response": {
    "status_code": 200,
    "headers": {
      "Content-Type": "application/json; charset=UTF-8",
      "x-apple-user-partition": "OBFUSCATED-2545945474",
      "X-Apple-Request-UUID": "OBFUSCATED-349431407",
      "X-Apple-Edge-Response-Time": "OBFUSCATED-1440114318"
    },
    "cookies": {
      "X-APPLE-WEBAUTH-PCS-Cloudkit": "OBFUSCATED-3734178656",
      "X-APPLE-WEBAUTH-PCS-Documents": "OBFUSCATED-3125965273",
      "X-APPLE-WEBAUTH-PCS-Events": "OBFUSCATED-969211405",
      "X-APPLE-WEBAUTH-PCS-Mail": "OBFUSCATED-1451247014",
      "X-APPLE-WEBAUTH-PCS-News": "OBFUSCATED-3462411819",
      "X-APPLE-WEBAUTH-PCS-Notes": "OBFUSCATED-1758007694",
      "X-APPLE-WEBAUTH-PCS-Photos": "OBFUSCATED-3286191255",
      "X-APPLE-WEBAUTH-PCS-Safari": "OBFUSCATED-2957970090",
      "X-APPLE-WEBAUTH-PCS-Sharing": "OBFUSCATED-1852318962",
      "X-APPLE-WEBAUTH-VALIDATE": "OBFUSCATED-3004866415",
      "X-APPLE-WEBAUTH-TOKEN": "OBFUSCATED-2229092260",
      "X-APPLE-DS-WEB-SESSION-TOKEN": "OBFUSCATED-1521848713"
    },
    "content": {
      "dsInfo": {
        "lastName": "OBFUSCATED-1695410685",
        "iCDPEnabled": false,
        "tantorMigrated": true,
        "dsid": "OBFUSCATED-1735411179",
        "hsaEnabled": true,
        "isHideMyEmailSubscriptionActive": true,
        "ironcadeMigrated": true,
        "ageCategory": 0,
        "locale": "it-it_IT",
        "brZoneConsolidated": true,
        "ICDRSCapableDeviceList": "iphone-mac",
        "isManagedAppleID": false,
        "isCustomDomainsFeatureAvailable": true,
        "isHideMyEmailFeatureAvailable": true,
        "ContinueOnDeviceEligibleDeviceInfo": [],
        "gilligan-invited": true,
        "appleIdAliases": [
          "[email protected]"
        ],
        "hsaVersion": 2,
        "ubiquityEOLEnabled": true,
        "isPaidDeveloper": false,
        "countryCode": "ITA",
        "notificationId": "OBFUSCATED-349431407",
        "primaryEmailVerified": true,
        "aDsID": "OBFUSCATED-1956774695",
        "locked": false,
        "ICDRSCapableDeviceCount": 2,
        "hasICloudQualifyingDevice": true,
        "primaryEmail": "OBFUSCATED-1831767476",
        "ageRestricted": false,
        "appleIdEntries": [
          {
            "isPrimary": true,
            "type": "EMAIL",
            "value": "OBFUSCATED-1831767476"
          }
        ],
        "gilligan-enabled": true,
        "isWebAccessAllowed": true,
        "fullName": "OBFUSCATED-1415009873",
        "languageCode": "it-it",
        "appleId": "OBFUSCATED-1831767476",
        "analyticsOptInStatus": false,
        "firstName": "OBFUSCATED-2675544203",
        "iCloudAppleIdAlias": "OBFUSCATED-1133438646",
        "notesMigrated": true,
        "beneficiaryInfo": {
          "isBeneficiary": false
        },
        "hasPaymentInfo": false,
        "pcsDeleted": false,
        "isCustomDomainTransferSubscriptionActive": true,
        "appleIdAlias": "OBFUSCATED-0",
        "brMigrated": true,
        "statusCode": 2,
        "familyEligible": true
      },
      "hasMinimumDeviceForPhotosWeb": true,
      "iCDPEnabled": false,
      "webservices": {},
      "pcsEnabled": true,
      "isUnderMaintenance": false,
      "configBag": {
        "urls": {},
        "accountCreateEnabled": true
      },
      "hsaTrustedBrowser": true,
      "ckPartition": 150,
      "version": 2,
      "isExtendedLogin": true,
      "pcsServiceIdentitiesIncluded": true,
      "userPartition": 150,
      "hsaChallengeRequired": false,
      "requestInfo": {
        "country": "IT",
        "timeZone": "GMT+1"
      },
      "pcsDeleted": false,
      "iCloudInfo": {
        "SafariBookmarksHasMigratedToCloudKit": true
      }
    }
  }
}

I tried several times and few minutes after starting the command, this error shows up.

Source: icloud-photos-downloader/icloud_photos_downloader