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

TypeError('"string" must be a string, Buffer, or ArrayBuffer') when logging a string #10

Closed
mrister opened this issue May 21, 2017 · 15 comments

Comments

@mrister
Copy link

@mrister mrister commented May 21, 2017

So When I do the example like in the readme (With proper Loggly credentials).
https://github.com/loggly/node-loggly-bulk#getting-started

And If i do a client.log('test') I get:
TypeError('"string" must be a string, Buffer, or ArrayBuffer');

I am not sure the tests, in general here, are passing either.

@mostlyjason
Copy link

@mostlyjason mostlyjason commented May 22, 2017

@Shwetajain148 can you reproduce this on your end?

@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented May 23, 2017

@mrister I am not able to reproduce the issue. Can you please share your .js file that is creating the issue for you. Also, share the version of node and details of the environment in which you are setting up logging and observing this issue.

cc: @mostlyjason

@mrister
Copy link
Author

@mrister mrister commented May 24, 2017

@mostlyjason Node: v7.7.2
Here is the code:

// https://github.com/loggly/node-loggly-bulk#getting-started
// did: npm i node-loggly-bulk
const loggly = require('node-loggly-bulk');

const client = loggly.createClient({
  token: '<My TOKEN>',
  subdomain: '<My SUBDOMAIN>',
  json:true
});

client.log('test');
@mrister
Copy link
Author

@mrister mrister commented May 24, 2017

Works on node 6.9.1

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Jul 19, 2017

Closing since this issue is fixed. If it reoccurs please reopen.

@jingram-classy
Copy link

@jingram-classy jingram-classy commented Nov 1, 2017

Seeing this again with Node v8.8.0:
TypeError: "string" must be a string, Buffer, or ArrayBuffer
at Function.byteLength (buffer.js:479:11)
at exports.Loggly.Loggly.log (/classy/pay/node_modules/node-loggly-bulk/lib/loggly/client.js:161:32)
at Bunyan2Loggly._processBuffer (/classy/pay/node_modules/bunyan-loggly/index.js:48:32)
at Bunyan2Loggly._checkBuffer (/classy/pay/node_modules/bunyan-loggly/index.js:61:21)
at Bunyan2Loggly.write (/classy/pay/node_modules/bunyan-loggly/index.js:37:10)
at Logger._emit (/classy/pay/node_modules/bunyan/lib/bunyan.js:923:22)
at Logger.debug (/classy/pay/node_modules/bunyan/lib/bunyan.js:1045:24)
at /classy/pay/bin/www:19:7
at /classy/pay/config.js:294:5
at __NR_wrappedThenHandler (/classy/pay/node_modules/newrelic/lib/instrumentation/promise.js:468:25)
at runCallback (timers.js:785:20)
at tryOnImmediate (timers.js:747:5)
at processImmediate [as _immediateCallback] (timers.js:718:5)
From previous event:
at Promise.__NR_wrappedThen (/classy/pay/node_modules/newrelic/lib/instrumentation/promise.js:426:23)
at Object.config.init (/classy/pay/config.js:291:22)
at Object. (/classy/pay/bin/www:12:8)
at Module._compile (module.js:612:30)
at Object.Module._extensions..js (module.js:623:10)
at Module.load (module.js:531:32)
at tryModuleLoad (module.js:494:12)
at Function.Module._load (module.js:486:3)
at Function.Module.runMain (module.js:653:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
root@ip-10-21-201-241:/var/log/upstart# node -v
v8.8.0

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Nov 1, 2017

Reopening since it's been reported here as well MauriceButler/bunyan-loggly#23. FYI bunyan-loggly is a community supported library so we have not tested that one yet. The fix we made earlier for winston might affect bunyan differently.

@jingram-classy
Copy link

@jingram-classy jingram-classy commented Nov 1, 2017

FYI, for bunyan-loggly users, I was able to fork bunyan-loggly and downgrade node-loggly-bulk to 2.0.2 as a workaround. Works fine for now.

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Nov 8, 2017

Addressed in 2.1.0 please reopen if it keeps happening after updating.

@mostlyjason mostlyjason closed this Nov 8, 2017
@mostlyjason
Copy link

@mostlyjason mostlyjason commented Nov 13, 2017

Hey guys we temporarily had to roll back this change in 2.2.0 so this may pop up again, but we are working on a fix which should be ready in a few days.

@mrister
Copy link
Author

@mrister mrister commented Nov 13, 2017

@mostlyjason I suggest you reopen to not forget this issue and close once confirmed what exact version when it will be fixed.

@mostlyjason
Copy link

@mostlyjason mostlyjason commented Nov 13, 2017

Thanks I'm reopening it now

@mostlyjason mostlyjason reopened this Nov 13, 2017
@tinder-dyakobian
Copy link

@tinder-dyakobian tinder-dyakobian commented Nov 15, 2017

I am experiencing this issue in latest update

shubham-prasad added a commit to totalcloud/bunyan-loggly that referenced this issue Nov 21, 2017
@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented Nov 29, 2017

@mostlyjason I have published a beta package and left a comment including the instruction to install the beta package on the issue MauriceButler/bunyan-loggly#23.

Ref: MauriceButler/bunyan-loggly#23 (comment).

JorgenEvens added a commit to ambassify/bunyan-loggly that referenced this issue Dec 4, 2017
@mostlyjason
Copy link

@mostlyjason mostlyjason commented Dec 6, 2017

This should be fixed in version 2.2.1. Closing for now, but please reopen if the issue reoccurs after updating.

@mostlyjason mostlyjason closed this Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.