bundlesize icon indicating copy to clipboard operation
bundlesize copied to clipboard

GET /values resulting in status code 500

Open tjefferson08 opened this issue 5 years ago • 22 comments

Do you want to request a feature or report a bug?

Bug 🐛

What is the current behavior?

When our Travis CI build runs yarn bundlesize, the size check against master fails and we get some http logs indicating a 500 error.

If the current behavior is a bug, please provide the steps to reproduce. Here's the relevant section of the Travis CI build logs:

$ /home/travis/build/sharethrough/groundcontrol/node_modules/.bin/bundlesize
{ Error: Request failed with status code 500
    at createError (/home/travis/build/sharethrough/groundcontrol/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/travis/build/sharethrough/groundcontrol/node_modules/axios/lib/core/settle.js:18:12)
    at IncomingMessage.handleStreamEnd (/home/travis/build/sharethrough/groundcontrol/node_modules/axios/lib/adapters/http.js:202:11)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  config:
   { adapter: [Function: httpAdapter],
     transformRequest: { '0': [Function: transformRequest] },
     transformResponse: { '0': [Function: transformResponse] },
     timeout: 0,
     xsrfCookieName: 'XSRF-TOKEN',
     xsrfHeaderName: 'X-XSRF-TOKEN',
     maxContentLength: -1,
     validateStatus: [Function: validateStatus],
     headers:
      { Accept: 'application/json, text/plain, */*',
        'User-Agent': 'axios/0.18.1' },
     method: 'get',
     url:
      'https://bundlesize-store.now.sh/values?repo=sharethrough/groundcontrol&token=[secure]',
     data: undefined },
  request:
   ClientRequest {
     _events:
      [Object: null prototype] {
        socket: [Function],
        abort: [Function],
        aborted: [Function],
        error: [Function],
        timeout: [Function],
        prefinish: [Function: requestOnPrefinish] },
     _eventsCount: 6,
     _maxListeners: undefined,
     output: [],
     outputEncodings: [],
     outputCallbacks: [],
     outputSize: 0,
     writable: true,
     _last: true,
     chunkedEncoding: false,
     shouldKeepAlive: false,
     useChunkedEncodingByDefault: false,
     sendDate: false,
     _removedConnection: false,
     _removedContLen: false,
     _removedTE: false,
     _contentLength: 0,
     _hasBody: true,
     _trailer: '',
     finished: true,
     _headerSent: true,
     socket:
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: 'bundlesize-store.now.sh',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 8,
        connecting: false,
        _hadError: false,
        _handle: [TLSWrap],
        _parent: null,
        _host: 'bundlesize-store.now.sh',
        _readableState: [ReadableState],
        readable: true,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: [TLSWrap],
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular],
        [Symbol(res)]: [TLSWrap],
        [Symbol(asyncId)]: 13,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: [Object] },
     connection:
      TLSSocket {
        _tlsOptions: [Object],
        _secureEstablished: true,
        _securePending: false,
        _newSessionPending: false,
        _controlReleased: true,
        _SNICallback: null,
        servername: 'bundlesize-store.now.sh',
        alpnProtocol: false,
        authorized: true,
        authorizationError: null,
        encrypted: true,
        _events: [Object],
        _eventsCount: 8,
        connecting: false,
        _hadError: false,
        _handle: [TLSWrap],
        _parent: null,
        _host: 'bundlesize-store.now.sh',
        _readableState: [ReadableState],
        readable: true,
        _maxListeners: undefined,
        _writableState: [WritableState],
        writable: false,
        allowHalfOpen: false,
        _sockname: null,
        _pendingData: null,
        _pendingEncoding: '',
        server: undefined,
        _server: null,
        ssl: [TLSWrap],
        _requestCert: true,
        _rejectUnauthorized: true,
        parser: null,
        _httpMessage: [Circular],
        [Symbol(res)]: [TLSWrap],
        [Symbol(asyncId)]: 13,
        [Symbol(lastWriteQueueSize)]: 0,
        [Symbol(timeout)]: null,
        [Symbol(kBytesRead)]: 0,
        [Symbol(kBytesWritten)]: 0,
        [Symbol(connect-options)]: [Object] },
     _header:
      'GET /values?repo=sharethrough/groundcontrol&token=[secure] HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nUser-Agent: axios/0.18.1\r\nHost: bundlesize-store.now.sh\r\nConnection: close\r\n\r\n',
     _onPendingData: [Function: noopPendingOutput],
     agent:
      Agent {
        _events: [Object],
        _eventsCount: 1,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object],
        requests: {},
        sockets: [Object],
        freeSockets: {},
        keepAliveMsecs: 1000,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: 256,
        maxCachedSessions: 100,
        _sessionCache: [Object] },
     socketPath: undefined,
     timeout: undefined,
     method: 'GET',
     path:
      '/values?repo=sharethrough/groundcontrol&token=[secure]',
     _ended: true,
     res:
      IncomingMessage {
        _readableState: [ReadableState],
        readable: false,
        _events: [Object],
        _eventsCount: 3,
        _maxListeners: undefined,
        socket: [TLSSocket],
        connection: [TLSSocket],
        httpVersionMajor: 1,
        httpVersionMinor: 1,
        httpVersion: '1.1',
        complete: true,
        headers: [Object],
        rawHeaders: [Array],
        trailers: {},
        rawTrailers: [],
        aborted: false,
        upgrade: false,
        url: '',
        method: null,
        statusCode: 500,
        statusMessage: 'Internal Server Error',
        client: [TLSSocket],
        _consuming: false,
        _dumped: false,
        req: [Circular],
        responseUrl:
         'https://bundlesize-store.now.sh/values?repo=sharethrough/groundcontrol&token=[secure]',
        redirects: [] },
     aborted: undefined,
     timeoutCb: null,
     upgradeOrConnect: false,
     parser: null,
     maxHeadersCount: null,
     _redirectable:
      Writable {
        _writableState: [WritableState],
        writable: true,
        _events: [Object],
        _eventsCount: 2,
        _maxListeners: undefined,
        _options: [Object],
        _redirectCount: 0,
        _redirects: [],
        _requestBodyLength: 0,
        _requestBodyBuffers: [],
        _onNativeResponse: [Function],
        _currentRequest: [Circular],
        _currentUrl:
         'https://bundlesize-store.now.sh/values?repo=sharethrough/groundcontrol&token=[secure]' },
     [Symbol(isCorked)]: false,
     [Symbol(outHeadersKey)]:
      [Object: null prototype] { accept: [Array], 'user-agent': [Array], host: [Array] } },
  response:
   { status: 500,
     statusText: 'Internal Server Error',
     headers:
      { 'content-type': 'text/html; charset=utf-8',
        connection: 'close',
        'x-powered-by': 'Express',
        'content-security-policy': 'default-src \'none\'',
        'content-length': '148',
        date: 'Thu, 06 Jun 2019 19:26:59 GMT',
        'x-content-type-options': 'nosniff',
        'cache-control': 'public, max-age=0, must-revalidate',
        'x-now-cache': 'MISS',
        'x-now-trace': 'cle1',
        server: 'now',
        'x-now-id': 'cle1:bom1:jr8r2-1559849218421-d7f4b31ddc96',
        'strict-transport-security': 'max-age=63072000' },
     config:
      { adapter: [Function: httpAdapter],
        transformRequest: [Object],
        transformResponse: [Object],
        timeout: 0,
        xsrfCookieName: 'XSRF-TOKEN',
        xsrfHeaderName: 'X-XSRF-TOKEN',
        maxContentLength: -1,
        validateStatus: [Function: validateStatus],
        headers: [Object],
        method: 'get',
        url:
         'https://bundlesize-store.now.sh/values?repo=sharethrough/groundcontrol&token=[secure]',
        data: undefined },
     request:
      ClientRequest {
        _events: [Object],
        _eventsCount: 6,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: false,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: 0,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [TLSSocket],
        connection: [TLSSocket],
        _header:
         'GET /values?repo=sharethrough/groundcontrol&token=[secure] HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nUser-Agent: axios/0.18.1\r\nHost: bundlesize-store.now.sh\r\nConnection: close\r\n\r\n',
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        timeout: undefined,
        method: 'GET',
        path:
         '/values?repo=sharethrough/groundcontrol&token=[secure]',
        _ended: true,
        res: [IncomingMessage],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        _redirectable: [Writable],
        [Symbol(isCorked)]: false,
        [Symbol(outHeadersKey)]: [Object] },
     data:
      '<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>Internal Server Error</pre>\n</body>\n</html>\n' } }
 PASS  ./dist/gc.js: 38.95KB < maxSize 40KB (gzip) 

 PASS  ./dist/sfp-iframe-buster.js: 8.69KB < maxSize 15KB (gzip) 

