Strapi v4 server doesn't start up

Issues information

  • OS:
  • databases: PostgreSQL
  • Programming language and version: Strapi v4, Node 16
  • Link to your project on Github/Gitlab: Private

Your issue


I’m trying to deploy my Strapi v4 application and I followed all the steps outlined in here Hello World. Deploy your first application. | Qovery

But for some reason my server doesn’t start, it can’t connect to the database. Can you please help me to figure out what’s going on?

These are the error logs:

yarn run v1.22.19
22 Aug, 18:40:05.414
$ strapi start
22 Aug, 18:40:11.710
[2022-08-22 16:40:11.708] debug: ⛔️ Server wasn't able to start properly.
22 Aug, 18:40:11.711
[2022-08-22 16:40:11.710] error: connect ECONNREFUSED
22 Aug, 18:40:11.711
Error: connect ECONNREFUSED
22 Aug, 18:40:11.711
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1138:16)
22 Aug, 18:40:11.734
error Command failed with exit code 1.

Hi @mayrsascha, welcome and thanks for asking here.
From what I see, you must properly configure your application with your database on Qovery. You can follow this guide.

BTW, I’ve created a guide on how to deploy a Strapi V4 application with Terraform and Qovery as well.

And you can find a video here.

@rophilogene Thanks for your answers!

I went with the first option, since I am not that experienced with Terraform and want to keep my deployment complexity low.

Creating the database worked as intended, just had to create some aliases for the auto-generated environment variables to give my application access to the database, since it’s expecting the ENVs to be called a certain way.
BTW, the database password was NOT automatically set for my application, I had to add that ENV manually, just FYI. The database password is also automatically set, just as a secret variable instead of an environment variable, so I didn’t see it in the UI at first.