Intermittent issue with installing versions
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 apple -
xcodes 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
Same issue for me. New MacBook Pro, can't get xcodes to work
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={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character '<' around line 1, column 1.})))) 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={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character '<' around line 1, column 1.}))))
Also running into this, and changed my password. Twice.