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

TypeError [ERR_INVALID_ARG_TYPE] on Test database connection? installing on Windows 10 with PostgreSQL 13 #106

Open
greenermoose opened this issue Dec 15, 2020 · 1 comment

Comments

@greenermoose
Copy link

Bug report

Installation fails at Test database connection? when installing on Windows 10 with PostgreSQL 13.

Describe the bug

The following fatal error is thrown during installation:

Answer a few questions and we'll generate a starter project for you.

√ What is your project name? ... api3
√ Select a database type » PostgreSQL
√ Where is your database located? ... postgres://localhost/api3
√ Test database connection? ... No / Yes
node:internal/crypto/keys:384
throw new ERR_INVALID_ARG_TYPE(
^

TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, DataView, KeyObject, or CryptoKey. Received null
at new NodeError (node:internal/errors:277:15)
at prepareSecretKey (node:internal/crypto/keys:384:11)
at new Hmac (node:internal/crypto/hash:132:9)
at Object.createHmac (node:crypto:155:10)
at createHMAC (C:\Users\fyhor\AppData\Local\Yarn\Data\global\node_modules\pg\lib\sasl.js:133:17)
at Hi (C:\Users\fyhor\AppData\Local\Yarn\Data\global\node_modules\pg\lib\sasl.js:137:13)
at Object.continueSession (C:\Users\fyhor\AppData\Local\Yarn\Data\global\node_modules\pg\lib\sasl.js:32:24)
at Client._handleAuthSASLContinue (C:\Users\fyhor\AppData\Local\Yarn\Data\global\node_modules\pg\lib\client.js:257:10)
at Connection.emit (node:events:329:20)
at C:\Users\fyhor\AppData\Local\Yarn\Data\global\node_modules\pg\lib\connection.js:115:12
at Parser.parse (C:\Users\fyhor\AppData\Local\Yarn\Data\global\node_modules\pg-protocol\dist\parser.js:40:17)
at Socket. (C:\Users\fyhor\AppData\Local\Yarn\Data\global\node_modules\pg-protocol\dist\index.js:10:42)
at Socket.emit (node:events:329:20)
at addChunk (node:internal/streams/readable:304:12)
at readableAddChunk (node:internal/streams/readable:279:9)
at Socket.Readable.push (node:internal/streams/readable:218:10) {
code: 'ERR_INVALID_ARG_TYPE'
}
error Command failed.
Exit code: 1

To Reproduce

Attempt to install keystonejs on Windows 10 using PostgreSQL 13.

Same error thrown if you respond "N" to Test database connection? and then try npx keystone create-tables.

Expected behaviour

Installation script should not fail.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: Windows 10
  • Database: PostgreSQL 13

Additional context

Clean install. PostgreSQL database is running.

@lisakoller
Copy link

I've run into the same problem like you - to solve it I've added the authentication information of a database user with sufficient rights to the connection string (like this postgres://USERNAME:PASSWORD@localhost/api3).

@timleslie timleslie transferred this issue from keystonejs/keystone Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants