Intermittent issue with installing versions
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 4.8k
- Forks
- 182
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 1
Description
I'm experiencing something similar to #406 but without a company-managed Apple ID. Importantly, this is only happening intermittently, but it happens enough to be a blocker in many cases.
There are two commands that are failing intermittently:
xcodes update --data-source applexcodes install <version>
In both cases, I see the following error in the terminal:
The operation couldn’t be completed. (DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character '<' around line 1, column 1." UserInfo={NSDebugDescription=Unexpected character '<' around line 1, column 1., NSJSONSerializationErrorIndex=0}))))
From the error it seems like the endpoint that is being requested is returning HTML instead of JSON. Is there a way we can debug this by printing out the response from Apple's servers? Failing that, what curl command can I use to make a similar request, to see what Apple is returning?
Just to note that I'm also seeing the same issue in the Xcodes app.
Things I've tried:
- Using
xcodes signoutand re-authenticating - Changing the password in my Apple account
Screenshots
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the xcodes update --data-source apple and xcodes install <version> entry points and reproduce the intermittent DecodingError.dataCorrupted response. Inspect the response from Apple's servers, including cases where HTML is returned instead of JSON. Done means the failure is diagnosed and the relevant error handling or debugging output is improved for both CLI commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100