dschmidt / ember-cli-deploy-sentry

An ember-cli-deploy-plugin to upload javascript sourcemaps to Sentry
MIT License
42 stars 51 forks source link

Error: socket hang up #13

Closed orf closed 8 years ago

orf commented 8 years ago

Hey, Since updating ember-cli-deploy to the latest version uploading the sourcemaps doesn't seem to work. I've not changed any configuration on sentry, but I get this error while uploading sourcemaps:

RequestError: Error: socket hang up
RequestError: Error: socket hang up
    at new RequestError (/home/tom/PycharmProjects/doge/frontend/node_modules/request-promise/lib/errors.js:11:15)
    at Request.RP$callback [as _callback] (/home/tom/PycharmProjects/doge/frontend/node_modules/request-promise/lib/rp.js:56:32)
    at self.callback (/home/tom/PycharmProjects/doge/frontend/node_modules/request/request.js:199:22)
    at emitOne (events.js:95:20)
    at Request.emit (events.js:182:7)
    at Request.onRequestError (/home/tom/PycharmProjects/doge/frontend/node_modules/request/request.js:821:8)
    at emitOne (events.js:90:13)
    at ClientRequest.emit (events.js:182:7)
    at TLSSocket.socketOnEnd (_http_client.js:331:9)
    at emitNone (events.js:85:20)
    at TLSSocket.emit (events.js:179:7)
    at endReadableNT (_stream_readable.js:913:12)
    at _combinedTickCallback (node.js:377:13)
    at process._tickCallback (node.js:401:11)Pipeline aborted

It seems to create the release, but fails when uploading the sourcemaps. I've got no idea how to debug this - perhaps the error message could be improved?

dschmidt commented 8 years ago

I have no clue how this would be related to an ember-cli-deploy upgrade :-\

orf commented 8 years ago

Hmm, I'm not sure either, perhaps it's not. It's strange though, if I give it an invalid API key it fails with a proper error, so it must be something it's uploading that is causing it to fail. Is there any way to view the files it's uploading?

orf commented 8 years ago

I finally tracked this down, the issue was this library doesn't rate limit the uploads at all. If a project has ~60 JS files it ends up hammering the server with 120 requests (sourcemaps and JS files) at once, and our poor self-hosted sentry server couldn't handle that much load in such a small time. Hence the socket disconnections.

I've made MR #14 to handle this, using a library called throat, that limits the number of concurrent uploads to 5 at a time. This is conservative and could maybe be added as a configuration option, but it works well.