Closed
Description
Environment Setup
- Server: parse-server 2.2.10 (also tested on 2.2.9) , node 5.11.1, heroku
- Database: mLab mongoDB 3.0.9
Steps to reproduce
I'm sorry this sucks, but we have not been able to narrow down the steps any more than this:
- Upload build to server
- Wait 5-15 minutes
Result: All requests begin timing out.
Code
Please 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.
console.log('running create!');
//configure parameters
var user = request.user;
var title = request.params.title; //required
var imageData = request.params.imageData; //required
var videoData = request.params.videoData; //optional
var content = request.params.content; //optional
var attachment = request.params.attachment; //optional always URL
//create a new story
var newStory = new Story();
//set the default parameters
newStory.set("user", user);
newStory.set("inspireCount", 0);
newStory.set("commentCount", 0);
newStory.set("viewCount", 0);
newStory.set("notificationsOptOut", []);
newStory.set("archived", false);
newStory.set("toAllUsers", true);
//add params that have been passed in
newStory.set("title", title);
newStory.set("content", content);
newStory.set("attachment", attachment);
//get the user's name and set it to the story
var creatorName = user.get("name");
newStory.set("creatorName", creatorName);
//set the ACL
newStory.setACL(createACLForStory(newStory));
//this will be used to store promises when saving files
var mediaFileSavePromises = [];
//create image
var image = new Parse.File("Image.jpg", imageData, "image/jpg");
//save the image and push the promise into an array of promises
mediaFileSavePromises.push(image.save());
newStory.set("imageFile", image);
//if there is a video
if (videoData) {
//create a file
var video = new Parse.File("Video.mp4", videoData, "video/mp4");
//save the file and push the promise onto the array
mediaFileSavePromises.push(video.save());
newStory.set("videoFile", video);
}
Parse.Promise.when(mediaFileSavePromises).then(function (mediaFiles) {
//save the story
console.log("media saved");
return newStory.save();
})
//more stuff. But never runs after timeouts start
Logs/Trace
Once timeouts begin I'm seeing this with VERBOSE enabled:
2016-05-20T20:18:26.942301+00:00 app[web.1]: verbose: GET /parse/classes/ClinkComment { host: '****.herokuapp.com',
2016-05-20T20:18:26.942311+00:00 app[web.1]: connection: 'close',
2016-05-20T20:18:26.942313+00:00 app[web.1]: 'user-agent': 'node-XMLHttpRequest, Parse/js1.8.5 (NodeJS 5.11.1)',
2016-05-20T20:18:26.942313+00:00 app[web.1]: accept: '*/*',
2016-05-20T20:18:26.942314+00:00 app[web.1]: 'content-type': 'text/plain',
2016-05-20T20:18:26.942317+00:00 app[web.1]: 'x-request-id': '9a7593e2-87c6-4e48-bc56-d1f9d05a0177',
2016-05-20T20:18:26.942318+00:00 app[web.1]: 'x-forwarded-for': '54.242.116.62',
2016-05-20T20:18:26.942319+00:00 app[web.1]: 'x-forwarded-proto': 'https',
2016-05-20T20:18:26.942319+00:00 app[web.1]: 'x-forwarded-port': '443',
2016-05-20T20:18:26.942320+00:00 app[web.1]: via: '1.1 vegur',
2016-05-20T20:18:26.942320+00:00 app[web.1]: 'connect-time': '2',
2016-05-20T20:18:26.942321+00:00 app[web.1]: 'x-request-start': '1463775506929',
2016-05-20T20:18:26.942322+00:00 app[web.1]: 'total-route-time': '0',
2016-05-20T20:18:26.942322+00:00 app[web.1]: 'content-length': '349' } {
2016-05-20T20:18:26.942323+00:00 app[web.1]: "where": {
2016-05-20T20:18:26.942324+00:00 app[web.1]: "clink": {
2016-05-20T20:18:26.942324+00:00 app[web.1]: "__type": "Pointer",
2016-05-20T20:18:26.942325+00:00 app[web.1]: "className": "Clink",
2016-05-20T20:18:26.942325+00:00 app[web.1]: "objectId": "B1vNrvL9sC"
2016-05-20T20:18:26.942326+00:00 app[web.1]: }
2016-05-20T20:18:26.942327+00:00 app[web.1]: },
2016-05-20T20:18:26.942327+00:00 app[web.1]: "include": "user",
2016-05-20T20:18:26.942328+00:00 app[web.1]: "limit": 25,
2016-05-20T20:18:26.942328+00:00 app[web.1]: "order": "-createdAt"
2016-05-20T20:18:26.942329+00:00 app[web.1]: }
2016-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
2016-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
2016-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
If I wait around long enough I see this error:
2016-05-20T19:19:53.738611+00:00 app[web.1]: error! Received an error with invalid JSON from Parse: <!DOCTYPE html>
2016-05-20T19:19:53.738637+00:00 app[web.1]: <html>
2016-05-20T19:19:53.738638+00:00 app[web.1]: <head>
2016-05-20T19:19:53.738639+00:00 app[web.1]: <meta name="viewport" content="width=device-width, initial-scale=1">
2016-05-20T19:19:53.738640+00:00 app[web.1]: <style type="text/css">
2016-05-20T19:19:53.738641+00:00 app[web.1]: html, body, iframe { margin: 0; padding: 0; height: 100%; }
2016-05-20T19:19:53.738643+00:00 app[web.1]: iframe { display: block; width: 100%; border: none; }
2016-05-20T19:19:53.738643+00:00 app[web.1]: </style>
2016-05-20T19:19:53.738645+00:00 app[web.1]: <title>Application Error</title>
2016-05-20T19:19:53.738645+00:00 app[web.1]: </head>
2016-05-20T19:19:53.738646+00:00 app[web.1]: <body>
2016-05-20T19:19:53.738647+00:00 app[web.1]: <iframe src="//s3.amazonaws.com/heroku_pages/error.html">
2016-05-20T19:19:53.738647+00:00 app[web.1]: <p>Application Error</p>
2016-05-20T19:19:53.738648+00:00 app[web.1]: </iframe>
2016-05-20T19:19:53.738648+00:00 app[web.1]: </body>
2016-05-20T19:19:53.738649+00:00 app[web.1]: </html>
Tested These Things
- Spun up a new server instance. Still saw issue.
- Waited until issue started and visited https://my-app.herokuapp.com/ and saw "I dream of being a website"
- 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().
- Enabled "log-runtime-metrics". Memory usage was stable.
- Restarted server. This solves the issue temporarily.
- Rolled back to a previous deploy. This solved the issue. Diffed code between releases and saw only trivial changes. A few console.logs.
I'm very much at a loss for how to continue troubleshooting this problem. Thanks so much for your help!
Metadata
Metadata
Assignees
Labels
No labels