You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refresh/sign-in fails with NSCocoaErrorDomain 3840; HTTP 503 observed during reproduction #1782
AltStore intermittently failed to refresh apps, sometimes succeeding between failures. It now fails to sign in after signing out.
Error: NSCocoaErrorDomain 3840
“The data couldn’t be read because it isn’t in the correct format.”
Environment and tests:
AltServer 1.7.2 (build 90) on macOS.
Reproduced using both a MacBook Pro and a Mac mini.
Failed over Wi-Fi and with the iPhone connected by USB.
Restarting AltServer and signing out/back into AltStore did not resolve it.
Signing into Apple’s developer website succeeds.
AltStore on iPhone: 2.2.1.
iOS 27 public beta 6.
Captured evidence:
During one failed sign-in attempt on September 4, 2026, iPhone Console logs attributed to the AltStore process showed:
A successful TLS handshake on Connection 22.
Two HTTP 200 responses, followed by an HTTP 503 response on that same connection.
The 503 request completed in approximately 55 ms, with 477 response bytes reported.
The capture does not identify the endpoint or expose the response body, and it did not contain the 3840 exception itself. Therefore, the 503 is correlated with the failed attempt, but we cannot prove it caused the parsing error or identify which service returned it.
Could you advise how to safely identify the failing endpoint and capture the underlying parsing error without exposing credentials or authentication tokens?
Reacted by Sergey Lebedev, Wang Jiaji, WooJin J. Park, Mark Robinson, harrytheeskimo, Andrea Colombo, p13rr37, Haze, Aleksey Gisich, vemboy20 and 13 more
The user-visible authentication/refresh error is NSCocoaErrorDomain3840, “The data couldn’t be read because it isn’t in the correct format.” I am treating that parser error separately from the local AOSKit failure.
The helper derives X-Mme-Client-Info from hw.model, the macOS product version/build, and Xcode 25183.54.10. Exact type-encoding checks guard hooks for retrieveOTPHeadersForDSID:, the ALTAnisetteData initializer, and setDeviceDescription:. A guarded one-shot retry covers late AltSign loading. Existing identity data is retained without reprovisioning. No raw headers are included here.
During the latest test, the helper ran three times and each request returned HTTP 200 and exited normally, confirming that the Mac-side anisette stage completed. AltServer did not crash or restart. A later iPhone attach/detach sequence reported kAMDPasswordProtectedError, so device lock state may affect subsequent device operations, but it does not explain the earlier authentication parser error.
Remaining failure (inference clearly marked)
A separate iPhone Console capture showed HTTP 200, HTTP 200, then HTTP 503 on one connection, but it did not identify the endpoint/body or contain the 3840 exception. Thus only a correlated 503 is proven. Apple GrandSlam init/complete 200 followed by an HTML apptokens 503 is a strong inference, supported by SideStore#1446, not a confirmed endpoint for this run.
The local patch fixes the macOS 27 AOSKit/anisette stage, but it cannot guarantee success through an Apple HTML 503, apptokens service error, or another upstream 401/503. Parsing such an HTTP error body as a plist can surface as error 3840.
Reproduction / safe diagnostics
On the environment above, run stock AltServer and sign in or refresh an existing app in AltStore.
Repeat with v1.0.4/helper v3.3.
Compare the AOSKit/machineID stage and downstream authentication response.
If 3840 remains, record only host/path, status, content type, byte count, timing, and a correlation ID.
Expected: coherent current client info and valid V3 anisette headers pass the anisette stage.
Observed: helper HTTP 200/anisette succeeds and the empty AOSKit result is not passed through; a later 3840 may still be caused by a downstream Apple HTTP error.
Questions for maintainers
Which AltStore/AltSign request should be instrumented to identify the 503 safely (host/path only)?
Does 3840 wrap an HTML Apple/GrandSlam response, and should retry/backoff or clearer HTTP status handling be added?
Should upstream derive a coherent X-Mme-Client-Info instead of accepting legacy Xcode/3594.4.19 values (see #1772)?
Please use redacted metadata only. Do not publish Apple IDs, DSIDs, tokens, cookies, authentication/anisette headers, raw plist/HTML bodies, identity files, usernames, device names, IPs, or local paths.
For anyone hitting NSCocoaErrorDomain 3840 / "Encountered unknown tag html" or AppleDeveloperError 3020 / -80009 MID is invalid on macOS 27 beta - I combined the fixes discussed in #47, #49, and the anisette machineID patch from kimziro's repo into a single rebuilt AltServer.
Root causes (already covered in this thread, just recapping):
Outdated User-Agent causes Apple's servers to drop the connection after 2 of the 3 requests needed for sign-in (#47)
Sign-in reuses a connection pinned to a failing backend node instead of retrying fresh (#49)
macOS 27's AOSKit returns empty anisette data, breaking machineID (kimziro's fix)
Guys, I used this to install the IPA files I needed onto my iPhone — forgot to mention that this only fixes the macOS side; on iOS you'll still get that same error. But AltServer has a feature to sideload IPA files directly without going through AltStore on iOS — you download the IPA file on your Mac, hold Option in the open AltServer menu, and select the IPA file you want to install.
For anyone hitting NSCocoaErrorDomain 3840 / "Encountered unknown tag html" or AppleDeveloperError 3020 / -80009 MID is invalid on macOS 27 beta - I combined the fixes discussed in #47, #49, and the anisette machineID patch from kimziro's repo into a single rebuilt AltServer.
Root causes (already covered in this thread, just recapping):
Outdated User-Agent causes Apple's servers to drop the connection after 2 of the 3 requests needed for sign-in (#47) Sign-in reuses a connection pinned to a failing backend node instead of retrying fresh (#49) macOS 27's AOSKit returns empty anisette data, breaking machineID (kimziro's fix)
Found the cause, and it is not endpoint-specific, anisette-related or macOS 27-specific.
gsa.apple.com serves two requests per keep-alive connection
The third and every later request on one connection comes back as HTTP 503 with a text/html body. The second response still advertises Connection: keep-alive and Keep-Alive: timeout=30, so a client has no way to know the connection is spent.
Sign-in is exactly three requests on one NSURLSession — SRP init, SRP complete, then o=apptokens for com.apple.gs.xcode.auth — so the last one always fails, and AltSign parses the HTML error page as a property list. That is the NSCocoaErrorDomain 3840.
Reproduction, no credentials involved
The account name is deliberately invalid, so Apple answers every request with an ordinary plist error rather than anything account-specific.
connects=0 is curl reporting that the connection was reused. The same apptokens request on a fresh connection returns a normal plist.
Measured 2026-09-06:
Result
1st, 2nd request on a connection (any o)
200, plist
3rd, 4th request on a connection
503, text/html
o=apptokens first on a fresh connection
200, plist
4 requests to developerservices2.apple.com on one connection
all 200
So it is not apptokens, not the account, and not anisette — four plain o=init requests fail the same way, and developerservices2.apple.com (the whole signing flow) has no such limit.
A retry alone does not help: requests 3 and 4 on the same connection both fail, so whatever put the connection in that state persists.
Fix
Give every gsa.apple.com request its own URLSession and invalidate it when the response arrives. URLSession pools connections per session, so a new session is what forces a new connection.
Verified end to end on macOS 27.0 (26A5421a), AltServer 1.7.2 (build 90), iPhone on iOS 27: sign-in, viewDeveloper, listTeams, addDevice, certificate issuance, app ID creation, provisioning profile download and an actual app install all succeed afterwards. Before the change, apptokens returned the HTML 503 on every attempt.
AltStore needs the same change.AltStoreCore.framework carries the same AltSign GrandSlam code, so signing in inside the app on the device fails identically, and an AltServer-side fix cannot help it. Injecting the same hook into AltStore.app and installing through Sideload .ipa made on-device sign-in and app installation work again.
Unrelated but worth separating out: the stale Xcode 11.2 client identity from #1772 is a real inconsistency, but fixing it alone does not fix this — with a coherent <Mac17,2> <macOS;27.0;26A5421a> <com.apple.AuthKit/1 (com.apple.dt.Xcode/25183.54.10)> string the apptokens request still returned the HTML 503 until connections stopped being reused.
Answering the question about safe diagnostics
Inject a dylib into AltServer through LSEnvironment → DYLD_INSERT_LIBRARIES and swizzle -[NSURLSession dataTaskWithRequest:completionHandler:]. Also swizzle the private _dataTaskWithRequest:delegate:completionHandler:: Swift's async URLSession.data(for:) goes through that one, so hooking only the public factory captures nothing from Swift code paths.
Decode each body as JSON or a property list and redact before writing:
replace with a short stable hash — Apple ID, DSID, team ID, UDID, serial number, and any string of 32+ hex characters;
keep — HTTP status and content type, Status.ec / Status.em, X-Apple-I-Client-Time, X-Mme-Client-Info, X-Apple-I-MD-RINFO, X-Apple-I-Retry-Request-UUID.
What is kept is exactly what identifies this failure — the 503, the text/html content type, and which operation was in flight — and none of it is a credential. That is how the endpoint above was pinned down; the curl reproduction then confirmed it without any account at all.
Found the cause, and it is not endpoint-specific, anisette-related or macOS 27-specific.
gsa.apple.com serves two requests per keep-alive connection
The third and every later request on one connection comes back as HTTP 503 with a text/html body. The second response still advertises Connection: keep-alive and Keep-Alive: timeout=30, so a client has no way to know the connection is spent.
Sign-in is exactly three requests on one NSURLSession — SRP init, SRP complete, then o=apptokens for com.apple.gs.xcode.auth — so the last one always fails, and AltSign parses the HTML error page as a property list. That is the NSCocoaErrorDomain 3840.
Reproduction, no credentials involved
The account name is deliberately invalid, so Apple answers every request with an ordinary plist error rather than anything account-specific.
connects=0 is curl reporting that the connection was reused. The same apptokens request on a fresh connection returns a normal plist.
Measured 2026-09-06:
Result
1st, 2nd request on a connection (any o)
200, plist
3rd, 4th request on a connection
503, text/html
o=apptokens first on a fresh connection
200, plist
4 requests to developerservices2.apple.com on one connection
all 200
So it is not apptokens, not the account, and not anisette — four plain o=init requests fail the same way, and developerservices2.apple.com (the whole signing flow) has no such limit.
A retry alone does not help: requests 3 and 4 on the same connection both fail, so whatever put the connection in that state persists.
Fix
Give every gsa.apple.com request its own URLSession and invalidate it when the response arrives. URLSession pools connections per session, so a new session is what forces a new connection.
Verified end to end on macOS 27.0 (26A5421a), AltServer 1.7.2 (build 90), iPhone on iOS 27: sign-in, viewDeveloper, listTeams, addDevice, certificate issuance, app ID creation, provisioning profile download and an actual app install all succeed afterwards. Before the change, apptokens returned the HTML 503 on every attempt.
AltStore needs the same change.AltStoreCore.framework carries the same AltSign GrandSlam code, so signing in inside the app on the device fails identically, and an AltServer-side fix cannot help it. Injecting the same hook into AltStore.app and installing through Sideload .ipa made on-device sign-in and app installation work again.
Unrelated but worth separating out: the stale Xcode 11.2 client identity from #1772 is a real inconsistency, but fixing it alone does not fix this — with a coherent <Mac17,2> <macOS;27.0;26A5421a> <com.apple.AuthKit/1 (com.apple.dt.Xcode/25183.54.10)> string the apptokens request still returned the HTML 503 until connections stopped being reused.
Answering the question about safe diagnostics
Inject a dylib into AltServer through LSEnvironment → DYLD_INSERT_LIBRARIES and swizzle -[NSURLSession dataTaskWithRequest:completionHandler:]. Also swizzle the private _dataTaskWithRequest:delegate:completionHandler:: Swift's async URLSession.data(for:) goes through that one, so hooking only the public factory captures nothing from Swift code paths.
Decode each body as JSON or a property list and redact before writing:
replace with a short stable hash — Apple ID, DSID, team ID, UDID, serial number, and any string of 32+ hex characters;
keep — HTTP status and content type, Status.ec / Status.em, X-Apple-I-Client-Time, X-Mme-Client-Info, X-Apple-I-MD-RINFO, X-Apple-I-Retry-Request-UUID.
What is kept is exactly what identifies this failure — the 503, the text/html content type, and which operation was in flight — and none of it is a credential. That is how the endpoint above was pinned down; the curl reproduction then confirmed it without any account at all.
Investigated with Claude Code.
So we need fix for both AltStore and AltServer? Understood correctly?
When testing the patches, try to also test the sideloading feature of new apps and its resigning. With the first patch provided I could sideload altstore, but could not sideload apps inside it nor resign.
@Jerry-Master Good check to insist on — sign-in alone is not enough, since AltStore signs apps on device with the same AltSign code.
Tested with the connection-per-request change applied on both sides: the dylib injected into AltServer, and the same hook injected into AltStore.app/AltStoreCore.framework, installed through Sideload .ipa. macOS 27.0 (26A5421a), AltServer 1.7.2 (build 90), iPhone on iOS 27, free Apple ID.
Working after the patch:
signing and installing AltStore itself from AltServer;
signing in with the Apple ID inside AltStore on the device — this is the part an AltServer-only fix cannot reach;
installing an .ipa from within AltStore — installed a game right away and it launched;
refresh / re-signing of installed apps, plus viewDeveloper, listTeams, addDevice, certificate issuance, app ID creation and provisioning profile download.
So the sideload-and-resign path does work, provided the patch is in AltStore too and not only in AltServer. That also matches @Morritz's result with the v1.7.2-macos27-fix build: it fixes the Mac side, but on-device sign-in goes through AltStoreCore.framework, which still sends all three GrandSlam requests over one pooled connection.
Upstream this is now rileytestut/AltSign#52, which does exactly this — a separate session per GrandSlam request — and additionally reports 5xx instead of parsing the HTML error page as a plist. AltStore needs to pick that AltSign change up as well, not only AltServer.
For anyone hitting NSCocoaErrorDomain 3840 / "Encountered unknown tag html" or AppleDeveloperError 3020 / -80009 MID is invalid on macOS 27 beta - I combined the fixes discussed in #47, #49, and the anisette machineID patch from kimziro's repo into a single rebuilt AltServer.
Root causes (already covered in this thread, just recapping):
Outdated User-Agent causes Apple's servers to drop the connection after 2 of the 3 requests needed for sign-in (#47) Sign-in reuses a connection pinned to a failing backend node instead of retrying fresh (#49) macOS 27's AOSKit returns empty anisette data, breaking machineID (kimziro's fix) https://github.com/FrakesH/AltStore/releases/tag/v1.7.2-macos27-fix
@FrakesH I have problem with NSCocoaErrorDomain 3840 and using this build doesn't fix it for me.
Thanks for your action. When I use this build, it can fix the issue on Mac, I could install the altstore into my iphone. However, when I try to login with my apple account to the altstore on the phone, I got failure - incorrect data format.
For anyone hitting NSCocoaErrorDomain 3840 / "Encountered unknown tag html" or AppleDeveloperError 3020 / -80009 MID is invalid on macOS 27 beta - I combined the fixes discussed in #47, #49, and the anisette machineID patch from kimziro's repo into a single rebuilt AltServer.
Root causes (already covered in this thread, just recapping):
Outdated User-Agent causes Apple's servers to drop the connection after 2 of the 3 requests needed for sign-in (#47) Sign-in reuses a connection pinned to a failing backend node instead of retrying fresh (#49) macOS 27's AOSKit returns empty anisette data, breaking machineID (kimziro's fix) https://github.com/FrakesH/AltStore/releases/tag/v1.7.2-macos27-fix
@FrakesH I have problem with NSCocoaErrorDomain 3840 and using this build doesn't fix it for me.
Thanks for your action. When I use this build, it can fix the issue on Mac, I could install the altstore into my iphone. However, when I try to login with my apple account to the altstore on the phone, I got failure - incorrect data format.
For anyone hitting NSCocoaErrorDomain 3840 / "Encountered unknown tag html" or AppleDeveloperError 3020 / -80009 MID is invalid on macOS 27 beta - I combined the fixes discussed in #47, #49, and the anisette machineID patch from kimziro's repo into a single rebuilt AltServer.
Root causes (already covered in this thread, just recapping):
Outdated User-Agent causes Apple's servers to drop the connection after 2 of the 3 requests needed for sign-in (#47) Sign-in reuses a connection pinned to a failing backend node instead of retrying fresh (#49) macOS 27's AOSKit returns empty anisette data, breaking machineID (kimziro's fix) https://github.com/FrakesH/AltStore/releases/tag/v1.7.2-macos27-fix
@FrakesH I have problem with NSCocoaErrorDomain 3840 and using this build doesn't fix it for me.
Thanks for your action. When I use this build, it can fix the issue on Mac, I could install the altstore into my iphone. However, when I try to login with my apple account to the altstore on the phone, I got failure - incorrect data format.
Directly sideload the apps from AltServer
That works. Do you know how to re-enable JIT for LiveContainer?
I'm stuck on this step as the AltServer says altjit returns error code 1
Almost there, just tried @FrakesH method, but ran into the another error:
AltServer could not sign in with your Apple ID. The secure sign-in with Apple could not be completed.
Check the network and device date and time, then update AltForge Server before retrying.
Almost there, just tried @FrakesH method, but ran into the another error:
AltServer could not sign in with your Apple ID. The secure sign-in with Apple could not be completed. Check the network and device date and time, then update AltForge Server before retrying.
That's actually progress, you got further than the account sign-in step and now failing on the trusted-device verification request specifically (that's the part that pushes the 2FA prompt to your other devices). A 500 with an XML body from Apple's side usually means their server choked on that specific request, could be a transient issue on Apple's end, or that particular endpoint still needs the same User-Agent/header treatment we applied to the login flow but wasn't covered by this patch.
A couple things worth trying first: double check your Mac's date and time are correct and set automatically, and make sure you don't have more than one trusted device pending a stale sign-in request (sometimes an old hung request on another device blocks new ones). If it still fails after that, it might need another User-Agent fix specific to that request type, will dig into it.
@FrakesH I confirm date is correct and set automatically, I am not sure how to prevent pending stale sign-in requests: I have restarted altserver, closed altstore on iphone. I cannot sideload the patched ipa. The error happen when I try to sideload the ipa to the device from the altstore server.
@FrakesH I confirm date is correct and set automatically, I am not sure how to prevent pending stale sign-in requests: I have restarted altserver, closed altstore on iphone. I cannot sideload the patched ipa. The error happen when I try to sideload the ipa to the device from the altstore server.
Let's start fresh, clean slate. Can you try this in order:
Quit AltServer completely (right click the menu bar icon, Quit, not just closing a window).
Delete /Applications/AltServer.app.
Delete the whole folder at ~/Library/Application Support/AltServer (this includes the anisette cache JSON file, not just config).
On your iPhone, delete the AltStore app
Download the release again fresh from here: https://github.com/FrakesH/AltStore/releases/tag/v1.7.2-macos27-fix-altstore-fix
Install AltServer (right click the .app, Open, allow it through Gatekeeper if needed).
Open AltServer's menu bar icon, hold Option, and pick AltStore-patched.ipa from the release to sideload it fresh onto your phone.
Open AltStore on your phone and try signing in.
If you still hit the same error after doing all of that from a clean state, try signing in with a completely different, freshly created Apple ID instead of your usual one, that'll help tell us if it's something specific to your account getting flagged versus a leftover local state issue.
@FrakesH followed all instruction step by step. Still the same error on ipa sideload apple login:
AltStore.AppleDeveloperError 3020
Error Description
AltServer could not sign in with your Apple ID. The secure sign-in with Apple could not be completed.
Failure
AltServer could not sign in with your Apple ID.
Failure Reason
The secure sign-in with Apple could not be completed.
Recovery Suggestion
Check the network and device date and time, then update AltForge Server before retrying.
Underlying Error
Error Domain=NSURLErrorDomain Code=-1011 "(null)"
ALTAppleAPIHTTPStatusCode
500
ALTAppleAPIRequestOperation
trusted-device.request
ALTAppleAPIResponseMIMEType
text/xml
Maybe irrelevant but if I put the incorrect password I get the wrong password error first. This happen after password is validated as correct.
@FrakesH followed all instruction step by step. Still the same error on ipa sideload apple login:
AltStore.AppleDeveloperError 3020
Error Description
AltServer could not sign in with your Apple ID. The secure sign-in with Apple could not be completed.
Failure
AltServer could not sign in with your Apple ID.
Failure Reason
The secure sign-in with Apple could not be completed.
Recovery Suggestion
Check the network and device date and time, then update AltForge Server before retrying.
Underlying Error
Error Domain=NSURLErrorDomain Code=-1011 "(null)"
ALTAppleAPIHTTPStatusCode
500
ALTAppleAPIRequestOperation
trusted-device.request
ALTAppleAPIResponseMIMEType
text/xml
Maybe irrelevant but if I put the incorrect password I get the wrong password error first. This happen after password is validated as correct.
Honestly, at this point it might just be faster to try a completely different Apple ID (a new one, or a different existing one) rather than digging further into this specific endpoint. If the trusted-device request is failing for account-specific reasons (rate limiting, flagged account, stale 2FA state tied to that Apple ID specifically), a fresh account sidesteps the whole thing.
The fact that @nenavizhuleto has the exact same issue point to this not being account specific. But tomorrow I can try with a new account if needed
Personally I didn't run into that issue, but during testing I kept clearing the cache and switching Apple IDs every time, thinking the accounts themselves were the problem. The accounts that had no device attached to them worked fine, but I hit Apple's SMS code rate limit, so I ended up having to use a clean Apple ID on an old iPhone to receive the push notification with the code. That one worked fine from the start and still works fine now.
For those who are having issues using v1.7.2-macos27-fix, make sure to update your Mac to the latest version. I was having the same -80009 issue, but updating solved it for me
Is this first complete fix so far and it works?
Does it require Mac OS 27 and iOS 27v
Its second anisette fix, you can also try the kimziro on 1.7.6, but i took the latest 1.8. Some one told me the new remote feature worked now for him/her. Tried on macos27 and ios27 alpha. For older macos you could try older altserver releases
Activity
Londeren commentedon Sep 5, 2026
The same here
madpark commentedon Sep 5, 2026
I'm having a same problem..
kouiti commentedon Sep 5, 2026
I feel the same way.
eroo58 commentedon Sep 5, 2026
Same problem
Unkn0wnKisuke commentedon Sep 5, 2026
Experiencing this issue also.
kimziro commentedon Sep 5, 2026
I investigated the macOS 27/iOS 27 refresh/sign-in failure with stock AltServer 1.7.2 and a local v1.0.4 build (internal anisette helper v3.3).
Environment
26A5425a),Mac16,12Confirmed flow
Stock:
The user-visible authentication/refresh error is
NSCocoaErrorDomain3840, “The data couldn’t be read because it isn’t in the correct format.” I am treating that parser error separately from the local AOSKit failure.v1.0.4/v3.3:
The helper derives
X-Mme-Client-Infofromhw.model, the macOS product version/build, and Xcode25183.54.10. Exact type-encoding checks guard hooks forretrieveOTPHeadersForDSID:, theALTAnisetteDatainitializer, andsetDeviceDescription:. A guarded one-shot retry covers lateAltSignloading. Existing identity data is retained without reprovisioning. No raw headers are included here.During the latest test, the helper ran three times and each request returned HTTP 200 and exited normally, confirming that the Mac-side anisette stage completed. AltServer did not crash or restart. A later iPhone attach/detach sequence reported
kAMDPasswordProtectedError, so device lock state may affect subsequent device operations, but it does not explain the earlier authentication parser error.Remaining failure (inference clearly marked)
A separate iPhone Console capture showed HTTP 200, HTTP 200, then HTTP 503 on one connection, but it did not identify the endpoint/body or contain the 3840 exception. Thus only a correlated 503 is proven. Apple GrandSlam
init/complete200 followed by an HTMLapptokens503 is a strong inference, supported by SideStore#1446, not a confirmed endpoint for this run.The local patch fixes the macOS 27 AOSKit/anisette stage, but it cannot guarantee success through an Apple HTML 503,
apptokensservice error, or another upstream 401/503. Parsing such an HTTP error body as a plist can surface as error 3840.Reproduction / safe diagnostics
machineIDstage and downstream authentication response.Expected: coherent current client info and valid V3 anisette headers pass the anisette stage.
Observed: helper HTTP 200/anisette succeeds and the empty AOSKit result is not passed through; a later 3840 may still be caused by a downstream Apple HTTP error.
Questions for maintainers
X-Mme-Client-Infoinstead of accepting legacyXcode/3594.4.19values (see #1772)?Please use redacted metadata only. Do not publish Apple IDs, DSIDs, tokens, cookies, authentication/anisette headers, raw plist/HTML bodies, identity files, usernames, device names, IPs, or local paths.
Related: #1781, #1772, and SideStore#1446. Patch source: altserver-macos27-anisette-fix.
FrakesH commentedon Sep 6, 2026
For anyone hitting NSCocoaErrorDomain 3840 / "Encountered unknown tag html" or AppleDeveloperError 3020 / -80009 MID is invalid on macOS 27 beta - I combined the fixes discussed in #47, #49, and the anisette machineID patch from kimziro's repo into a single rebuilt AltServer.
Root causes (already covered in this thread, just recapping):
Outdated User-Agent causes Apple's servers to drop the connection after 2 of the 3 requests needed for sign-in (#47)
Sign-in reuses a connection pinned to a failing backend node instead of retrying fresh (#49)
macOS 27's AOSKit returns empty anisette data, breaking machineID (kimziro's fix)
https://github.com/FrakesH/AltStore/releases/tag/v1.7.2-macos27-fix
Guys, I used this to install the IPA files I needed onto my iPhone — forgot to mention that this only fixes the macOS side; on iOS you'll still get that same error. But AltServer has a feature to sideload IPA files directly without going through AltStore on iOS — you download the IPA file on your Mac, hold Option in the open AltServer menu, and select the IPA file you want to install.
Morritz commentedon Sep 6, 2026
@FrakesH I have problem with NSCocoaErrorDomain 3840 and using this build doesn't fix it for me.
CircuitSerein commentedon Sep 6, 2026
Found the cause, and it is not endpoint-specific, anisette-related or macOS 27-specific.
gsa.apple.comserves two requests per keep-alive connectionThe third and every later request on one connection comes back as
HTTP 503with atext/htmlbody. The second response still advertisesConnection: keep-aliveandKeep-Alive: timeout=30, so a client has no way to know the connection is spent.Sign-in is exactly three requests on one
NSURLSession— SRPinit, SRPcomplete, theno=apptokensforcom.apple.gs.xcode.auth— so the last one always fails, and AltSign parses the HTML error page as a property list. That is theNSCocoaErrorDomain 3840.Reproduction, no credentials involved
The account name is deliberately invalid, so Apple answers every request with an ordinary plist error rather than anything account-specific.
connects=0is curl reporting that the connection was reused. The sameapptokensrequest on a fresh connection returns a normal plist.Measured 2026-09-06:
o)200, plist503,text/htmlo=apptokensfirst on a fresh connection200, plistdeveloperservices2.apple.comon one connection200So it is not
apptokens, not the account, and not anisette — four plaino=initrequests fail the same way, anddeveloperservices2.apple.com(the whole signing flow) has no such limit.A retry alone does not help: requests 3 and 4 on the same connection both fail, so whatever put the connection in that state persists.
Fix
Give every
gsa.apple.comrequest its ownURLSessionand invalidate it when the response arrives.URLSessionpools connections per session, so a new session is what forces a new connection.Verified end to end on macOS 27.0 (
26A5421a), AltServer 1.7.2 (build 90), iPhone on iOS 27: sign-in,viewDeveloper,listTeams,addDevice, certificate issuance, app ID creation, provisioning profile download and an actual app install all succeed afterwards. Before the change,apptokensreturned the HTML 503 on every attempt.AltStore needs the same change.
AltStoreCore.frameworkcarries the same AltSign GrandSlam code, so signing in inside the app on the device fails identically, and an AltServer-side fix cannot help it. Injecting the same hook intoAltStore.appand installing through Sideload .ipa made on-device sign-in and app installation work again.Unrelated but worth separating out: the stale Xcode 11.2 client identity from #1772 is a real inconsistency, but fixing it alone does not fix this — with a coherent
<Mac17,2> <macOS;27.0;26A5421a> <com.apple.AuthKit/1 (com.apple.dt.Xcode/25183.54.10)>string theapptokensrequest still returned the HTML 503 until connections stopped being reused.Answering the question about safe diagnostics
Inject a dylib into AltServer through
LSEnvironment→DYLD_INSERT_LIBRARIESand swizzle-[NSURLSession dataTaskWithRequest:completionHandler:]. Also swizzle the private_dataTaskWithRequest:delegate:completionHandler:: Swift's asyncURLSession.data(for:)goes through that one, so hooking only the public factory captures nothing from Swift code paths.Decode each body as JSON or a property list and redact before writing:
A2k,M1,M2,c,s,spd,sk,np),t, cookies,X-Apple-I-MD/X-Apple-I-MD-M,adi_pb;Status.ec/Status.em,X-Apple-I-Client-Time,X-Mme-Client-Info,X-Apple-I-MD-RINFO,X-Apple-I-Retry-Request-UUID.What is kept is exactly what identifies this failure — the 503, the
text/htmlcontent type, and which operation was in flight — and none of it is a credential. That is how the endpoint above was pinned down; the curl reproduction then confirmed it without any account at all.Investigated with Claude Code.
Morritz commentedon Sep 6, 2026
So we need fix for both AltStore and AltServer? Understood correctly?
Jerry-Master commentedon Sep 6, 2026
When testing the patches, try to also test the sideloading feature of new apps and its resigning. With the first patch provided I could sideload altstore, but could not sideload apps inside it nor resign.
CircuitSerein commentedon Sep 6, 2026
@Jerry-Master Good check to insist on — sign-in alone is not enough, since AltStore signs apps on device with the same AltSign code.
Tested with the connection-per-request change applied on both sides: the dylib injected into AltServer, and the same hook injected into
AltStore.app/AltStoreCore.framework, installed through Sideload .ipa. macOS 27.0 (26A5421a), AltServer 1.7.2 (build 90), iPhone on iOS 27, free Apple ID.Working after the patch:
.ipafrom within AltStore — installed a game right away and it launched;viewDeveloper,listTeams,addDevice, certificate issuance, app ID creation and provisioning profile download.So the sideload-and-resign path does work, provided the patch is in AltStore too and not only in AltServer. That also matches @Morritz's result with the
v1.7.2-macos27-fixbuild: it fixes the Mac side, but on-device sign-in goes throughAltStoreCore.framework, which still sends all three GrandSlam requests over one pooled connection.Upstream this is now rileytestut/AltSign#52, which does exactly this — a separate session per GrandSlam request — and additionally reports 5xx instead of parsing the HTML error page as a plist. AltStore needs to pick that AltSign change up as well, not only AltServer.
AlanLi216 commentedon Sep 6, 2026
Thanks for your action. When I use this build, it can fix the issue on Mac, I could install the altstore into my iphone. However, when I try to login with my apple account to the altstore on the phone, I got failure - incorrect data format.
blavkice commentedon Sep 6, 2026
Directly sideload the apps from AltServer
Morritz commentedon Sep 6, 2026
That works. Do you know how to re-enable JIT for LiveContainer?
I'm stuck on this step as the AltServer says altjit returns error code 1
13 remaining items
creativetags commentedon Sep 7, 2026
Thanks @FrakesH just tested and it works!
nenavizhuleto commentedon Sep 7, 2026
Almost there, just tried @FrakesH method, but ran into the another error:
AltServer could not sign in with your Apple ID. The secure sign-in with Apple could not be completed.
Check the network and device date and time, then update AltForge Server before retrying.
AltStore.AppleDeveloperError 3020
Error Domain=NSURLErrorDomain Code=-1011 "(null)"
ALTAppleAPIHTTPStatusCode 500
ALTAppleAPIRequestOperation trusted-device.request
ALTAppleAPIResponseMIMEType text/xml
innocentiv commentedon Sep 7, 2026
I have the exact same error as @nenavizhuleto using @FrakesH method
FrakesH commentedon Sep 7, 2026
That's actually progress, you got further than the account sign-in step and now failing on the trusted-device verification request specifically (that's the part that pushes the 2FA prompt to your other devices). A 500 with an XML body from Apple's side usually means their server choked on that specific request, could be a transient issue on Apple's end, or that particular endpoint still needs the same User-Agent/header treatment we applied to the login flow but wasn't covered by this patch.
A couple things worth trying first: double check your Mac's date and time are correct and set automatically, and make sure you don't have more than one trusted device pending a stale sign-in request (sometimes an old hung request on another device blocks new ones). If it still fails after that, it might need another User-Agent fix specific to that request type, will dig into it.
innocentiv commentedon Sep 7, 2026
@FrakesH I confirm date is correct and set automatically, I am not sure how to prevent pending stale sign-in requests: I have restarted altserver, closed altstore on iphone. I cannot sideload the patched ipa. The error happen when I try to sideload the ipa to the device from the altstore server.
FrakesH commentedon Sep 7, 2026
Let's start fresh, clean slate. Can you try this in order:
Quit AltServer completely (right click the menu bar icon, Quit, not just closing a window).
Delete /Applications/AltServer.app.
Delete the whole folder at ~/Library/Application Support/AltServer (this includes the anisette cache JSON file, not just config).
On your iPhone, delete the AltStore app
Download the release again fresh from here: https://github.com/FrakesH/AltStore/releases/tag/v1.7.2-macos27-fix-altstore-fix
Install AltServer (right click the .app, Open, allow it through Gatekeeper if needed).
Open AltServer's menu bar icon, hold Option, and pick AltStore-patched.ipa from the release to sideload it fresh onto your phone.
Open AltStore on your phone and try signing in.
If you still hit the same error after doing all of that from a clean state, try signing in with a completely different, freshly created Apple ID instead of your usual one, that'll help tell us if it's something specific to your account getting flagged versus a leftover local state issue.
innocentiv commentedon Sep 7, 2026
@FrakesH followed all instruction step by step. Still the same error on ipa sideload apple login:
Maybe irrelevant but if I put the incorrect password I get the wrong password error first. This happen after password is validated as correct.
FrakesH commentedon Sep 7, 2026
Honestly, at this point it might just be faster to try a completely different Apple ID (a new one, or a different existing one) rather than digging further into this specific endpoint. If the trusted-device request is failing for account-specific reasons (rate limiting, flagged account, stale 2FA state tied to that Apple ID specifically), a fresh account sidesteps the whole thing.
innocentiv commentedon Sep 7, 2026
The fact that @nenavizhuleto has the exact same issue point to this not being account specific. But tomorrow I can try with a new account if needed
FrakesH commentedon Sep 7, 2026
Personally I didn't run into that issue, but during testing I kept clearing the cache and switching Apple IDs every time, thinking the accounts themselves were the problem. The accounts that had no device attached to them worked fine, but I hit Apple's SMS code rate limit, so I ended up having to use a clean Apple ID on an old iPhone to receive the push notification with the code. That one worked fine from the start and still works fine now.
waru0 commentedon Sep 8, 2026
Im having the same exct issue followed the clean installation listed above , but i still get
Date is right , network is fine , im doing this with a cable connected directly to the phone
TonyKim02 commentedon Sep 8, 2026
For those who are having issues using
v1.7.2-macos27-fix, make sure to update your Mac to the latest version. I was having the same -80009 issue, but updating solved it for mean-vo90 commentedon Sep 17, 2026
https://github.com/an-vo90/AltServer-1.8-build97-Anisette-Fix-macos27-alpha try this, its altserver 1.8 (97). own kimziro fix, it generates an error log but works fine
Morritz commentedon Sep 17, 2026
Is this first complete fix so far and it works?
Does it require Mac OS 27 and iOS 27v
an-vo90 commentedon Sep 17, 2026
Its second anisette fix, you can also try the kimziro on 1.7.6, but i took the latest 1.8. Some one told me the new remote feature worked now for him/her. Tried on macos27 and ios27 alpha. For older macos you could try older altserver releases