charts icon indicating copy to clipboard operation
charts copied to clipboard

strapi - npm can not pull pg

Open YoMamasNerd opened this issue 1 year ago • 0 comments

App Name

strapi

Operating System

TrueNAS SCALE 23.10.1

App Version

4.16.2

Application Events

2024-01-28 23:47:21
Successfully pulled image "naskio/strapi:4.16.2-alpine@sha256:d8db831e85f1bf5132ed95910c511ec63d87b8777cd84068eb86b1f1a946c410" in 833.671427ms (833.680514ms including waiting)
2024-01-28 23:46:17
Startup probe failed: dial tcp 172.16.1.12:1337: connect: connection refused
2024-01-28 23:46:07
Started container strapi
2024-01-28 23:46:06
Successfully pulled image "naskio/strapi:4.16.2-alpine@sha256:d8db831e85f1bf5132ed95910c511ec63d87b8777cd84068eb86b1f1a946c410" in 860.507477ms (860.516273ms including waiting)
2024-01-28 23:46:06
Created container strapi
2024-01-28 23:46:05
Pulling image "naskio/strapi:4.16.2-alpine@sha256:d8db831e85f1bf5132ed95910c511ec63d87b8777cd84068eb86b1f1a946c410"
2024-01-28 23:45:52
Created container postgres
2024-01-28 23:45:52
Started container postgres
2024-01-28 23:45:51
Container image "ghcr.io/cloudnative-pg/postgresql:16.1" already present on machine
2024-01-28 23:45:48
Created container bootstrap-controller
2024-01-28 23:45:48
Started container bootstrap-controller
2024-01-28 23:45:47
Add eth0 [172.16.1.13/16] from ix-net
2024-01-28 23:45:47
Container image "ghcr.io/cloudnative-pg/cloudnative-pg:1.22.0" already present on machine
2024-01-28 23:45:46
Job completed
2024-01-28 23:45:46
Successfully assigned ix-strapi/strapi-cnpg-main-1 to ix-truenas
2024-01-28 23:45:34
Created container initdb
2024-01-28 23:45:34
Started container initdb
2024-01-28 23:45:33
Container image "ghcr.io/cloudnative-pg/postgresql:16.1" already present on machine
2024-01-28 23:45:30
Created container strapi-system-cnpg-wait
2024-01-28 23:45:30
Started container strapi-system-cnpg-wait
2024-01-28 23:45:30
Created container bootstrap-controller
2024-01-28 23:45:30
Started container bootstrap-controller
2024-01-28 23:45:30
Created container pgbouncer
2024-01-28 23:45:30
Started container pgbouncer
2024-01-28 23:45:29
Container image "ghcr.io/cloudnative-pg/pgbouncer:1.21.0" already present on machine
2024-01-28 23:45:27
Add eth0 [172.16.1.11/16] from ix-net
2024-01-28 23:45:27
Container image "ghcr.io/cloudnative-pg/cloudnative-pg:1.22.0" already present on machine
2024-01-28 23:45:27
Add eth0 [172.16.1.12/16] from ix-net
2024-01-28 23:45:27
Container image "tccr.io/tccr/db-wait-postgres:v1.1.0@sha256:4e4e5b9f37a5d0c8d90d744de23d1857079095fbb55d2944ec91d83241f60376" already present on machine
2024-01-28 23:45:26
Order completed successfully
2024-01-28 23:45:26
Certificate fetched from issuer successfully
2024-01-28 23:45:26
The certificate has been successfully issued
2024-01-28 23:45:25
Updated LoadBalancer with new IPs: [] -> [192.168.178.111]
2024-01-28 23:45:23
Successfully provisioned volume pvc-fc105edc-69b1-4382-834f-ec75c37470e2
2024-01-28 23:45:23
Successfully provisioned volume pvc-21edb6e7-8635-4df5-817d-c4f43f78c571
2024-01-28 23:45:23
Successfully assigned ix-strapi/strapi-857d964bc9-p58gj to ix-truenas
2024-01-28 23:45:23
Successfully assigned ix-strapi/strapi-cnpg-main-1-initdb-nmx2w to ix-truenas
2024-01-28 23:45:23
Created container bootstrap-controller
2024-01-28 23:45:23
Started container bootstrap-controller
2024-01-28 23:45:22
Stored new private key in temporary Secret resource "strapi-tls-0-bgsgb"
2024-01-28 23:45:22
0/1 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod..
2024-01-28 23:45:22
Created pod: strapi-cnpg-main-1-initdb-nmx2w
2024-01-28 23:45:22
Not signing CertificateRequest until it is Approved
2024-01-28 23:45:22
Not signing CertificateRequest until it is Approved
2024-01-28 23:45:22
Not signing CertificateRequest until it is Approved
2024-01-28 23:45:22
Not signing CertificateRequest until it is Approved
2024-01-28 23:45:22
Not signing CertificateRequest until it is Approved
2024-01-28 23:45:22
Created new CertificateRequest resource "strapi-tls-0-1"
2024-01-28 23:45:22
Scaled up replica set strapi-cnpg-main-pooler-rw-6f67748775 to 1
2024-01-28 23:45:22
Created pod: strapi-cnpg-main-pooler-rw-6f67748775-wx8wg
2024-01-28 23:45:22
Successfully assigned ix-strapi/strapi-cnpg-main-pooler-rw-6f67748775-wx8wg to ix-truenas
2024-01-28 23:45:22
Certificate request has been approved by cert-manager.io
2024-01-28 23:45:22
Created Order resource ix-strapi/strapi-tls-0-1-1701974500
2024-01-28 23:45:22
Waiting on certificate issuance from order ix-strapi/strapi-tls-0-1-1701974500: ""
2024-01-28 23:45:22
Add eth0 [172.16.1.10/16] from ix-net
2024-01-28 23:45:22
Successfully provisioned volume pvc-66981ddc-10dc-48ae-be5c-9d230aba5f64
2024-01-28 23:45:22
Container image "ghcr.io/cloudnative-pg/cloudnative-pg:1.22.0" already present on machine
2024-01-28 23:45:21
External provisioner is provisioning volume for claim "ix-strapi/strapi-data"
2024-01-28 23:45:21
waiting for a volume to be created, either by external provisioner "zfs.csi.openebs.io" or manually created by system administrator
2024-01-28 23:45:21
Ensuring load balancer
2024-01-28 23:45:21
There are no available nodes for LoadBalancer
2024-01-28 23:45:21
Applied LoadBalancer DaemonSet kube-system/svclb-strapi-58babab4
2024-01-28 23:45:21
Scaled up replica set strapi-857d964bc9 to 1
2024-01-28 23:45:21
0/1 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod..
2024-01-28 23:45:21
Created pod: strapi-857d964bc9-p58gj
2024-01-28 23:45:21
Successfully created Certificate "strapi-tls-0"
2024-01-28 23:45:21
Issuing certificate as Secret does not exist
2024-01-28 23:45:21
Creating ServiceAccount
2024-01-28 23:45:21
Creating Cluster Role
2024-01-28 23:45:21
Primary instance (initdb)
2024-01-28 23:45:21
External provisioner is provisioning volume for claim "ix-strapi/strapi-cnpg-main-1"
2024-01-28 23:45:21
External provisioner is provisioning volume for claim "ix-strapi/strapi-cnpg-main-1-wal"
2024-01-28 23:45:21
waiting for a volume to be created, either by external provisioner "zfs.csi.openebs.io" or manually created by system administrator
2024-01-28 23:45:21
waiting for a volume to be created, either by external provisioner "zfs.csi.openebs.io" or manually created by system administrator

