-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
Describe the bug
Latest version of the pg package (8.0.0) is not compatible with strapi.
Steps to reproduce the behavior
- Install the
pgpackage like described here https://strapi.io/documentation/3.0.0-beta.x/guides/deployment.html#_5-install-the-pg-node-module - Start the server with the following config.
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "bookshelf",
"settings": {
"client": "postgres",
"host": "${process.env.DATABASE_HOST}",
"port": "${process.env.DATABASE_PORT}",
"database": "${process.env.DATABASE_NAME}",
"username": "${process.env.DATABASE_USERNAME}",
"password": "${process.env.DATABASE_PASSWORD}",
"ssl": true
},
"options": {}
}
}
}- The server fails to start with the following error.
➜ project-folder git:(master) ✗ yarn develop
yarn run v1.22.0
$ strapi develop
[2020-04-02T22:06:49.564Z] error Impossible to register the 'model-name' model.
[2020-04-02T22:06:49.568Z] error Error: self signed certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1473:34)
at TLSSocket.emit (events.js:311:20)
at TLSSocket._finishInit (_tls_wrap.js:916:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:686:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected behavior
When I start the server in production mode, the connection to the DB is made.
How to fix
Install the last 7.x.x version instead.
yarn add pg@^7.18.2Note
The 7.18.2 version of pg shows a deprecation warning.
(node:3130) DeprecationWarning: Implicit disabling of certificate verification is deprecated and will be removed in pg 8. Specify `rejectUnauthorized: true` to require a valid CA or `rejectUnauthorized: false` to explicitly opt out of MITM protection.
System
- Node.js version: v12.16.1 LTS
- Strapi version: 3.0.0-beta.19.3
- Database: PGSQL
- Operating system: Ubuntu WSL on windows/heroku dyno
maxh213, Jemaz and WTX1
Metadata
Metadata
Assignees
Labels
No labels