What is the expected behavior? I expect the master branch values to be retrieved successfully, resulting in a handy comparison in the status notification on the pull request.

If this is a feature request, what is motivation or use case for changing the behavior? N/A

Please mention other relevant information. I'll pull these straight from the Travis CI logs

$ node --version
v10.16.0
$ npm --version
6.9.0
$ nvm --version
0.34.0
$ yarn --version
1.3.2
  • Operating system: Ubuntu 14.04.5 LTS
  • bundlesize version: 0.17.2
  • CI you are using: Travis CI

tjefferson08 avatar Jun 06 '19 21:06 tjefferson08

same error on circleci, very often in last time :(((

Rabinzon avatar Jun 19 '19 09:06 Rabinzon

Ugh, this is pretty horrible. Migrating to a different storage (shelf) is on my roadmap, haven't been able to get to it yet.

siddharthkp avatar Jun 19 '19 13:06 siddharthkp

@siddharthkp what's going on with the storage backend?

Does 500 mean... we're overwhelming the firebase app? Or is it a serialization/deserialization issue?

Could we try wiping the data for our repo and start from scratch?

tjefferson08 avatar Jun 19 '19 16:06 tjefferson08

we're overwhelming the firebase app? Or is it a serialization/deserialization issue?

500 = It's unhandled. Could be either, honestly.

Could we try wiping the data for our repo and start from scratch?

I don't think that will help. I will find some time to dig into this, soon-ish.

siddharthkp avatar Jun 20 '19 04:06 siddharthkp

Hi! Any news on this? Is there a way to fix the problem or a workaround?

bolismauro avatar Jul 04 '19 19:07 bolismauro

@bolismauro Are you seeing this error too?

(I'm working on a long term fix this month)

siddharthkp avatar Jul 05 '19 03:07 siddharthkp

Yes yesterday it didn't work but I just tried and It worked. No idea why

bolismauro avatar Jul 05 '19 06:07 bolismauro

Same here https://travis-ci.org/sweetalert2/sweetalert2/builds/554705140

image

limonte avatar Jul 05 '19 15:07 limonte

bumped bundlesize to ^0.18.0, same result: https://travis-ci.org/sweetalert2/sweetalert2/builds/555643927

image

limonte avatar Jul 08 '19 07:07 limonte

For what is worth, we too are seeing this on Bootstrap for quite some time now.

XhmikosR avatar Jul 09 '19 14:07 XhmikosR

Just installed bundlesize (0.18.0) and when I added BUNDLESIZE_GITHUB_TOKEN I got this error. I'm guessing it's a problem with the size difference calculation because the CI status check still works and we still get size details on the https://bundlesize-store.now.sh website.

Our CI message:

bundlesize — Total bundle size is 514.3KB/1.76MB (-null)

caleb15 avatar Jul 10 '19 21:07 caleb15

same here https://travis-ci.com/ipfs/js-ipfs/jobs/218558166#L415

hugomrdias avatar Jul 23 '19 10:07 hugomrdias

Same here. It started 1 hour ago and restarting builds doesn't help: https://travis-ci.org/Redocly/redoc/builds/564951645

RomanHotsiy avatar Jul 29 '19 12:07 RomanHotsiy

Me too on Travis

ci-prod] [build          ] $ bundlesize
[ci-prod] [build          ] { Error: Request failed with status code 500
[ci-prod] [build          ]     at createError (/home/travis/build/joma74/acc-natours/node_modules/axios/lib/core/createError.js:16:15)
[ci-prod] [build          ]     at settle (/home/travis/build/joma74/acc-natours/node_modules/axios/lib/core/settle.js:18:12)
[ci-prod] [build          ]     at IncomingMessage.handleStreamEnd (/home/travis/build/joma74/acc-natours/node_modules/axios/lib/adapters/http.js:201:11)
[ci-prod] [build          ]     at IncomingMessage.emit (events.js:198:15)
[ci-prod] [build          ]     at endReadableNT (_stream_readable.js:1139:12)
[ci-prod] [build          ]     at processTicksAndRejections (internal/process/task_queues.js:81:17)
[ci-prod] [build          ]   config:
[ci-prod] [build          ]    { adapter: [Function: httpAdapter],
[ci-prod] [build          ]      transformRequest: { '0': [Function: transformRequest] },
[ci-prod] [build          ]      transformResponse: { '0': [Function: transformResponse] },
[ci-prod] [build          ]      timeout: 0,
[ci-prod] [build          ]      xsrfCookieName: 'XSRF-TOKEN',
[ci-prod] [build          ]      xsrfHeaderName: 'X-XSRF-TOKEN',
[ci-prod] [build          ]      maxContentLength: -1,
[ci-prod] [build          ]      validateStatus: [Function: validateStatus],
[ci-prod] [build          ]      headers:
[ci-prod] [build          ]       { Accept: 'application/json, text/plain, */*',
[ci-prod] [build          ]         'User-Agent': 'axios/0.18.0' },
[ci-prod] [build          ]      method: 'get',
[ci-prod] [build          ]      url:
[ci-prod] [build          ]       'https://bundlesize-store.now.sh/values?repo=joma74/acc-natours&token=[secure]',
[ci-prod] [build          ]      data: undefined },
...

joma74 avatar Aug 13 '19 22:08 joma74

Still an issue for me as well. Anything we could contribute to get this fixed?

ctavan avatar Sep 12 '19 20:09 ctavan

If you have a similar issue can you please add a :+1: to the first post, people who are watching this thread for a response get notified so writing a comment that is the same as that isn't very useful

zoetrope69 avatar Sep 16 '19 08:09 zoetrope69

Still an issue for me on this job.

michaelmior avatar Jan 07 '20 20:01 michaelmior

I just ran into this issue, too, unfortunately.

zeptonaut avatar Jan 27 '20 22:01 zeptonaut

I got this issue...

lednhatkhanh avatar Feb 07 '20 15:02 lednhatkhanh

For anyone bumping into this, https://github.com/bundlewatch/bundlewatch might be an alternative.

ctavan avatar Feb 10 '20 08:02 ctavan

We are getting this issue as well on our project. Looking at this thread should we still be using this tool? It looks like this has been an issue for a long time and no one has fixed it, solution seems to be removing the tool for most projects and use an alternative.

@siddharthkp any chance this will be fixed? Is this tool still actively maintained? :slightly_smiling_face:

roligheten avatar Jun 22 '22 13:06 roligheten

Is this tool still actively maintained? 🙂

going to be honest, barely 😓

I did a rewrite which is a lot more reliable - https://github.com/siddharthkp/bundlesize2, it's not 100% feature complete, but it's got the core features you probably need.

Migration path:

  1. Use the npm package bundlesize2 instead of bundlesize
  2. If you'd like status reported back to github, use the flag --enable-github-checks + authorize bundlesize2 app. More in the docs
  3. If anything breaks, let me know :)

siddharthkp avatar Jun 23 '22 10:06 siddharthkp