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

connection properties parsing provocates crash in 8.3.x! (TypeError [ERR_INVALID_ARG_TYPE]) #2290

Closed
Apollon77 opened this issue Jul 19, 2020 · 3 comments

Comments

@Apollon77
Copy link

We see a crash that happens in pg 8.3.x without changing anything. I was able to dig it down to 8.2.2 working fine 8.3.0 breaks.

TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type object
    at Function.byteLength (buffer.js:515:11)
    at Writer.addCString (C:\projects\ioBroker.sql\tmp\node_modules\iobroker.sql\node_modules\pg-protocol\dist\buffer-writer.js:41:30)
    at Object.startup (C:\projects\ioBroker.sql\tmp\node_modules\iobroker.sql\node_modules\pg-protocol\dist\serializer.js:9:32)
    at Connection.startup (C:\projects\ioBroker.sql\tmp\node_modules\iobroker.sql\node_modules\pg\lib\connection.js:118:31)
    at Connection.<anonymous> (C:\projects\ioBroker.sql\tmp\node_modules\iobroker.sql\node_modules\pg\lib\client.js:118:11)
    at Connection.emit (events.js:198:13)
    at Socket.<anonymous> (C:\projects\ioBroker.sql\tmp\node_modules\iobroker.sql\node_modules\pg\lib\connection.js:49:10)
    at Object.onceWrapper (events.js:286:20)
    at Socket.emit (events.js:203:15)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:10)

This also happens in Travis/Appveyor.
Connection properties are:
{"server":"localhost","host":"localhost","user":"postgres","password":"Password12!","max_idle":2,"max_active":100,"max_wait":10000,"when_exhausted":"block","options":{"encrypt":false}}

Failing build with 8.3: https://travis-ci.org/github/ioBroker/ioBroker.sql/builds/709730547
Working build with 8.2 (no other changes): https://travis-ci.org/github/ioBroker/ioBroker.sql/builds/709722736

Apollon77 added a commit to ioBroker/ioBroker.sql that referenced this issue Jul 19, 2020
@Apollon77
Copy link
Author

PS: Could it be that the "options" objects is now parsed/handled differently then before?

@charmander
Copy link
Collaborator

options was added as an option in #2216 (pg@8.3.0). There’s always the danger when passing unrecognized options that they’ll be added in the future, so it’s something to look out for with new minor versions.

@Apollon77
Copy link
Author

Ok, thx, I remove it

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

2 participants