strapi-community/strapi-tool-dockerize

Server wasn’t able to start properly

mig-25 opened this issue · 3 comments

🐛 Bug Report

🤷‍♀️ What did you do

After shutting down the container, I try to run the local instance with yarn develop, this gives me the following error:

⛔️ Error log

[2023-04-15 19:10:11.705] debug: :no_entry: Server wasn’t able to start properly.
[2023-04-15 19:10:11.706] error: role “strapi” does not exist

🕵️‍♀️ Stack trace

Stack Trace

## 🙇‍♀️ Expected behavior/code

If I need to update the local strapi instance and rebuild the for example the package.json file and the do strapi build to rebuild the admin panel, to use a newer version of Strapi, I can't do it as I get the above error.

## 👩‍💻 Environment

- 📦 Node version: v18.15.0
- 💻 OS: macOS Ventura 13.3.1 (22E261)
Apple M1 Max, 64 GB

## 💡 Possible Solution

<!-- Only if you have suggestions on a fix for the bug -->

## 📺 Additional context/Screenshots

For the docker tool itself, I went through the interactive setup, using the following setup:
:popcorn: JavaScript project detected

:package: YARN detected

:heavy_check_mark: Do you want to create a docker-compose file? :whale: · No / Yes
:heavy_check_mark: What enviroments do you want to configure? · Both
:heavy_check_mark: What database do you want to use? · PostgreSQL
:heavy_check_mark: Database Host · localhost
:heavy_check_mark: Database Name · strapi
:heavy_check_mark: Database Username · strapi
:heavy_check_mark: Database Password · ******
:heavy_check_mark: Database Port · 5432
:whale: Added docker-compose file with POSTGRESQL configuration

:whale: Dockerfile for PRODUCTION added

:male_detective: Added Dockerize variables in .env file

:floppy_disk: Added POSTGRESQL configuration to database.js

:package: No old dependencies to clean up

:package: PostgreSQL dependencies installed with YARN

:point_up: Strapi is now dockerized :whale: - have a look at the logs above for more info. :rocket:

:star: Star the project on GitHub if you liked this tool :pray:.

Don't think this is a bug with the CLI, but but how are you setting the variables for your database.
If you are setting this to postgres etc.

I thought that my screen dump I supplied that I am choosing PostgreSQL when I have to choose database choice from the cli.
Or am I missing something else, I can try to change the setup variables to something else then the string strapi as I have done previously as I am always getting the error : ```
debug: ⛔ Server wasn’t able to start properly.
error: role “strapi” does not exist

each time I try to start the server locally after shutting down the container.

Remember there is a difference between running Postgres in a container and Strapi in a container and both.
If both are running then they will talk to each other over a docker network.
If you want to run postgres only in a container depending on your OS the DATABASE_HOST will be 0.0.0.0 or 127.0.0.1 or CONTAINERNAME