Trouble setting up Strapi v4 project

Hello there i’m having trouble setting up two different Strapi v4 projects.

The deployment ist successfull but the app does not start properly (502).

The logs say: “Server wasn’t able to start properly”

When starting the project through ssh (yarn start) it start’s as expected (so probably no DB issues as strapi wouldn’t start up if not able to connect to the db).

Any ideas?

Appreciate any help!

@anish @amiedema

Sorry to ping you both. I got used to your fast replies so that i am now unsure whether or not my post is stuck in oblivion.

Could you maybe have a look into this or at least tell me my post will be looked into?

Appreciate your work :pray:

Hello @sebbler,

We are really sorry for missing it.

We’ll look into the issue and get back to you as soon as possible.

Hello @sebbler ,

We are continuing to investigate ways to assist you with this issue and noticed some errors while running pm2 log {{ deploymentWorkflowName }}.

The error message mentions Unknown dialect undefined. To help you better understand the issue, we have included a link to the error log below:

We hope the error log will provide you with the necessary information to debug the issue. Please don’t hesitate to reach out if there is anything else we can do to assist you.

Hello @sebbler,

Googling the error code does show quite a few suggestions around updating the Strapi DB config. Here are a few links if they can be of any help to you:

Please let us know, if you continue to run into issues setting up your Strapi applications.

Thank you for your help! Appreciate your effort!

I wonder why cleavr shows some different logs than what I get with pm2 log. In the past hardly found the pm2 logs inside cleavr useful as it seems to hide things.

I am probably doing something wrong, am I?

Thanks again for helping me out!

Oh i can see this was already pointed out by some other user already:

Maybe push priority on this one then :stuck_out_tongue:

Anyway! Thanks for lending me a hand!

So I found the error which was caused by the project not being loaded correctly. In the cleavr.runner.js you are loading the project with this:

const strapi = require("@strapi/strapi");

but as typescript is being compiled and the full source code is inside the dist folder you would need to load it by using:

const strapi = require("@strapi/strapi");
strapi({ distDir: "./dist" }).start();

A switch when setting up a strapi project inside cleavr for “Project uses Typescript” would be a great addition.

Otherwise for anyone else coming across this issue:
Just create a server.js in your project root with the above and point your pm2 config to it:

script: "server.js",

Thanks again for the help!

Hello @sebbler ,

We really appreciate you bringing the issue to our attention and providing detailed feedback. We’ve had a discussion about the issue and we’ve come up with a couple of solutions. We’ll be working on implementing them soon.

1 Like