Search code examples
mongodbflutterdebuggingserverstrapi

Strapi : debug ⛔️ Server wasn't able to start properly


Please fix my problem.

It works when I try more than 50 times. Now it does not work I try 100+ times.

I start this -> strapi new server

� Starting to create your Strapi application.

? Choose your installation type Custom (manual settings)
? Choose your main database: MongoDB
? Database name: server
? Host: @cluster0-8tfpd.mongodb.net
? +srv connection: true
? Port (It will be ignored if you enable +srv): 27017
? Username: deep
? Password: *******
? Authentication database (Maybe "admin" or blank):
? Enable SSL connection: true

⏳ Testing database connection...
It might take a minute, please have a coffee ☕️

The app has been connected to the database successfully!

�  Application generation:
√ Copy dashboard
√ Install plugin settings-manager.
√ Install plugin content-type-builder.
√ Install plugin content-manager.
√ Install plugin users-permissions.
√ Install plugin email.
√ Install plugin upload.
√ Link strapi dependency to the project.

� Your new application server is ready at E:\Dev. Project\Flutter\flutter_ecommerce\server.

⚡️ Change directory:
$ cd server

⚡️ Start application:
$ strapi start  

But problem is -> strapi start

[2019-06-15T09:34:30.604Z] debug ⛔️ Server wasn't able to start properly. [2019-06-15T09:34:30.609Z] error Make sure your MongoDB database is running...


Solution

  • If you face this error while working with docker, Adding --network=host solves this problem. Keep in mind, use this solution only locally.

    As described by docker itself,

    --network="host" gives the container full access to local system services such as D-bus and is therefore considered insecure.