- Strapi Version: 4.15.0
- Operating System: Linux 4.18.0-425.19.2.lve.el7h.x86_64
- Database: MariaDB
- Node Version: 18.16.1
- NPM Version: 9.5.1
- Yarn Version: -
After I manually deployed Strapi application in cPanel Shared Hosting with proper environment variables setup and PM2 setup, the application won’t show as it showed 503 error.
I checked PM2 logs, I got this error continuously:
0|app | [2023-10-31 03:12:18.372] debug: ⛔️ Server wasn't able to start properly. 0|app | [2023-10-31 03:12:18.375] error: Cannot destructure property 'client' of 'db.config.connection' as it is undefined. 0|app | TypeError: Cannot destructure property 'client' of 'db.config.connection' as it is undefined. 0|app | at getDialect (/home/u1572792/nodevenv/public_html/cms.mysite.com/18/lib/node_modules/@strapi/database/dist/index.js:1014:11) 0|app | at new Database (/home/u1572792/nodevenv/public_html/cms.mysite.com/18/lib/node_modules/@strapi/database/dist/index.js:6114:20) 0|app | at Database.init (/home/u1572792/nodevenv/public_html/cms.mysite.com/18/lib/node_modules/@strapi/database/dist/index.js:6100:16) 0|app | at Strapi.bootstrap (/home/u1572792/nodevenv/public_html/cms.mysite.com/18/lib/node_modules/@strapi/strapi/dist/Strapi.js:365:39) 0|app | at Strapi.load (/home/u1572792/nodevenv/public_html/cms.mysite.com/18/lib/node_modules/@strapi/strapi/dist/Strapi.js:419:16) 0|app | at async Strapi.start (/home/u1572792/nodevenv/public_html/cms.mysite.com/18/lib/node_modules/@strapi/strapi/dist/Strapi.js:213:9)
It’s only happened when I deployed to shared hosting, the Strapi app doesn’t show any problem when in local development. Is there way to fix them in cPanel shared hosting? I through it has problem with reading env parameter, but I checked the env params with process.env via node command and it showed correctly.
Anyway, I build them locally in my computer before I deploy them to shared hosting as I unable to build them in shared hosting due to limited resources (process terminated).