6

I’m validating receipts with the App Store. In very rare instances (~0,5‰), the JSON looks like this:

{
    "exception": "com.apple.jingle.commercelogic.inappcache.MZInAppCacheAccessException",
    "status": 21009,
    "environment": "Production"
}

Sadly, Apple does not mention this code in their status code table.

Searching for the exception’s name, there was merely a single reference web-wide, and that’s a denotative thread at Apple Developer Forums: What is Error code 21009? Aside from a few “me too” posts, there’s an Apple staff answer stating to “respond with more information when” there will be “concrete information”.

Regarding frequency: The thread’s dated 2016-03-15. I know of occurrences on these dates:

• 2015-10-08    • 2016-11-24    • 2017-01-09    • 2017-02-03 8× • 2017-04-04
• 2016-03-16    • 2016-12-06    • 2017-01-13    • 2017-03-07    • 2017-04-05
• 2016-06-06    • 2016-12-13    • 2017-01-17    • 2017-03-13    • 2017-04-06
• 2016-08-30    • 2017-01-04    • 2017-02-15    • 2017-03-17 2× • 2017-04-07
• 2016-09-08    • 2017-01-07    • 2017-02-18    • 2017-03-23 2× • …
• 2016-09-23    • 2017-01-08 2× • 2017-02-19    • 2017-03-27

While this exception seems rare enough to be negligible, I’d appreciate some light shed on it.

Has anyone figured out an appropriate way of handling this exception? (like revalidation)

What does this exception actually mean? (What’s “jingle”, “commercelogic” and “MZInAppCache”?)

dakab
  • 5,379
  • 9
  • 43
  • 67
  • Any updates on this question? I'm receiving: `{"status":21104, "environment":"Production", "is_retryable":true, "exception":"com.apple.jingle.commercelogic.inapplocker.exception.MZInAppLockerAccessException"}` – themenace Aug 20 '20 at 13:08

3 Answers3

3

I faced the same issue. I got this about 50 times per day. It's internal receipt's server error. I process this case the same as status 21005 (Service not available). So, I just add receipt with status 21009 to queue of failed validations. And trying again later - it works.

UPDATED 2016-10-11: At the last 24 hours I got this status 140 times. So, it has sense to proceed this status as internal service error.

Stafox
  • 1,007
  • 14
  • 25
  • While it’s surely depending on one’s customer base, 50× a day seems quite severe. Is it really “per day on average”, or a spike on a particular day? Have you any evidence, apart from experience, that this is actually an “internal receipt server error”? – dakab Oct 06 '16 at 15:10
  • I found this answer on apple's forum https://forums.developer.apple.com/thread/42678#thread-message-124658. 50 times per day - I measured it as average for the last 3 days. But, for example, at last 22 hours I caught it only 18 times. So, it depends on user's activity and requests count to the service. I think at weekend this number will be greater. I reported a documentation bug to Apple's bugreport to add status `21009` to docs with explanation. – Stafox Oct 07 '16 at 06:01
  • Apple added info about status 21009 https://developer.apple.com/library/content/technotes/tn2413/_index.html – Stafox Apr 27 '17 at 09:12
0

On 2017-02-09, Apple added a question via Technical Note TN2413 to their In-App Purchase FAQ:


When validating my receipt, the App Store returns a status code of 21009

The status code of 21009 indicates that there was a problem with the receipt validation process. For most cases, this was a temporary issue with the server and you should retry validating your receipt with the App Store.

In other cases, 21009 will be returned when the user account associated with the receipt was deleted or when the receipt contains some invalid information. As these cases are extremely rare, please file a bug at https://bugreport.apple.com when encountering them.

Source: Apple: Technical Note TN2413 / In-App Purchase FAQ


Hence we know:

  • It indicates a problem with the (internal) receipt validation.
  • It’s most likely a temporary issue.
  • It might be caused by a deleted Apple user account or invalid receipt data.
  • Revalidation will solve most cases. Otherwise, Apple encourages filing a bug report.

That doesn’t explain the disclosed exception and its components, but provides at least some meaning and means to proceed.

Community
  • 1
  • 1
dakab
  • 5,379
  • 9
  • 43
  • 67
0

As Apple recently added 21100-21199 status code, maybe this status should never happen again? not sure.

Recently I got this from Apple's Server: {"environment" => "Production", "exception" => "com.apple.jingle.commercelogic.inappcache.MZInAppCacheAcces‌​sException", "is_retryable" => true, "status" => 21199}

linjunpop
  • 211
  • 1
  • 4
  • 11
  • Indeed… and it’s `21009` all over again. I can’t find descriptions on `21199`, but got it on 22/23/25 August as well as on 2017-10-18 and 2017-12-04 so far. – dakab Dec 04 '17 at 11:46
  • … four other on 2018-02-21. – dakab Feb 23 '18 at 07:09