ipatool icon indicating copy to clipboard operation
ipatool copied to clipboard

unexpected response from Apple (HTTP 204): empty or non-plist body

Open missaustraliana opened this issue 4 months ago • 14 comments

What happened?

Apple patched out 2.3.1.

Logging in and purchasing apps is no longer possible. The status codes seem to fluctuate in random. Below is some errors from when I tried to purchase an app

12:02PM ERR error="request failed: unexpected response from Apple (HTTP 403): 403 Forbidden 403 Forbidden Apple" success=false
12:02PM ERR error="request failed: unexpected response from Apple (HTTP 404): 404 Not Found 404 Not Found Apple" success=false
12:02PM ERR error="request failed: unexpected response from Apple (HTTP 301): 301 Moved Permanently 301 Moved Permanently Apple" success=false
12:02PM ERR error="request failed: unexpected response from Apple (HTTP 204): empty or non-plist body" success=false

Version

2.3.1

Relevant log output

ipatool auth login -e [email]
12:05PM INF enter password:
12:05PM ERR error="request failed: unexpected response from Apple (HTTP 204): empty or non-plist body" success=false

missaustraliana avatar Jul 24 '26 02:07 missaustraliana

got same error

yangliu-1995 avatar Jul 24 '26 02:07 yangliu-1995

Change the login url to https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate. I won't ask why. Apple is just so inexplicable.

martin-60896 avatar Jul 24 '26 04:07 martin-60896

Change the login url to https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate. I won't ask why. Apple is just so inexplicable.

thats the url already set in the latest version, but i tried it anyway to give the benefit of the doubt by building myself and same issue.

missaustraliana avatar Jul 24 '26 05:07 missaustraliana

Change the login url to https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate. I won't ask why. Apple is just so inexplicable.

thats the url already set in the latest version, but i tried it anyway to give the benefit of the doubt by building myself and same issue.

The current login url is derived from the url returned by the bag request.appstore.BagInput(). To be precise, it is https://auth.itunes.apple.com/auth/v1/native/fast/. You can try hard-coding this address.

martin-60896 avatar Jul 24 '26 06:07 martin-60896

Has anyone been able to figure out a fix or workaround? Tried out the once mentioned on this thread

Gautam010 avatar Jul 24 '26 07:07 Gautam010

Hi, everyone I had product cause by this problem that I provide my solution.

I confirmed that the legacy authentication flow is working in my implementation.

The authentication endpoint returned by the Store bag was:

https://auth.itunes.apple.com/auth/v1/native/fast/ Posting to this endpoint returned HTTP 404 with no valid plist response.

I then retried using the legacy endpoint:

https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate Apple returned:

HTTP 302
Location: https://p7-buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate?Pod=7&PRH=7

I repeated the POST request to the redirected URL, preserving the original plist body. Apple then returned HTTP 200 with a valid plist response.

native/fast/ → 404
legacy authenticate → 302
repeat POST to the pod URL → 200 + plist

I was then able to retrieve passwordToken, dsPersonId, Storefront, and the assigned pod. The authenticated Store session also worked for subsequent billing/storefront requests.

Important: do not let the HTTP client automatically convert the redirected POST request into a GET request. Repeat the POST request to the URL from the Location header with the original plist body.

bboy910225 avatar Jul 24 '26 09:07 bboy910225

I prepared a tested patch for this flow:

  • native /auth/v1/native/fast gets an empty/non-plist 204, 403, 404, or 503
  • retry legacy https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/authenticate
  • retain its 302 Location and repost the original XML plist body to the assigned pod (including attempt=1)

Patch comparison: https://github.com/majd/ipatool/compare/main...bboy910225:agent/legacy-auth-fallback

go test ./... passes locally.

I also attempted to open the upstream PR from this fork; GitHub returned CreatePullRequest permission error for this account, so the compare link contains the ready-to-open PR diff.

bboy910225 avatar Jul 24 '26 10:07 bboy910225

Upstreaming the fix from above: https://github.com/majd/ipatool/pull/514

majd avatar Jul 25 '26 12:07 majd

patch worked on my end, thank you so so much, i'll leave it open until its merged

missaustraliana avatar Jul 25 '26 13:07 missaustraliana

I still cannot login. ipatool version 2.3.2 tried a few times, got 2FA code once on my devices, entered 6 digits, but then got: "request failed: unexpected response from Apple (HTTP 204): empty or non-plist body"

other errors: "request failed: unexpected response from Apple (HTTP 503): 503 Service Temporarily Unavailable" "something went wrong" "failed to retrieve redirect location: header not found"

Oh, wait, the 10th try or so succeeded. I was then able to download an iPhone app on my Mac. Yeah. So if it doesn't work for you, keep trying until it does...

Fesh-com avatar Aug 03 '26 21:08 Fesh-com

I use the new feature in my code,but the error got back agin yesterday。

9k00 avatar Aug 04 '26 02:08 9k00

Changing my IP address via VPN helped me. I couldn't log in using my IP address.

BuildContext avatar Aug 05 '26 13:08 BuildContext

Fixed in #525. Update to the release 2.4.0 https://github.com/majd/ipatool/releases/tag/v2.4.0

majd avatar Aug 28 '26 21:08 majd

v2.8.0 on Windows 10 amd64 still fails at load anisette assets: read pinned kernel collection ... 403, before password/2FA. Hotspot, no proxy. Is Windows unsupported due to Anisette/macOS dependency, or should I open a new issue to track it?

Nemoin2784 avatar Nov 11 '26 05:11 Nemoin2784