Application Logs

Using strapi 4.16.2
No project found at /srv/app. Creating a new strapi project ...
The `strapi new` command has been deprecated in v4 and will be removed in v5. `create-strapi-app` should be used to create a new Strapi project.
Creating a project from the database CLI arguments.
Creating a new Strapi application at /srv/app.
Creating files.
- Installing dependencies:
Dependencies installed successfully.

Your application was created at /srv/app.

Available commands in your project:

  yarn develop
  Start Strapi in watch mode. (Changes in Strapi project files will trigger a server restart)

  yarn start
  Start Strapi without watch mode.

  yarn build
  Build Strapi admin panel.

  yarn strapi
  Display all available commands.

You can start by doing:

  cd /srv/app
  yarn develop

Starting your app (with develop)...
- Building build context

[INFO] Including the following ENV variables as part of the JS bundle:
    - ADMIN_PATH
    - STRAPI_ADMIN_BACKEND_URL
    - STRAPI_TELEMETRY_DISABLED
✔ Building build context (40ms)
- Creating admin
✔ Creating admin (8628ms)
- Loading Strapi
Knex: run
$ npm install pg --save
Cannot find module 'pg'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/postgres/index.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/index.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/knex-builder/internal/config-resolver.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/knex-builder/Knex.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/index.js
- /usr/local/share/.config/yarn/global/node_modules/knex/knex.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/database/dist/index.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/Strapi.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/action.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/command.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/commands/index.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/cli.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/bin/strapi.js
Error: Cannot find module 'pg'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/postgres/index.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/index.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/knex-builder/internal/config-resolver.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/knex-builder/Knex.js
- /usr/local/share/.config/yarn/global/node_modules/knex/lib/index.js
- /usr/local/share/.config/yarn/global/node_modules/knex/knex.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/database/dist/index.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/Strapi.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/action.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/commands/actions/admin/create-user/command.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/commands/index.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/cli.js
- /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/bin/strapi.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
    at Module._load (node:internal/modules/cjs/loader:975:27)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Client_PG._driver (/usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/postgres/index.js:63:12)
    at Client_PG.initializeDriver (/usr/local/share/.config/yarn/global/node_modules/knex/lib/client.js:198:26)
    at new Client (/usr/local/share/.config/yarn/global/node_modules/knex/lib/client.js:83:12)
    at new Client_PG (/usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/postgres/index.js:21:5)
    at Object.knex [as default] (/usr/local/share/.config/yarn/global/node_modules/knex/lib/knex-builder/Knex.js:16:28)
[ERROR]  There seems to be an unexpected error, try again with --debug for more information 

    at createConnection (/usr/local/share/.config/yarn/global/node_modules/@strapi/database/dist/index.js:5999:31)
┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│   Error: Knex: run                                                           │
│   $ npm install pg --save                                                    │
│   Cannot find module 'pg'                                                    │
│   Require stack:                                                             │
│   - /usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/po   │
│   stgres/index.js                                                            │
│   - /usr/local/share/.config/yarn/global/node_modules/knex/lib/dialects/in   │
│   dex.js                                                                     │
│   - /usr/local/share/.config/yarn/global/node_modules/knex/lib/knex-builde   │
│   r/internal/config-resolver.js                                              │
│   - /usr/local/share/.config/yarn/global/node_modules/knex/lib/knex-builde   │
│   r/Knex.js                                                                  │
│   - /usr/local/share/.config/yarn/global/node_modules/knex/lib/index.js      │
│   - /usr/local/share/.config/yarn/global/node_modules/knex/knex.js           │
│   - /usr/local/share/.config/yarn/global/node_modules/@strapi/database/dis   │
│   t/index.js                                                                 │
│   - /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/   │
│   Strapi.js                                                                  │
│   - /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/   │
│   commands/actions/admin/create-user/action.js                               │
│   - /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/   │
│   commands/actions/admin/create-user/command.js                              │
│   - /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/   │
│   commands/index.js                                                          │
│   - /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/dist/   │
│   cli.js                                                                     │
│   - /usr/local/share/.config/yarn/global/node_modules/@strapi/strapi/bin/s   │
│   trapi.js                                                                   │
│   at Client_PG.initializeDriver (/usr/local/share/.config/yarn/global/node   │
│   _modules/knex/lib/client.js:202:13)                                        │
│   at new Client (/usr/local/share/.config/yarn/global/node_modules/knex/li   │
│   b/client.js:83:12)                                                         │
│   at new Client_PG (/usr/local/share/.config/yarn/global/node_modules/knex   │
│   /lib/dialects/postgres/index.js:21:5)                                      │
│   at Object.knex [as default] (/usr/local/share/.config/yarn/global/node_m   │
│   odules/knex/lib/knex-builder/Knex.js:16:28)                                │
│   at createConnection (/usr/local/share/.config/yarn/global/node_modules/@   │
│   strapi/database/dist/index.js:5999:31)                                     │
│   at new Database (/usr/local/share/.config/yarn/global/node_modules/@stra   │
│   pi/database/dist/index.js:6116:23)                                         │
│   at Database.init (/usr/local/share/.config/yarn/global/node_modules/@str   │
│   api/database/dist/index.js:6100:16)                                        │
│   at Strapi.bootstrap (/usr/local/share/.config/yarn/global/node_modules/@   │
│   strapi/strapi/dist/Strapi.js:371:39)                                       │
│   at Strapi.load (/usr/local/share/.config/yarn/global/node_modules/@strap   │
│   i/strapi/dist/Strapi.js:425:16)                                            │
│   at async Object.develop (/usr/local/share/.config/yarn/global/node_modul   │
│   es/@strapi/admin/dist/_chunks/index-ffd2f664.js:1245:28)                   │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

