OpenCSPM / opencspm

Open Cloud Security Posture Management Engine
MIT License
333 stars 69 forks source link

(FATAL: database "opencspm_production" does not exist) when i try do sign in on localhost home page #185

Closed VinniMarcon closed 3 years ago

VinniMarcon commented 3 years ago

Describe the bug After I normally install OpenCSPM with Docker and start it, I accessed the localhost home page, and when I press the "Demo Admin Sign in" button, the following error occurs, apparently related to a missing database::

core_1    | I, [2021-08-05T16:35:44.043332 #9]  INFO -- : [0643ecde-651b-42bc-88c6-70f36762c02b] method=GET path=/api/sessions format=html controller=Api::SessionsController action=index status=401 duration=1.45 view=0.27
db_1      | 2021-08-05 16:35:46.194 UTC [564] FATAL:  database "opencspm_production" does not exist
core_1    | I, [2021-08-05T16:35:46.196979 #9]  INFO -- : [30b83d46-c50b-4d9a-b432-1dfc9fe55ba0] method=POST path=/api/sessions format=html controller=Api::SessionsController action=create status=500 error='ActiveRecord::NoDatabaseError: FATAL:  database "opencspm_production" does not exist
core_1    | ' duration=318.39 view=0.00
core_1    | F, [2021-08-05T16:35:46.198896 #9] FATAL -- : [30b83d46-c50b-4d9a-b432-1dfc9fe55ba0]   
core_1    | [30b83d46-c50b-4d9a-b432-1dfc9fe55ba0] ActiveRecord::NoDatabaseError (FATAL:  database "opencspm_production" does not exist
core_1    | ):
core_1    | [30b83d46-c50b-4d9a-b432-1dfc9fe55ba0]   
core_1    | [30b83d46-c50b-4d9a-b432-1dfc9fe55ba0] app/controllers/api/sessions_controller.rb:16:in `create'

Also, when I click on the Google and GitHub auth buttons on the home page, it takes me to the Heroku website and shows me an Application Error, but I believe the two issues are related.

OpenCSPM version 0.1.23

Screenshots imagem imagem

Docker information (please complete the following information): 20.10.2 docker-compose: 1.26.0

joshlarsen commented 3 years ago

@VinniMarcon the initial database setup either didn't finish, or didn't run. Can you try to do a full restart of the stack?

docker-compose down -v

then

docker-compose up
VinniMarcon commented 3 years ago

@VinniMarcon the initial database setup either didn't finish, or didn't run. Can you try to do a full restart of the stack?

docker-compose down -v

then

docker-compose up

Thanks @joshlarsen, I was looking for a way to reset the entire process, but I was only finding ways to reinstall docker-compose, so I had ruled out that possibility.

your commands worked here, now the application is working correctly :D