Yesterday evening, upon a fresh install, my app was not able to decrypt the CoreML model and kept returning status code 503. I understood this as: Apple's service to download the decryption key is not available at the moment. This problem persisted for at least 8 hours. Three questions:
- Does that occur more often? It means that during such times, new customers of my app will not be able to use the app.
- Anyone has some sample code on how to identify this situation / extract the status code from the error object? (Instead of error 'You need an internet connection' I would like to issue error 'Apple server currently not available - try again later')
- Anyone knows how to force/simulate this situation so that I can analyse the error object and see how I can identify the situation?
Below my code to retrieve the model:
NSURL *modelUrl = [[NSBundle mainBundle] URLForResource:modelName withExtension:@"mlmodelc"];
[MLModel loadContentsOfURL:modelUrl
configuration:[[MLModelConfiguration alloc] init]
completionHandler:^(MLModel *loadedModel, NSError *error) {
if (nil == loadedModel) {
NSLog(@"Error loading model: %@", (nil != error) ? error : modelUrl);
Sorry about the disruption. We root-caused the issue and addressed it and there are guardrails in place to ensure this does not repeat.
Does that occur more often? It means that during such times, new customers of my app will not be able to use the app.
No, this is the first time since the feature went public more than 2 years back and we are taking steps to make sure this won't happen.
Anyone has some sample code on how to identify this situation / extract the status code from the error object? (Instead of error 'You need an internet connection' I would like to issue error 'Apple server currently not available - try again later')
The returned error should be MLModelErrorModelDecryptionKeyFetch
. Yes, this would be the error even when the device is offline.
Anyone knows how to force/simulate this situation so that I can analyse the error object and see how I can identify the situation?
There's no clear way to simulate / force this scenario.