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

clone module causes NodeJS to crash with some objects #60

Closed
paglias opened this issue Mar 31, 2020 · 7 comments
Closed

clone module causes NodeJS to crash with some objects #60

paglias opened this issue Mar 31, 2020 · 7 comments

Comments

@paglias
Copy link

@paglias paglias commented Mar 31, 2020

We're using Loggly and this module at our company and we started to have issues with NodeJS crashing, after some investigation we were able to determine that they were caused by the clone module this library is using when passed some arguments it's not able to clone, in our case it was errors from the quite popular superagent module https://github.com/visionmedia/superagent

More info:

Reproduction

// setup winston to use loggly and send json

import superagent from 'superagent';

// any url returning a non-successfull http error works 
superagent.post('https://habitica.com/api/v4/user').catch(err => {
  logger.error(err); // this will crash node
});

Given the type of crash and the fact that the maintainer of the clone module doesn't seem interested in fixing it, I would suggest to change it to a different implementation because right now it's making it quite difficult for us to use this module knowing that any error that includes a stream or some other properties will result in the nodejs process to crash

thanks!

@devotox
Copy link

@devotox devotox commented Apr 1, 2020

This happens way too often.

It seems the master branch of clone has a fix from this PR but no release cut yet

@paglias
Copy link
Author

@paglias paglias commented Apr 1, 2020

I'm wondering if cloning is even needed in this case, it's basically cloning an object already modified by winston and changing 3 properties, it might be easier to simply restore the properties to the origininal state after the message is sent

I'm not sure who's managing this repo (trying with @alestrunda @michal-bures) but this issue is pretty serious and preventing us from using Loggly right now so it would be nice to know if there's an intention to fix it or not, thanks :)

@devotox
Copy link

@devotox devotox commented Apr 1, 2020

Make a PR and you could test it in your system by using your GitHub version

@paglias
Copy link
Author

@paglias paglias commented Apr 1, 2020

@devotox I will if it's not fixed in the coming days but given that this repository is under loggly's organization, that it's a product we're paying for and that the bug is pretty serious (IMO) and makes the use of this module quite dangerous in production I wanted to first see if there was any interest in fixing this directly from Loggly

@alestrunda
Copy link

@alestrunda alestrunda commented Apr 2, 2020

Thanks for pointing that out, this library hasn't been updated for some time, we are currently reviewing what changes should be made.

@alestrunda
Copy link

@alestrunda alestrunda commented Apr 6, 2020

fixed in 644466d

@alestrunda alestrunda closed this Apr 6, 2020
@paglias
Copy link
Author

@paglias paglias commented Apr 7, 2020

@alestrunda thanks for fixing this! We'll re-enable Loggly at the end of the week, I'll let you know if there's any problem but it shouldn't

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
3 participants
You can’t perform that action at this time.