{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1855","repository_url":"https://api.github.com/repos/ParsePlatform/parse-server","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1855/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1855/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1855/events","html_url":"https://github.com/ParsePlatform/parse-server/issues/1855","id":156050869,"number":1855,"title":"All Requests Receive Timeout Error","user":{"login":"jgaull","id":178124,"avatar_url":"https://avatars.githubusercontent.com/u/178124?v=3","gravatar_id":"","url":"https://api.github.com/users/jgaull","html_url":"https://github.com/jgaull","followers_url":"https://api.github.com/users/jgaull/followers","following_url":"https://api.github.com/users/jgaull/following{/other_user}","gists_url":"https://api.github.com/users/jgaull/gists{/gist_id}","starred_url":"https://api.github.com/users/jgaull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgaull/subscriptions","organizations_url":"https://api.github.com/users/jgaull/orgs","repos_url":"https://api.github.com/users/jgaull/repos","events_url":"https://api.github.com/users/jgaull/events{/privacy}","received_events_url":"https://api.github.com/users/jgaull/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":44,"created_at":"2016-05-20T21:05:49Z","updated_at":"2016-05-23T11:58:39Z","closed_at":null,"body":"#### Environment Setup\r\n\r\n- Server: parse-server 2.2.10 (also tested on 2.2.9) , node 5.11.1, heroku\r\n- Database: mLab mongoDB 3.0.9\r\n\r\n#### Steps to reproduce\r\nI'm sorry this sucks, but we have not been able to narrow down the steps any more than this:\r\n\r\n1. Upload build to server\r\n2. Wait 5-15 minutes\r\n\r\nResult: All requests begin timing out.\r\n\r\n#### Code\r\n\r\nPlease note, this code does not appear to cause the problem as timeouts have begun without this ever running. However, I've been using this function when troubleshooting.\r\n```\r\n\tconsole.log('running create!');\r\n\t//configure parameters\r\n\tvar user = request.user;\r\n\r\n\tvar title = request.params.title; //required\r\n\tvar imageData = request.params.imageData; //required\r\n\tvar videoData = request.params.videoData; //optional\r\n\tvar content = request.params.content; //optional\r\n\tvar attachment = request.params.attachment; //optional always URL\r\n\r\n\t//create a new story\r\n\tvar newStory = new Story();\r\n\t//set the default parameters\r\n\tnewStory.set(\"user\", user);\r\n\tnewStory.set(\"inspireCount\", 0);\r\n\tnewStory.set(\"commentCount\", 0);\r\n\tnewStory.set(\"viewCount\", 0);\r\n\tnewStory.set(\"notificationsOptOut\", []);\r\n\tnewStory.set(\"archived\", false);\r\n\tnewStory.set(\"toAllUsers\", true);\r\n\t//add params that have been passed in\r\n\tnewStory.set(\"title\", title);\r\n\tnewStory.set(\"content\", content);\r\n\tnewStory.set(\"attachment\", attachment);\r\n\t//get the user's name and set it to the story\r\n\tvar creatorName = user.get(\"name\");\r\n\tnewStory.set(\"creatorName\", creatorName);\r\n\r\n\t//set the ACL\r\n\tnewStory.setACL(createACLForStory(newStory));\r\n\r\n\t//this will be used to store promises when saving files\r\n\tvar mediaFileSavePromises = [];\r\n\t//create image\r\n\tvar image = new Parse.File(\"Image.jpg\", imageData, \"image/jpg\");\r\n\t//save the image and push the promise into an array of promises\r\n\tmediaFileSavePromises.push(image.save());\r\n\tnewStory.set(\"imageFile\", image);\r\n\r\n\t//if there is a video\r\n\tif (videoData) {\r\n\t\t//create a file\r\n\t\tvar video = new Parse.File(\"Video.mp4\", videoData, \"video/mp4\");\r\n\t\t//save the file and push the promise onto the array\r\n\t\tmediaFileSavePromises.push(video.save());\r\n\t\tnewStory.set(\"videoFile\", video);\r\n\t}\r\n\r\n\tParse.Promise.when(mediaFileSavePromises).then(function (mediaFiles) {\r\n\t\t//save the story\r\n\t\tconsole.log(\"media saved\");\r\n\t\treturn newStory.save();\r\n\r\n\t})\r\n//more stuff. But never runs after timeouts start\r\n```\r\n#### Logs/Trace\r\nOnce timeouts begin I'm seeing this with VERBOSE enabled:\r\n```\r\n2016-05-20T20:18:26.942301+00:00 app[web.1]: verbose: GET /parse/classes/ClinkComment { host: '****.herokuapp.com',\r\n2016-05-20T20:18:26.942311+00:00 app[web.1]:   connection: 'close',\r\n2016-05-20T20:18:26.942313+00:00 app[web.1]:   'user-agent': 'node-XMLHttpRequest, Parse/js1.8.5 (NodeJS 5.11.1)',\r\n2016-05-20T20:18:26.942313+00:00 app[web.1]:   accept: '*/*',\r\n2016-05-20T20:18:26.942314+00:00 app[web.1]:   'content-type': 'text/plain',\r\n2016-05-20T20:18:26.942317+00:00 app[web.1]:   'x-request-id': '9a7593e2-87c6-4e48-bc56-d1f9d05a0177',\r\n2016-05-20T20:18:26.942318+00:00 app[web.1]:   'x-forwarded-for': '54.242.116.62',\r\n2016-05-20T20:18:26.942319+00:00 app[web.1]:   'x-forwarded-proto': 'https',\r\n2016-05-20T20:18:26.942319+00:00 app[web.1]:   'x-forwarded-port': '443',\r\n2016-05-20T20:18:26.942320+00:00 app[web.1]:   via: '1.1 vegur',\r\n2016-05-20T20:18:26.942320+00:00 app[web.1]:   'connect-time': '2',\r\n2016-05-20T20:18:26.942321+00:00 app[web.1]:   'x-request-start': '1463775506929',\r\n2016-05-20T20:18:26.942322+00:00 app[web.1]:   'total-route-time': '0',\r\n2016-05-20T20:18:26.942322+00:00 app[web.1]:   'content-length': '349' } {\r\n2016-05-20T20:18:26.942323+00:00 app[web.1]:   \"where\": {\r\n2016-05-20T20:18:26.942324+00:00 app[web.1]:     \"clink\": {\r\n2016-05-20T20:18:26.942324+00:00 app[web.1]:       \"__type\": \"Pointer\",\r\n2016-05-20T20:18:26.942325+00:00 app[web.1]:       \"className\": \"Clink\",\r\n2016-05-20T20:18:26.942325+00:00 app[web.1]:       \"objectId\": \"B1vNrvL9sC\"\r\n2016-05-20T20:18:26.942326+00:00 app[web.1]:     }\r\n2016-05-20T20:18:26.942327+00:00 app[web.1]:   },\r\n2016-05-20T20:18:26.942327+00:00 app[web.1]:   \"include\": \"user\",\r\n2016-05-20T20:18:26.942328+00:00 app[web.1]:   \"limit\": 25,\r\n2016-05-20T20:18:26.942328+00:00 app[web.1]:   \"order\": \"-createdAt\"\r\n2016-05-20T20:18:26.942329+00:00 app[web.1]: }\r\n2016-05-20T20:18:26.696219+00:00 heroku[router]: at=error code=H12 desc=\"Request timeout\" method=POST path=\"/parse/classes/ClinkComment\" host=***.herokuapp.com request_id=dcac6a25-54f5-42b0-b15e-dd43556a7a4a fwd=\"54.242.116.62\" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0\r\n2016-05-20T20:18:31.243011+00:00 heroku[router]: at=error code=H12 desc=\"Request timeout\" method=POST path=\"/parse/functions/fetchStories\" host=***.herokuapp.com request_id=3d6c2b02-57f4-430c-b836-54563d5ace3f fwd=\"108.212.64.230\" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0\r\n2016-05-20T20:18:31.260092+00:00 heroku[router]: at=error code=H12 desc=\"Request timeout\" method=POST path=\"/parse/classes/Clink\" host=***.herokuapp.com request_id=0fbf25bd-2def-43a3-81c3-c0e875950825 fwd=\"54.242.116.62\" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0\r\n```\r\nIf I wait around long enough I see this error:\r\n```\r\n2016-05-20T19:19:53.738611+00:00 app[web.1]: error! Received an error with invalid JSON from Parse: <!DOCTYPE html>\r\n2016-05-20T19:19:53.738637+00:00 app[web.1]:     <html>\r\n2016-05-20T19:19:53.738638+00:00 app[web.1]:     <head>\r\n2016-05-20T19:19:53.738639+00:00 app[web.1]:       <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n2016-05-20T19:19:53.738640+00:00 app[web.1]:       <style type=\"text/css\">\r\n2016-05-20T19:19:53.738641+00:00 app[web.1]:         html, body, iframe { margin: 0; padding: 0; height: 100%; }\r\n2016-05-20T19:19:53.738643+00:00 app[web.1]:         iframe { display: block; width: 100%; border: none; }\r\n2016-05-20T19:19:53.738643+00:00 app[web.1]:       </style>\r\n2016-05-20T19:19:53.738645+00:00 app[web.1]:     <title>Application Error</title>\r\n2016-05-20T19:19:53.738645+00:00 app[web.1]:     </head>\r\n2016-05-20T19:19:53.738646+00:00 app[web.1]:     <body>\r\n2016-05-20T19:19:53.738647+00:00 app[web.1]:       <iframe src=\"//s3.amazonaws.com/heroku_pages/error.html\">\r\n2016-05-20T19:19:53.738647+00:00 app[web.1]:         <p>Application Error</p>\r\n2016-05-20T19:19:53.738648+00:00 app[web.1]:       </iframe>\r\n2016-05-20T19:19:53.738648+00:00 app[web.1]:     </body>\r\n2016-05-20T19:19:53.738649+00:00 app[web.1]:     </html>\r\n```\r\n#### Tested These Things\r\n- Spun up a new server instance. Still saw issue.\r\n- Waited until issue started and visited https://my-app.herokuapp.com/ and saw \"I dream of being a website\"\r\n- Added console.log statements in cloud code (above). Cloud functions get called even when requests are timing out. PFFiles are successfully saved. Nothing happens after newStory.save().\r\n- Enabled \"log-runtime-metrics\". Memory usage was stable.\r\n- Restarted server. This solves the issue temporarily.\r\n- Rolled back to a previous deploy. This solved the issue. Diffed code between releases and saw only trivial changes. A few console.logs.\r\n\r\nI'm very much at a loss for how to continue troubleshooting this problem. Thanks so much for your help!\r\n"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/comments/220960565","html_url":"https://github.com/ParsePlatform/parse-server/issues/1855#issuecomment-220960565","issue_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/1855","id":220960565,"user":{"login":"edvincandon","id":11134131,"avatar_url":"https://avatars.githubusercontent.com/u/11134131?v=3","gravatar_id":"","url":"https://api.github.com/users/edvincandon","html_url":"https://github.com/edvincandon","followers_url":"https://api.github.com/users/edvincandon/followers","following_url":"https://api.github.com/users/edvincandon/following{/other_user}","gists_url":"https://api.github.com/users/edvincandon/gists{/gist_id}","starred_url":"https://api.github.com/users/edvincandon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edvincandon/subscriptions","organizations_url":"https://api.github.com/users/edvincandon/orgs","repos_url":"https://api.github.com/users/edvincandon/repos","events_url":"https://api.github.com/users/edvincandon/events{/privacy}","received_events_url":"https://api.github.com/users/edvincandon/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T11:58:39Z","updated_at":"2016-05-23T11:58:39Z","body":"Same here, no timeout error reported! Thanks for the fix @davodesign84 !"}}
{"actor":{"display_login":"edvincandon"}}