Application Configuration

screencapture-tn-hometopf-de-ui-apps-available-TRUECHARTS-stable-strapi-install-2024-01-28-23_43_08

Describe the bug

npm isn't able to install pg

Knex: run
$ npm install pg --save
Cannot find module 'pg'

To Reproduce

  1. install app
  2. wait
  3. app fails

Expected Behavior

  1. install app
  2. wait
  3. use app

Screenshots

N/A

Additional Context

# k3s kubectl get all -n ix-strapi  

NAME                                              READY   STATUS             RESTARTS      AGE
pod/strapi-cnpg-main-pooler-rw-6f67748775-wx8wg   1/1     Running            0             5m17s
pod/strapi-cnpg-main-1                            1/1     Running            0             4m53s
pod/strapi-857d964bc9-p58gj                       0/1     CrashLoopBackOff   4 (60s ago)   5m18s

NAME                                 TYPE           CLUSTER-IP       EXTERNAL-IP       PORT(S)    AGE
service/strapi-cnpg-main-r           ClusterIP      172.17.81.199    <none>            5432/TCP   5m18s
service/strapi-cnpg-main-ro          ClusterIP      172.17.168.240   <none>            5432/TCP   5m18s
service/strapi-cnpg-main-rw          ClusterIP      172.17.117.176   <none>            5432/TCP   5m18s
service/strapi-cnpg-main-pooler-rw   ClusterIP      172.17.205.39    <none>            5432/TCP   5m17s
service/strapi                       LoadBalancer   172.17.174.162   192.168.178.111   1337/TCP   5m18s

NAME                                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/strapi                       0/1     1            0           5m18s
deployment.apps/strapi-cnpg-main-pooler-rw   1/1     1            1           5m17s

NAME                                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/strapi-857d964bc9                       1         1         0       5m18s
replicaset.apps/strapi-cnpg-main-pooler-rw-6f67748775   1         1         1       5m17s

I've read and agree with the following

  • [X] I've checked all open and closed issues and my issue is not there.

YoMamasNerd avatar Jan 28 '24 22:01 YoMamasNerd