Apple icloud.com.cn 503 Service Temporarily Unavailable issue and temporary fix solution
Hi, I’m a user of boredazfcuk/docker-icloudpd. Over the past few days, after updating to the latest version, I’ve been unable to log in to the Chinese iCloud service icloud.com.cn.
When requesting /appleauth/auth/signin/complete?isRememberMeEnabled=true, it returns 503 Service Temporarily Unavailable, which prevents me from entering 2FA to log in.
Log snippet:
...
2025-09-18 22:07:01 DEBUG {
"request": {
"method": "POST",
"url": "https://idmsa.apple.com.cn/appleauth/auth/signin/complete?isRememberMeEnabled=true",
"headers": {
"Origin": "https://idmsa.apple.com.cn",
"Referer": "https://idmsa.apple.com.cn/",
"Content-Type": "application/json",
"X-Apple-OAuth-Client-Id": "OBFUSCATED-810530919",
"X-Apple-OAuth-Client-Type": "OBFUSCATED-1961643734",
"X-Apple-OAuth-Redirect-URI": "OBFUSCATED-2006632637",
"X-Apple-OAuth-Require-Grant-Code": "OBFUSCATED-4261170317",
"X-Apple-OAuth-Response-Mode": "OBFUSCATED-1578278625",
"X-Apple-OAuth-Response-Type": "OBFUSCATED-1997877400",
"X-Apple-OAuth-State": "OBFUSCATED-3525441077",
"X-Apple-Widget-Key": "OBFUSCATED-810530919",
"scnt": "OBFUSCATED-2748672309",
"X-Apple-ID-Session-Id": "OBFUSCATED-2971911692"
},
"cookies": {
"dslang": "US-EN",
"site": "USA",
"aasp": "OBFUSCATED-3299397674"
},
"content": {
"accountName": "OBFUSCATED-3832775053",
"c": "OBFUSCATED-224371163",
"m1": "OBFUSCATED-3141626501",
"m2": "OBFUSCATED-2028019714",
"rememberMe": true,
"trustTokens": []
}
},
"response": {
"status_code": 503,
"headers": {
"Content-Type": "text/html"
},
"cookies": {},
"content": "<html>\r\n<head><title>503 Service Temporarily Unavailable</title></head>\r\n<body>\r\n<center><h1>503 Service Temporarily Unavailable</h1></center>\r\n<hr><center>Apple</center>\r\n</body>\r\n</html>\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n<!-- a padding to disable MSIE and Chrome friendly error page -->\r\n"
}
}I also tried logging in directly with icloudpd --username [email protected] --password XXXX --domain cn --auth-only and got the same 503 error.
I’m confident my password is correct. Out of curiosity, I tried logging in with icloud.com instead of icloud.com.cn.
Interestingly, my Apple devices then received the login prompt and 2FA code. The logs show that in this case, the appleauth/auth/signin/complete?isRememberMeEnabled=true request succeeded with account/password verification.
2025-09-18 22:27:34 DEBUG {
"request": {
"method": "POST",
"url": "https://idmsa.apple.com/appleauth/auth/signin/complete?isRememberMeEnabled=true",
"headers": {
"Origin": "https://idmsa.apple.com",
"Referer": "https://idmsa.apple.com/",
"Content-Type": "application/json",
"X-Apple-OAuth-Client-Id": "OBFUSCATED-810530919",
"X-Apple-OAuth-Client-Type": "OBFUSCATED-1961643734",
"X-Apple-OAuth-Redirect-URI": "OBFUSCATED-1866116011",
"X-Apple-OAuth-Require-Grant-Code": "OBFUSCATED-4261170317",
"X-Apple-OAuth-Response-Mode": "OBFUSCATED-1578278625",
"X-Apple-OAuth-Response-Type": "OBFUSCATED-1997877400",
"X-Apple-OAuth-State": "OBFUSCATED-3525441077",
"X-Apple-Widget-Key": "OBFUSCATED-810530919",
"scnt": "OBFUSCATED-4094548094",
"X-Apple-ID-Session-Id": "OBFUSCATED-3299397674"
},
"cookies": {
"dslang": "US-EN",
"site": "USA",
"acn01": "OBFUSCATED-1857296798",
"aasp": "OBFUSCATED-1195383617"
},
"content": {
"accountName": "OBFUSCATED-3832775053",
"c": "OBFUSCATED-2407858111",
"m1": "OBFUSCATED-3236630602",
"m2": "OBFUSCATED-1417157248",
"rememberMe": true,
"trustTokens": []
}
},
"response": {
"status_code": 409,
"headers": {
"Content-Type": "application/json;charset=UTF-8",
"X-Apple-I-Request-ID": "OBFUSCATED-1616819422",
"scnt": "OBFUSCATED-193020478",
"X-Apple-TwoSV-Trust-Eligible": "OBFUSCATED-4261170317",
"Location": "/auth",
"X-Apple-ID-Session-Id": "OBFUSCATED-1195383617",
"X-Apple-Auth-Attributes": "OBFUSCATED-718733999",
"X-Apple-Session-Token": "OBFUSCATED-4221137067",
"X-Apple-ID-Account-Country": "OBFUSCATED-609829649"
},
"cookies": {
"dslang": "US-EN",
"site": "USA",
"acn01": "OBFUSCATED-280781132"
},
"content": {
"authType": "hsa2"
}
}
}
2025-09-18 22:27:34 DEBUG {
"request": {
"method": "POST",
"url": "https://setup.icloud.com/setup/ws/1/accountLogin",
"headers": {
"Origin": "https://www.icloud.com",
"Referer": "https://www.icloud.com/"
},
"cookies": {},
"content": {
"accountCountryCode": "CHN",
"dsWebAuthToken": "OBFUSCATED-4221137067",
"extended_login": true,
"trustToken": "OBFUSCATED-0"
}
},
"response": {
"status_code": 302,
"headers": {
"Content-Type": "application/json; charset=UTF-8",
"x-apple-user-partition": "OBFUSCATED-841265288",
"X-Apple-Request-UUID": "OBFUSCATED-2986201000",
"X-Apple-Edge-Response-Time": "OBFUSCATED-300230734"
},
"cookies": {},
"content": {
"domainToUse": "iCloud.com.cn"
}
}
}However, since my account is a China-only account, I need to use icloud.com.cn in order to actually proceed.
In addition, I noticed that in a private browser tab, I can’t open icloud.com.cn, but I can open www.icloud.com.cn.
Looking into the browser developer tools, I found that when logging into www.icloud.com.cn, the request to
appleauth/auth/signin/complete?isRememberMeEnabled=true is sent to idmsa.apple.com instead of idmsa.apple.com.cn.
That explains why logging in without --domain cn works (it sent to idmsa.apple.com), while the cn domain keeps failing.
Temporary Fix
My guess is that this is caused by a DNS configuration issue on Apple’s side for icloud.com.cn. No idea when (or if) they’ll fix it.
As a temporary fix, I forked the repo and made the following changes:
- In
src/pyicloud_ipd/base.pyreplaceidmsa.apple.com.cnwithidmsa.apple.com(self.AUTH_ROOT_ENDPOINTandself.AUTH_ENDPOINT). - In
src/pyicloud_ipd/sms.py, replace.com.cnwith.com(Not sure need to change or not, just change all.com.cnto.com).
This solution allows login to proceed correctly. Hopefully it helps others who are facing the same issue.
Source: icloud-photos-downloader/icloud_photos_downloader