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

bunyan tool crashes with Object.keys called on non-object #30

Closed
vincentcr opened this issue Aug 8, 2012 · 3 comments
Closed

bunyan tool crashes with Object.keys called on non-object #30

vincentcr opened this issue Aug 8, 2012 · 3 comments

Comments

@vincentcr
Copy link

while running the tool like this:

$ myprog 2>&1 | ./node_modules/.bin/bunyan

i wil get this error sometimes:

/Users/vincent/devel/server/node_modules/bunyan/bin/bunyan:510
        Object.keys(headers).map(
               ^
TypeError: Object.keys called on non-object
    at Function.keys (native)
    at emitRecord (/Users/vincent/devel/server/node_modules/bunyan/bin/bunyan:510:16)
    at handleLogLine (/Users/vincent/devel/server/node_modules/bunyan/bin/bunyan:415:12)
    at Socket.<anonymous> (/Users/vincent/devel/server/node_modules/bunyan/bin/bunyan:674:7)
    at Socket.EventEmitter.emit (events.js:88:17)
    at Pipe.onread (net.js:398:31)
make: *** [run] Error 1

@trentm
Copy link
Owner

trentm commented Aug 8, 2012

@vincentcr Can you post an example log record that causes this problem. I'm guessing that you have a "req" top-level field in the log record that does NOT have a headers sub field. Just want to confirm that, then I can get bunyan to handle that gracefully.

@vincentcr
Copy link
Author

Hi Trent,

you are correct, the entry contains a req top-level field without a headers sub-field, like this:

"req":{
 "reqid":"18abcf50-e1a2-11e1-ad55-959773e9549f",
 "method":"GET",
 "url":"/",
 "user-agent":"curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5",
 "accept":"*/*",
 "remote-address":"127.0.0.1",
 "host":"localhost:3000",
 "http-version":"1.1",
 "status":200,
"content-length":"14"}

trentm added a commit that referenced this issue Aug 9, 2012
@trentm
Copy link
Owner

trentm commented Aug 9, 2012

In 0.11.2 release.

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

No branches or pull requests

2 participants