dfischer / meteor-prerenderio

A meteor wrapper for https://prerender.io/
57 stars 9 forks source link

Package started causing crashes (appears associated with timeouts) #9

Closed joegoldbeck closed 8 years ago

joegoldbeck commented 9 years ago

At about 11 am EST today, I started getting repeated app crashes from an error thrown inside the package. I'm not sure if one of the dependencies changed or if the requests coming in changed. It appears related to request timeouts though. Perhaps the prerender service wasn't responding quickly enough?

Jun 30 08:33:36 heroku/router:  at=error code=H12 desc="Request timeout" method=GET path="/read/shailin/youve-got-to-take-the-ad-with-the-good-e7hPCd8M?_escaped_fragment_=" host=readfold.com request_id=e52e11ad-5cae-43b9-8169-9e941eab64a5 fwd="66.249.67.52" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0 
Jun 30 08:33:56 heroku/router:  at=info method=GET path="/read/jovialjoy/discovering-fold-L9ZQMhqT" host=readfold.com request_id=fb9fd71c-6b18-4503-ac45-63a618965694 fwd="97.107.138.192" dyno=web.1 connect=2ms service=8ms status=200 bytes=3215 
Jun 30 08:34:06 app/web.1:  TypeError: Object #<ServerResponse> has no method 'type' 
Jun 30 08:34:06 app/web.1:  res.send(status, body): Use res.status(status).send(body) instead 
Jun 30 08:34:06 app/web.1:      at ServerResponse.send (packages/dfischer:prerenderio/dfischer:prerenderio.js:93:1) 
Jun 30 08:34:06 app/web.1:      at /app/build/bundle/programs/server/npm/dfischer_prerenderio/node_modules/prerender-node/index.js:20:20 
Jun 30 08:34:06 app/web.1:      at IncomingMessage.<anonymous> (/app/build/bundle/programs/server/npm/dfischer_prerenderio/node_modules/prerender-node/index.js:191:5) 
Jun 30 08:34:06 app/web.1:      at IncomingMessage.emit (events.js:117:20) 
Jun 30 08:34:06 app/web.1:      at _stream_readable.js:944:16 
Jun 30 08:34:06 app/web.1:      at process._tickCallback (node.js:442:13)
joegoldbeck commented 9 years ago

(btw edited the above as it looks to be related to request timeouts. the timing is perfect.)

kylestew commented 9 years ago

I'm seeing the same thing with my app hosted on modulus.io

dfischer commented 8 years ago

Still getting this?

flean commented 8 years ago

Just had the same issue on Modulus.io

multilinear commented 8 years ago

We ran in to a similar issue as well. After some investigation our problem looks like it's this line "https://github.com/dfischer/meteor-prerenderio/blob/master/dfischer:prerenderio.js#L97"

The problem is "type" isn't defined on "res". res.type() is only called in a few edge-cases though, so this doesn't instantly trip for everyone. Note that the "res" object derives from a request.send call.

In general it seems to basically be using calls that don't actually exist.

glasser commented 8 years ago

Perhaps the "type" calls should just be .set with an explicit Content-Type?

ekatek commented 8 years ago

Filed https://github.com/dfischer/meteor-prerenderio/pull/19 to address this.

dfischer commented 8 years ago

Will review this tomorrow, thank you @ekatek