-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Sequelize misbehaving with Node v14 #12158
Comments
I have the same problem, the |
Hmm... Can someone please create a minimal reproducible example for this? |
We are having the same issue. Will post a minimal example soon! |
I can confirm that the issue is node v14, when we downgrade to 13.x.x the issue goes away. We are using sequelize 5.21.7. The issue we experience is: any sequelize call (sync, findOne, etc) hangs indefinitely with no error messages. For us, this caused Heroku to time out our servers main process. |
The first hypothesis that comes to my mind is that something is wrong with Bluebird in Node 14... |
The problem I think is in |
I have some findings. I tried with a very simple project and it worked. I examined the differences between the packages of this simple project and the project where I faced the issue that I reported and I noticed that in the working project, I had pg@8.0.3. When I installed version 8.0.2 of pg it failed with node v14 (silently) but worked with version 13.13.0. With this in mind I believe that upgrading pg@8.0.3 may resolve the problem. Note, that pg@8.0.3 was only released yesterday. When I upgraded the failing project to pg@8.0.3 it worked without a problem. |
Yes @kororos, upgrading pg@8.0.3 did resolve the problem. |
By the way there has been some unexpected breaking changes in Node 14 regarding streams as well, not sure if related: nodejs/node#33050 and nodejs/node#32954 |
Thanks @kororos ! Updating pg worked for me too. |
Thanks a lot @kororos upgrading pg@8.0.3 worked as it should. |
@tevonsb jeez thanks a lot , downgrading nodejs version did the trick. I was going mad as to what was going on. |
@kd-krishna check my earlier comment above. Upgrading pg package resolved the issue (without having to downgrade node.js) |
I accidentally closed the issue. Reopened it now. |
With Node 14 (and seemlingly also 13) sequelize stopped resolving promises. Updating the pg package solves that. See sequelize/sequelize#12158 Signed-off-by: David Mehren <dmehren1@gmail.com>
With Node 14 (and seemingly also 13) sequelize stopped resolving promises. Updating the pg package solves that. See sequelize/sequelize#12158 Signed-off-by: David Mehren <dmehren1@gmail.com>
As @davidmehren figured out, the problem that NodeJS version 14 gets stuck while CodiMD is starting, was due to the outdated postgres dependency. The old pg version doesn't work with node version 14 due to an undocumented API change in the `readyState` in the socket API. This patch updates the required dependency and this way resolves the issue. Reference: sequelize/sequelize#12158 brianc/node-postgres@149f482 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
db dep upgraded according to sequelize/sequelize#12158 (comment)
This worked for me as well. I'm upgrading a legacy system from node 12 to 14 and are almost on identical versions!
Bumping to |
Same problem here, but bumping versions didn't work for me, I've tried node 14, 12 and 10, pg 8.7.1, sequelize 6.6.5... the program hangs on |
You just saved me! I'd already spent 2+ days fighting with this issue in vain. Thank you. |
FWIW, I ran into this problem when I upgraded from |
This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
Looks like the issue is for other Node versions as well. I ran into this problem of |
Same problem here, but with mysql... "sequelize": "^6.11.0" |
Just found the reason for my problem...
The code above was hanging without any error message... Then I tried with code below:
And it "worked", showing the error message and the error was that sequelize was adding in the query the columns createdAt and updatedAt, and I don't have these columns on my table, so to make sequelize work without these columns I had to define my sequelize instance as below:
and now my code with await works |
Had the same issue, no error or any message, updating the Code had:
This is on a legacy app with Sequelize 4. A google search took me here. |
I'll close this issue as it's now documented that only pg 8 supports Node >= 14: https://sequelize.org/v6/manual/dialect-specific-things.html#postgresql I would recommend upgrading to Sequelize 6, as Sequelize < 6 is not maintained anymore and we can't guarantee that they will continue working with more recent versions of node, or pg. |
My good silent errors are the worst at all for any developer after 2 days. Anyway thanks for your tips, I upgraded to : Be careful devs and I hope this helps for some one else :) |
Same issue for me, tried the error handling as recommended by others and still couldn't track down an error. Eventually identified that it was one of our internal packages node_modules that were the issue. I.e. they were old version of pg / sequelize etc. still. Once they were upgraded as well everything worked as expected. |
Issue happening with me tried almost all combinations above |
Recently upgraded to Node 16 and had this issue again, was also further modules in one of our packages that needed to be upgraded to later versions, all postgres/database related. |
Tried this and didn't work 😞 |
i have the same issue , after changing all package to : my node version is v16.7 some one please can help me? |
Hi Benjamin, it's a matter of finding the right versions for your particular version of node, we were on 16.15 and using these versions which worked: "pg": "8.3.0", "pg-hstore": "2.3.3", "pg-promise": "10.9.1", "sequelize": "6.3.3". We used exact versions rather than allowing upgrade to make sure that they stayed working together. |
Didn't worked for me on ubuntu 20.04 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Upgrading the "pg" version also solved the problem for me |
Today I upgraded to Node v14. However, I run into some interesting issue, most probably with Sequelize.
The problem that I run into is that in a normal execution of my app, sequelize will never return from the queries. However, if I run my program using VSCode debug, it goes through without problems. I have tried it with both v5.21.7 and v6.0.0.-beta.5
Below is the package.json that I have. Note that CLS is not used for Sequelize. I was hoping to replace CLS with Node v14 AsyncLocalStorage.
The text was updated successfully, but these errors were encountered: