Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unexpected end of input #56

Closed
wants to merge 1 commit into from
Closed

Conversation

dmlemos
Copy link

@dmlemos dmlemos commented Jun 1, 2018

We were getting a lot of these errors in our Kubernetes cluster:

undefined:1
ly@sha256:1e46371b9c63bcf93d2ef61a0037abecaaacc5cc65f5738108d5e233ada6211a","i
                                                                             ^
SyntaxError: Unexpected token i
    at Object.parse (native)
    at DestroyableTransform._transform (/usr/src/app/node_modules/docker-allcontainers/allcontainers.js:27:21)
    at DestroyableTransform.Transform._read (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
undefined:1
o.kubernetes.container.name":"POD","io.kubernetes.docker.type":"podsandbox","i
                                                                             ^
SyntaxError: Unexpected token i
    at Object.parse (native)
    at DestroyableTransform._transform (/usr/src/app/node_modules/docker-allcontainers/allcontainers.js:27:21)
    at DestroyableTransform.Transform._read (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
undefined:1
ubernetes.container.terminationMessagePath":"/dev/termination-log","annotation
                                                                    ^
SyntaxError: Unexpected token a
    at Object.parse (native)
    at DestroyableTransform._transform (/usr/src/app/node_modules/docker-allcontainers/allcontainers.js:27:21)
    at DestroyableTransform.Transform._read (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
undefined:1
reedge.net/pause-amd64:3.1","Type":"container","Action":"attach","Actor":{"ID"

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at DestroyableTransform._transform (/usr/src/app/node_modules/docker-allcontainers/allcontainers.js:27:21)
    at DestroyableTransform.Transform._read (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
undefined:1
e":"ibt-ibt-ist","io.kubernetes.pod.uid":"d64fe93f-64be-11e8-a9c6-000d3aba3890

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at DestroyableTransform._transform (/usr/src/app/node_modules/docker-allcontainers/allcontainers.js:27:21)
    at DestroyableTransform.Transform._read (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
undefined:1
tes.container.name":"POD","io.kubernetes.docker.type":"podsandbox","io.kuberne
                                                                    ^
SyntaxError: Unexpected token i
    at Object.parse (native)
    at DestroyableTransform._transform (/usr/src/app/node_modules/docker-allcontainers/allcontainers.js:27:21)
    at DestroyableTransform.Transform._read (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
undefined:1
ubernetes.container.terminationMessagePath":"/dev/termination-log","annotation
                                                                    ^
SyntaxError: Unexpected token a
    at Object.parse (native)
    at DestroyableTransform._transform (/usr/src/app/node_modules/docker-allcontainers/allcontainers.js:27:21)
    at DestroyableTransform.Transform._read (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at DestroyableTransform.Writable.write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/usr/src/app/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)

I suspected it was due to this issue on the end-of-stream dependency:
mafintosh/end-of-stream#14

The PR upgrades end-of-stream dependency to a recent version. Also noticed that pretty much all packages are out of date, so went ahead and did an upgrade to all of them.

Its been running fine with this change on our kubernetes cluster.

@sbialkowski-r7
Copy link
Contributor

sbialkowski-r7 commented Jan 25, 2021

Hi @dmlemos!

Thank you for the contribution but we no longer maintain the legacy Logentries libraries.

I checked and the new library should have the fix for this since it uses a recent version of end-of-stream: https://github.com/rapid7/r7insight_docker

Migrating shouldn't be too much of a hassle since they work in the same fashion and support LE (just make sure you include the region flag -r eu), if it is I guess I'd just recommend you continue using this library with your change until you can switch over.

@dmlemos
Copy link
Author

dmlemos commented Jan 25, 2021

@sbialkowski-r7 Thanks for commenting.

I understand the need to move on, however there was a severity 1 bug that disrupted production service. The minimum expected from rapid7, was to support these situations, or to help migrating to the new library (if available at the time).
Considering the company I was working for, was paying for your product, it could have been handled more gracefully in my opinion.
Fortunately the fix was simple, even though the debug was not.
Since I no longer use this product, I cannot comment on the new library, but I'm glad this was finally looked at.

@dmlemos dmlemos closed this Jan 25, 2021
@sbialkowski-r7
Copy link
Contributor

@dmlemos Sorry if we didn't handle it properly; for the future what could we have done better?

Informing customers that they should move off of LE images and helping them migrate?

We never knew about this problem

@dmlemos
Copy link
Author

dmlemos commented Jan 26, 2021

It's great that the README was updated with the new library information to be fair, which was there before this PR existed. Although the wording should emphasise in bold the deprecation of this library completely. For example, we didn't notice at the time.

Sorry if we didn't handle it properly; for the future what could we have done better?

When a critical issue affects all production clusters, support is expected to exist. Considering the new library was communicated in the README only a month before, there was not enough time to make the transition.
We were not receiving any logs whatsoever due to the error above, and the only thing that mattered was resolving it first, and then think about a mitigation/migration path afterwards.

Informing customers that they should move off of LE images and helping them migrate?

In this situation, I believe the problem should have been acknowledged officially by the rapid7 team for the customers using the legacy version, by either merging this PR and pushing a new image, or another implementation (the details don't matter).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants