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

Failing at connection after running npm install #1636

Closed
vladpap31 opened this issue May 4, 2018 · 17 comments
Closed

Failing at connection after running npm install #1636

vladpap31 opened this issue May 4, 2018 · 17 comments
Labels

Comments

@vladpap31
Copy link

I have a piece of code that connects to Redshift and runs a query. The code worked until I re-deployed today without changing anything in the functionality or the npm version. Note that every time I deploy the code, it installs all the npm packages before archiving.

In package.json I have "pg": "^7.4.1" as the dependency.

The error I am constantly getting is:

AssertionError: false == true
at Object.exports.connect (_tls_wrap.js:1020:3)
at Socket.<anonymous> (/var/task/node_modules/pg/lib/connection.js:94:23)
at Socket.g (events.js:292:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:547:20)

Anyone have a clue on what is causing this? Thanks!

@tylerslater-io
Copy link

tylerslater-io commented May 4, 2018

I had this exact issue as well. It took our site down in production as we spun up new servers because the ^ character in your package.json means to load in the most recent minor version package, and since 7.4.2 is new as of 4 hrs ago it loaded that package in. I had to remove the ^ from my dependency so that it would lock in the previous version.

Edit: If someone with more knowledge than me things this is an pretty easy fix, let me know and I'll take a crack at trying to fix it.

@larsthorup
Copy link

@vitaly-t Note, that this issue appears to also impact pg-promise@8.4.1

@vitaly-t
Copy link
Contributor

vitaly-t commented May 5, 2018

@vladpap31 Please tells us what versions of Node.js and PostgreSQL are you using.

@unigazer
Copy link

unigazer commented May 5, 2018

Encountered the same issue 5 minutes ago.

Node: v10,
Postgres: 10.3

@vitaly-t
Copy link
Contributor

vitaly-t commented May 5, 2018

@larsthorup Thank you for pinging me on this. I have reverted pg-promise in version 8.4.2 to the previous version of the driver.

@vladpap31
Copy link
Author

vladpap31 commented May 5, 2018

I am using Node 6.10 and the database is Amazon Redshift which is based off of PostgreSQL 8.0.2

@vitaly-t
Copy link
Contributor

vitaly-t commented May 5, 2018

Ok, so it is fair to say at this point that the issue is irrelevant of the Node.js or PostgreSQL versions. It was a generic-type break in connectivity, caused by one of these commits:

@charmander charmander added the bug label May 5, 2018
@charmander
Copy link
Collaborator

#1638

@DMor1
Copy link

DMor1 commented May 6, 2018

I also ran into this Node 8.11.1

@mouf13
Copy link

mouf13 commented May 6, 2018

Same result here since yesterday : Node 8.11.1, postgresql 9.4.6.
I'm using the lib through https://github.com/strongloop/loopback-connector-postgresql which use "pg": "^7.0.0"
To make my projects works again, i temporary set the pg version to "7.4.1" in my package-lock.json for the loopback-connector-postgresql
then i installed "pg-types"

@matthiasak
Copy link
Contributor

did some sleuthing before I even saw this thread - fix here #1638

@etw3gh
Copy link

etw3gh commented May 7, 2018

had to roll back to pg@6.4.2

@matthiasak
Copy link
Contributor

For anyone needing to move forward, rolling back to 7.4.1 should work.

@etw3gh
Copy link

etw3gh commented May 7, 2018

I had the same issue for anything >7

@matthiasak
Copy link
Contributor

matthiasak commented May 7, 2018 via email

@vitaly-t
Copy link
Contributor

vitaly-t commented May 7, 2018

@openciti

I had the same issue for anything >7

Not possible, unless you include it as: "pg": "^7.0.0", or didn't re-install it properly after updating in package.json.

unigazer referenced this issue May 7, 2018
…a method or not exist.

Defaults to built-in `tls.checkServerIdentity` method in the event one is not passed into `pgConfig.ssl`

Found breaking in v9.4.2 vs v9.4.1 a la 4905471

cc @tobio @brianc
@unigazer
Copy link

unigazer commented May 7, 2018

The issue is fixed wit the commit 7de137f.
Thank you @matthiasak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants