In-App purchase fails but system dialog say you're all set

### Platform

iOS 12.1


### Device

iPhone 6 (real device, not simulator)


### In app purchase type

Auto-Renewable Subscription


### Environment

Sandbox


### Report

Since a few hours I am unable to test my in-app purchases:

1. When executing the purchase option, the system will receive messages that the purchase has been completed ("You are all set. Your purchase was successful"). In fact the error occurs "Cannot connect to iTunes Store". The problem came suddenly, old app versions that worked before also have this bug. I suspect the bug is caused by apple.


Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store"
enum value = SKErrorUnknown


Note: A few hours ago I immediately received the message that the connection to iTunes is not possible. Without the success system messages.
https://developer.apple.com/system-status/ indicates that there are no erros
At the moment: some people on twitter and stackOverflow are also indicating that they have this problem.


### Steps tried

  1. Deleted app
  2. Logout from app store
  3. Restarted Phone
  4. Deleted sandbox user on itunes connect
  5. Created new sandbox user on itunes connect
  6. Installed app
  7. Entered sandbox credentials
  8. Executed in-app purchase
  9. Error still occours

Replies

same here

Same here. Have you guys been able to get this work?

I've had a number of similar reports as DTS incidents. I'm aware that App Store Server engineering is beginning to investigate the submitted reports. I've not had a response. However, I'm advising developer who contact DTS to submit bug reports. What I don't know is whether the fix to this issue addresses the issue for everyone or whether the fix must be applied to individual accounts - (many of the failures where the SKProductRequest stops validating iAP identifiers requires an individual account correction). As such anyone that is affect, please submit a bug report. To submit the bug report, please install the StoreKit profile and replicate the problem using either the sandbox or production version of the app. If you do have a development version of the app, please first take the time to insert and NSLog statement at the entry to the updatedTransactions delegate method to indicate the state that the delegate method was called (to demonstrate that the delegate was called with the .failed transactionState).


Here are the instructions to install the StoreKit profile

Install StoreKit profile to an iOS 11+ device

Please login to the Apple Developer Bug Report - Profiles and Logs website

<https://developer.apple.com/bug-reporting/profiles-and-logs/> using Safari on the device you will use to replicate the problem with.

Click the “Profile” URL associated with the “App Store/iTunes Store for iOS” item. You will download the “itmsdebugging.mobileconfig” file.

IMPORTANT - PLEASE RESTART THE DEVICE


CAPTURE THE DEVICE CONSOLE LOG - connect the device to a macOS X Sierra system (macOS X 10.12.x or newer)

1. Launch the Console app on the macOS system, and select the device in the left side of the Console window

2. Before starting the iOS app, click “Clear”.

3. Start the application and perform the steps to replicate the problem.

4. When the issue occurs, save the contents of the Console log

Check the contents of the console log for the string “fetchSoftwareAddOns”. If this string is not present in the log, the profile was not active. Please re-install the StoreKit profile and make sure to restart the device.


If the string is found, save the entire contents of the console log to a text file.


To submit a bug report, please use the Apple Developer Bug Report web page - http://bugreport.apple.com. After logging in, select the “Other” Product.


In the bug report description, please add the following information

1. the application ID of the app

2. the In-App Purchase identifier(s) if applicable

3. whether this issue is occurring in the sandbox or production environments

4. instructions for finding the "Buy" button to purchase the In-App Purchase item.


(if the app is not in English, please provide screenshots)


Note that if this issue is replicated with a sandbox version of the app, you may be asked to submit a TestFlight invitation to “apps_test@icloud.com” so that the QA team can replicate the problem themselves. For reports occurring with production apps, the QA team can install the app directly from the App Store.


Please send the bug report to me directly - <mailto://rkubota@apple.com//rkubota@apple.com> I want to make sure the bug report is assigned to the App Store Server QA team.


rich kubota - rkubota@apple.com


developer technical support CoreOS/Hardware/MFI

