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

Kind of strange error #2411

Closed
SagarPattnayak opened this issue Nov 13, 2020 · 4 comments
Closed

Kind of strange error #2411

SagarPattnayak opened this issue Nov 13, 2020 · 4 comments

Comments

@SagarPattnayak
Copy link

The connection works fine in my Prod environment. However today after deploying to dev i am getting a strange error. Have never seen this before.

"errorType": "TypeError",
"errorMessage": "Cannot use 'in' operator to search for 'key' in true",
"stack": [
"TypeError: Cannot use 'in' operator to search for 'key' in true",
" at Socket. (/var/task/node_modules/pg/lib/connection.js:86:19)",
" at Object.onceWrapper (events.js:422:26)",
" at Socket.emit (events.js:315:20)",
" at Socket.EventEmitter.emit (domain.js:483:12)",
" at addChunk (_stream_readable.js:295:12)",
" at readableAddChunk (_stream_readable.js:271:9)",
" at Socket.Readable.push (_stream_readable.js:212:10)",
" at TCP.onStreamRead (internal/stream_base_commons.js:186:23)"
]

Any pointer please?

@vitaly-t
Copy link
Contributor

vitaly-t commented Nov 13, 2020

It is probably this change.

Now that ssl is a boolean, operand in is no longer valid.

if ('key' in self.ssl) {

Tests for SSL-using connections are missing for this.

@brianc
Copy link
Owner

brianc commented Nov 13, 2020

It is probably this change.

no, I haven't released #2407 yet.

@SagarPattnayak - I'll release the changes merged with #2407 and it should fix things. If you don't want to wait for the fix, don't pass ssl: "true" with true as a string and you should be fine. Alternatively, wait for the next patch version (due today) and the problem should be fixed for you.

@brianc
Copy link
Owner

brianc commented Nov 13, 2020

@SagarPattnayak - published pg@8.5.1 -- install it & give it a try. It should fix your issue.

@SagarPattnayak
Copy link
Author

Dear @brianc
Thanks for taking care of this so quickly. This is working fine now.

Best
Sagar

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

3 participants