Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-App Purchases validation fails with "Request timeout" #2225

Closed
4 tasks done
ValeryVa opened this issue Jul 7, 2016 · 19 comments
Closed
4 tasks done

In-App Purchases validation fails with "Request timeout" #2225

ValeryVa opened this issue Jul 7, 2016 · 19 comments
Labels
type:question Support or code-level question

Comments

@ValeryVa
Copy link
Contributor

ValeryVa commented Jul 7, 2016

Issue Description

Sending the request to 'validate_purchase' from iOS device (Parse iOS SDK v1.13.0) every time fails with 'Request timeout' in server logs and HTML web-page in responseString (please see below)

Steps to reproduce

  1. Make purchase on iOS device to obtain valid receipt
  2. Send request to 'validate_purchase' with correct productIdentifier & receipt

Expected Results

PFProduct 'download' file starts downloading

Actual Outcome

Request fails with "Request timeout" in server logs and HTML web-page in responseString in -[PFURLSessionJSONDataTaskDelegate _taskDidFinish]

Environment Setup

  • Server
    • parse-server version: 2.2.15
    • Localhost or remote server: Heroku
  • Database
    • Localhost or remote server: mLab

Logs/Trace

Logs in heroku console:

at=error code=H12 desc="Request timeout" method=POST path="/parse/validate_purchase" host=mytestapp.herokuapp.com request_id=3d2ed6f9-d18b-4b8d-a8a2-addb60afe45c fwd="93.84.7.35" dyno=web.1 connect=0ms service=30257ms status=503 bytes=0

self.responseString value in [PFURLSessionJSONDataTaskDelegate _taskDidFinish]:

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type="text/css"> html, body, iframe { margin: 0; padding: 0; height: 100%; } iframe { display: block; width: 100%; border: none; } </style> <title>Application Error</title> </head> <body> <iframe src="//s3.amazonaws.com/heroku_pages/error.html"> <p>Application Error</p> </iframe> </body> </html>

@flovilmart
Copy link
Contributor

Can you run the server with VERBOSE=1 and post the logs related to the call?
That will help debugging

@ValeryVa
Copy link
Contributor Author

ValeryVa commented Jul 8, 2016

Yep, but I'm not sure that I'm in the position to send real productIdentifier and related info like appId in public. May I change it for now to some random value (I'm pretty sure that AppStore validation should return error in the case of random value and validate_purchase request should not be failed with timeout)?

2016-07-08T22:14:58.251623+00:00 app[web.1]: verbose: POST /parse/validate_purchase { host: 'mytestapp.herokuapp.com',
2016-07-08T22:14:58.251635+00:00 app[web.1]:   'x-parse-session-token': 'r:<current_sessionToken>',
2016-07-08T22:14:58.251637+00:00 app[web.1]:   'x-parse-os-version': '9.3.2 (13F69)',
2016-07-08T22:14:58.251637+00:00 app[web.1]:   'x-parse-installation-id': '<installId>',
2016-07-08T22:14:58.251636+00:00 app[web.1]:   'x-parse-application-id': '<my_appId>',
2016-07-08T22:14:58.251638+00:00 app[web.1]:   'accept-language': 'en-gb',
2016-07-08T22:14:58.251633+00:00 app[web.1]:   connection: 'close',
2016-07-08T22:14:58.251634+00:00 app[web.1]:   accept: '*/*',
2016-07-08T22:14:58.251640+00:00 app[web.1]:   'user-agent': 'RW/27 CFNetwork/758.4.3 Darwin/15.5.0',
2016-07-08T22:14:58.251638+00:00 app[web.1]:   'accept-encoding': 'gzip, deflate',
2016-07-08T22:14:58.251639+00:00 app[web.1]:   'content-type': 'application/json; charset=utf-8',
2016-07-08T22:14:58.251642+00:00 app[web.1]:   'x-forwarded-for': '37.17.7.38',
2016-07-08T22:14:58.251641+00:00 app[web.1]:   'x-parse-app-build-version': '27',
2016-07-08T22:14:58.251644+00:00 app[web.1]:   via: '1.1 vegur',
2016-07-08T22:14:58.251644+00:00 app[web.1]:   'x-forwarded-port': '443',
2016-07-08T22:14:58.251645+00:00 app[web.1]:   'connect-time': '1',
2016-07-08T22:14:58.251649+00:00 app[web.1]:     "__type": "Bytes",
2016-07-08T22:14:58.251685+00:00 app[web.1]:   },
2016-07-08T22:14:58.251647+00:00 app[web.1]:   'content-length': '8901' } {
2016-07-08T22:14:58.251641+00:00 app[web.1]:   'x-parse-app-display-version': '1.9',
2016-07-08T22:14:58.251642+00:00 app[web.1]:   'x-request-id': '0efa748e-c3e7-4dd9-8d5e-dc9a020f1a30',
2016-07-08T22:14:58.251643+00:00 app[web.1]:   'x-forwarded-proto': 'https',
2016-07-08T22:14:58.251646+00:00 app[web.1]:   'x-request-start': '1468016097967',
2016-07-08T22:14:58.251683+00:00 app[web.1]:     "base64": "MIIZnQYJKoZIhvcNAQcCoIIZjjCCGYoCAQExCzAJBgUrDgMCGgUAMIIJPgYJKoZIhvcNAQcBoIIJLwSCCSsxggknMAoCAQgCAQEEAhYAMAoCARQCAQEEAgwAMAsCAQECAQEEAwIBADALAgELAgEBBAMCAQAwCwIBDgIBAQQDAgFqMAsCAQ8CAQEEAwIBADALAgEQAgEBBAMCAQAwCwIBGQIBAQQDAgEDMAwCAQMCAQEEBAwCMjcwDAIBCgIBAQQEFgI0KzANAgENAgEBBAUCAwFgvjANAgETAgEBBAUMAzEuMDAOAgEJAgEBBAYCBFAyNDcwGAIBBAIBAgQQRRtstVMgFt31G1WFRGKK1jAaAgECAgEBBBIMEGNvbS5sb25nc3dvcmQucncwGwIBAAIBAQQTDBFQcm9kdWN0aW9uU2FuZGJveDAcAgEFAgEBBBQh/3zSenrMSUykcFBUlZ6AGJUdaDAeAgEMAgEBBBYWFDIwMTYtMDctMDhUMjI6MTQ6NTdaMB4CARICAQEEFhYUMjAxMy0wOC0wMVQwNzowMDowMFowRwIBBwIBAQQ/tcyJt6np1/3xadd8AWMv2RZhFY//z249ZPrCRtDm7AAO4XkQV6tSmi78Ktjt7NZTe4l4qO6TdCBk4woszHjQMFECAQYCAQEESVnnTaatq95VxCn1Y8CKPA5ybELDsffTOHhe6Al42t3xnrh2pKL/BHh8HZXUKkvcz56xlC9wlqekRB3K/Vtgvy3o2XaGeT1W4H0wggFmAgERAgEBBIIBXDGCAVgwCwICBqwCAQEEAhYAMAsCAgatAgEBBAIMADALAgIGsAIBAQQCFgAwCwICBrICAQEEAgwAMAsCAgazAgEBBAIMADALAgIGtAIBAQQCDAAwCwICBrUCAQEEAgwAMAsCAga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CAQCOT+HDkulxMBQQ9p3OVWvbkXFcOhlMP3FyZz5O0NtVXuDHwX5n+lsnuFa8VVkRl31T8MkINqmEVPK7bLlwONdFsioxCYP9hTm/3KUtNfbj/wTnQbL6sozP2SzkpQES8pdXmU4hLx1pqoie8paOn3HN61ZkFzfrQv8pThuae1cgBpW0neqq75QVOIY/BrH7rzoJNcclec0NHurZs3yIdidIjuMuIp2i1LScxooPdBrIS9yzUyHuReJ0RZrEIJlwzvMmndirH/X46LqntX24dH6wWqcHRxAP6QAPQyVeRLRI1ldi2P5q4Ga1nUMK9k3y0cc5LX7/vhimW6nVM2Jfnv0Z"
2016-07-08T22:14:58.251646+00:00 app[web.1]:   'total-route-time': '0',
2016-07-08T22:14:58.251648+00:00 app[web.1]:   "receipt": {
2016-07-08T22:14:58.251686+00:00 app[web.1]:   "productIdentifier": "com.myproductidentifier"
2016-07-08T22:14:58.251687+00:00 app[web.1]: }
2016-07-08T22:15:28.175789+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/parse/validate_purchase" host=mytestapp.herokuapp.com request_id=0efa748e-c3e7-4dd9-8d5e-dc9a020f1a30 fwd="37.17.7.38" dyno=web.1 connect=1ms service=30206ms status=503 bytes=0

@ValeryVa
Copy link
Contributor Author

ValeryVa commented Jul 11, 2016

I assume the problem is somewhere inside getFileForProductIdentifier because:

  1. If you enable NODE_ENV=test, the request will also fail with the same timeout error.
  2. If you send invalid productIdentifier/receipt Apple servers will respond very fast with the following error:
    {"status":21002,"error":"The data in the receipt-data property was malformed or missing."}

This timeout failure doesn't depend on Heroku platform because on local parse-server with curl this issue is also reproduced.

P.S. My fileKey & S3Adapter are configured correctly because I have an access to all files from hosted Parse & upload new files to S3 cloud.

@ValeryVa
Copy link
Contributor Author

I made some debugging and my results are:

  1. The issue is related to validating SANDBOX receipt, and receipt is missing when passing to validateWithAppStore(IAP_SANDBOX_URL). Correct call will be validateWithAppStore(IAP_SANDBOX_URL, receipt);
  2. Any of 2 Promise callbacks (in case of success and in case of error) is not called after sending receipt to SANDBOX url.

@flovilmart
Copy link
Contributor

@valeryvoskobovich thanks for the debugging, do you think you could work out a pull request?

@ValeryVa
Copy link
Contributor Author

@flovilmart I'll try but I'm not a NodeJS developer :)

@flovilmart
Copy link
Contributor

@valeryvoskobovich I'm wasn't a node.js developer either :) I'm sure you'll work something out

@flovilmart
Copy link
Contributor

I believe you mean here: https://github.com/ParsePlatform/parse-server/blob/master/src/Routers/IAPValidationRouter.js#L41 we don't put the receipt back

@ValeryVa
Copy link
Contributor Author

ValeryVa commented Jul 11, 2016

@flovilmart
Copy link
Contributor

even if you set the receipt option?

@ValeryVa
Copy link
Contributor Author

Yep. I had to implement inner promise callbacks to Sandbox request to start getting file

@flovilmart
Copy link
Contributor

alright :)

@ValeryVa
Copy link
Contributor Author

ValeryVa commented Jul 11, 2016

Now I have something like this which is working (as it seems to me):

`

function successCallback() {
    return getFileForProductIdentifier(productIdentifier, req);
};

function errorCallback(error) {
    return Promise.resolve({response: appStoreError(error.status) });
}

return validateWithAppStore(IAP_PRODUCTION_URL, receipt).then( () => {
  return successCallback();
}, (error) => {

  if (error.status == 21007) {
    return validateWithAppStore(IAP_SANDBOX_URL, receipt).then( () => {
        return successCallback();
      }, (error) => {
        return errorCallback(error);
      }
    );
  } 

  return errorCallback(error);
});`

@ValeryVa
Copy link
Contributor Author

Here is my changes
ValeryVa@a91d913

@flovilmart
Copy link
Contributor

Alright, open a PR and we'll move the conversation over there for implementation details

@ValeryVa
Copy link
Contributor Author

@flovilmart my PR is ready, waiting for your comments

@flovilmart
Copy link
Contributor

On it :)

@flovilmart
Copy link
Contributor

Fixed by #2253

@ValeryVa
Copy link
Contributor Author

@flovilmart Could you make a new parse-server release with my fix?

@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants