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

Release a new version whiteout de pg-native bug #9652

Closed
ricardopolo opened this issue Jul 12, 2018 · 11 comments
Closed

Release a new version whiteout de pg-native bug #9652

ricardopolo opened this issue Jul 12, 2018 · 11 comments

Comments

@ricardopolo
Copy link

ricardopolo commented Jul 12, 2018

Can you release please a new npm version that include this merged PR #9551?

The bug is stopping our project!

Thanks!

@sushantdhiman
Copy link
Contributor

Ah #9551 was never merged, it failed for postgres-native and I didn't have enough time to dig in for this.

A better solution could be to replace cloneDeep with Utils.cloneDeep in internal sequelize code base.

@ricardograca how this bug is affecting you, are you trying to clone sequelize or some other condition is triggering this.

@ricardopolo
Copy link
Author

The issue was fixed for me
It was caused for a high CPU server, when the the server is 100% CPU, the error starts to happen.

We identify the reason behind the high CPU consumption and don’t see the error again.

@lxcid
Copy link

lxcid commented Jul 26, 2018

@sushantdhiman I'm facing this issue as well, it cause memory to build up until it crashes. In the meantime the server become unresponsive. It happen fairly recently. I'm on sequelize 4.37.10 and pg v7.4.3

Multiple log always show that the server hang soon after the following line in log

Cannot find module 'pg-native'

But I have no idea which code in my codebase triggering it. Any suggestion I can trace this issue?

@sushantdhiman
Copy link
Contributor

Not sure what is the reason behind this, you may find more hints in #3781

My assumption: under heavy load Sequelize code takes some path which is trying to clone either Sequelize instance or connection (may be as part of options)

Been unable to pinpoint that specific condition as I lack a reliable test case

@ricardopolo
Copy link
Author

I agree this happens only when very heavy load. In our case and code bug with and infinite
Loop writing in the DB.

@lxcid
Copy link

lxcid commented Jul 26, 2018

My assumption: under heavy load Sequelize code takes some path which is trying to clone either Sequelize instance or connection (may be as part of options)

This is interesting behavior to keep in mind of. If we can print out the stack trace when the pg-native is not found thrown, we might be able to get some more information?

I downgraded my sequelize/pg to see if its still happening.

I look at my metrics log and didn't notice and weird build up of cpu usage. If I have more info, I'll try to keep you guys updated. :)

@acao
Copy link

acao commented Jul 27, 2018

also seeing this issue
os: osx 10.13.5
node: v8.11.3
yarn: 1.7.0
versions: 5 betas, 4.38.0 and 4.37.10

@lxcid
Copy link

lxcid commented Jul 27, 2018

fyi, downgrade didn't work for me. If there's a way for us to see find out what trigger the codepath, it will help us work around the issue though. Is there any technique you guys have in mind when deal with this kind of situation?

@lxcid
Copy link

lxcid commented Jul 29, 2018

Just want to shared that I have identify the issue to be caused by Raven having CPU spike on my server. So same issue with @ricardograca

getsentry/sentry-javascript#1395

@Ricardonacif
Copy link

Ricardonacif commented Mar 25, 2019

I can reproduce this bug consistently under no load at all with:

const { cloneDeep } = require('lodash');

const sequelize = new Sequelize({
  dialect: 'postgres'
});

cloneDeep(sequelize);

Gonna try to debug this further. It's a weird issue because it messes with the process somehow. Just after the message Cannot find module 'pg-native' appear, I start to get socket hangup on other parts of the code not related to where I was calling sequelize stuff.

@Ricardonacif
Copy link

@ricardopolo can you reopen this?

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

5 participants