StoreKitClient: Buy failed with error: Error Domain=SSErrorDomain Code=2 "Impossibile connettersi a iTunes Store" UserInfo={NSLocalizedDescription=Impossibile connettersi a iTunes Store} for payment: (entity: MicroPayment; id: 0xcf217afa7e42cd21 <x-coredata://3225EB59-1247-4B45-A49C-8EC3ED7E77A2/MicroPayment/p581> ; data: )

To all - I've just heard from App Store Server QA, that they have yet to be able to replicate the issue. Not everyone is being affected by this issue. As such, there are two options to proceed with.


If the problem exists with a production app, and every customer is affected, make sure this is clear in the bug report. And send me the bug report and make sure to note this fact.


If the problem is only occurring in thw sandbox, the two options are

1. submit for a TestFlight build of the app and send an external TestFlight invitation to <mailto://apps_test@icloud.com//apps_test@icloud.com>

when you send the testflight invitation make sure to note the bug report number in the invitation - so that QA can associate the invitation with the bug report. After sending the update, please update the bug report to note that the external Testflight invitation has been sent.

2. If creating the TestFlight build is not expedient, the other option is to replicate the issue with the StoreKit profile installed but capture a sysdiagnose archive from the device after replicating the problem.

The instructions for capturing a sysdiagnose archive are avaialble at <https://download.developer.apple.com/iOS/iOS_Logs/sysdiagnose_Logging_Instructions.pdf>

Please ulpoad the archive to your bug report.

The resulting archive is quite large ~ 150Mb. The Bug Report web page will accept such large uploads.


Thank you


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

i'm seeing the same issue. is there an existing bug report note in the invitation?

Happening with our app too. When I click the link for sysdiagnose I get a 'sorry you cannot view this page' msg?

Heres the instructions for capturing a sysdiagnose archive.


Sysdiagnose (iOS)

For general iOS issues, please gather a sysdiagnose.
 


Enabling Logging


Note: You can also use AssistiveTouch to trigger an iOS sysdiagnose. Instructions here.

1. Reproduce the issue. Important: Note the date and time issue occurred and add this information to the bug report.

2. Trigger a sysdiagnose by simultaneously pressing and releasing both volume buttons + the Side (or Top) button for 1 to 1.5 seconds.


Notes:


- A screenshot will also be taken when the buttons are pressed and released.


- The sysdiagnose is triggered upon button release.


- On an iPhone you will feel a short vibration when a sysdiagnose is successfully triggered. (The vibration will not occur on an iPad).

3. Wait 10 minutes for the diagnostic gathering to complete.

4. Sync device with iTunes on your host computer or AirDrop the file to your Mac computer.

5. Attach the file listed at the path below under Log Locations to your bug report.

Notes: 


- It’s very important to note the date and time you reproduced the issue in your bug report. This information will help the engineering team pinpoint the issue in the log file.


- If applicable, please provide the name(s) of the affected app(s) in the bug report.

- Trigger the sysdiagnose as soon as possible after the problem occurs, even if the logs can’t be synced until later.

Log Locations

iOS:


Go to: Settings.app > Privacy > Analytics > Analytics Data > 


Locate the sysdiagnose file and AirDrop it to your Mac. Scroll down, if necessary, to the point where you see the sysdiagnose with today's date, tap on that file and then tap the box with an arrow in it at the top right. Then choose the Mac device to send it to from the list of devices that appear in the AirDrop area. Once the transfer is complete (this may take several minutes), the file will be located in the /Users/[Your Username]/Downloads folder. The name will be similar to this: “sysdiagnose_YYYY.MM.DD_HH-MM-SS-XX..."

macOS:

~/Library/Logs/CrashReporter/MobileDevice/[Your_Device_Name]/DiagnosticLogs/sysdiagnose

Note: “~/Library/...” actually translates to: /Users/[Your User Name]/Library/...

The “/Users/[Your User Name]/Library/...” folder is hidden by default in macOS. To expose the folder, hold the option key while clicking the Finder’s Go menu and the Library folder will appear in the menu. Any time you see a placeholder like “[Your Device Name]” or, “[Your User Name]” you should replace that part of the path with your actual device’s name, or your computer user name.

Windows 10:

Windows 8, 7, Vista:

Note: The AppData folder in Windows 8 is hidden by default. Click on the View menu item in a Windows navigation window and check the "Hidden items" checkbox and the AppData folder will appear in the list of folders under C:\Users\[Device_Name]. Important: Replace "[Your_Device_Name]" or "[Your_User_Name]" in the file paths above with the actual device name for the iOS device, or the actual user name you use on your computer.

C:\Users\USERID\AppData\Local\Packages\AppleInc.iTunes_devicename\LocalCache\Roaming\Apple

Computer\Logs\CrashReporter\MobileDevice

C:\Users\[Your_User_Name]\AppData\Roaming\Apple Computer\Logs\CrashReporter\MobileDevice\

[Your_Device_Name]\DiagnosticLogs\sysdiagnose


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

Im having the same issue here.

I have a very similar issue here. The very first purchase was success and I received the INITIAL_BUY status update notification also at the server side. After then looks like there is a problem with the renewal, not renew my 1 month auto-renewal subscription in every 5 minutes. After 15 minutes I received a DID_CHANGE_RENEWAL_STATUS notification with a latest_expired_receipt. When I verify this receipt the status is 21006 and the expiration_intent is 5. In normal case the expiration_intent was 1. (“1” - Customer canceled their subscription.“5” - Unknown error.). Then the product purchase is not available from my App I receive the "Cannot connect to iTunes Store" error message constantly. Yesterday everything worked fine...


Environment: Sandbox

Im having the same issue until a few minutes ago.

But It seems there is no problem now... (So I couldn't correct sysdiagnose...

For me now it’s ok....!!!!! (Italy) and for you?

Works here as well again (Denmark)

It seems to me it works well again!

Works now here too. (Alberta, Canada)