Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping: WARN Cannot connect to the database. Let's set it up. #178

Closed
viasux opened this issue Mar 13, 2023 · 3 comments
Closed

Looping: WARN Cannot connect to the database. Let's set it up. #178

viasux opened this issue Mar 13, 2023 · 3 comments

Comments

@viasux
Copy link

viasux commented Mar 13, 2023

I keep getting the error, "WARN Cannot connect to the database. Let's set it up."

relevant output from docker ps:

8351417fe0ad   phanan/koel                       "koel-entrypoint apa…"   18 minutes ago   Up 18 minutes (healthy)             80/tcp, 0.0.0.0:87->87/tcp, :::87->87/tcp                               docker_koel_1
b154ac65a56f   postgres:13                       "docker-entrypoint.s…"   18 minutes ago   Up 18 minutes                       5432/tcp                                                                docker_database_1

docker exec --user www-data -it docker_koel_1 bash
www-data@:~/html$ php artisan koel:init --no-assets:

Your DB driver of choice [MySQL/MariaDB]:
  [mysql     ] MySQL/MariaDB
  [pgsql     ] PostgreSQL
  [sqlsrv    ] SQL Server
  [sqlite-e2e] SQLite
 > pgsql

 DB host:
 > docker_database_1

 DB port (leave empty for default):
 > (tried 5432, 87:87 (what was in compose), and default)

 DB name:
 > koel

 DB user:
 > koel

 DB password:
 > password from compose

   WARN  Cannot connect to the database. Let's set it up.  

docker compose:

services:
  koel:
    image: phanan/koel
    depends_on:
      - database
    ports:
      - 87:87
    environment:
      - DB_CONNECTION=pgsql
      - DB_HOST=database
      - DB_USERNAME=koel
      - DB_PASSWORD=password
      - DB_DATABASE=koel
    volumes:
      - music:/music
      - covers:/var/www/html/public/img/covers
      - search_index:/var/www/html/storage/search-indexes

  database:
    image: postgres:13
    volumes:
      - db:/var/lib/postgresql/data'
    environment:
      - POSTGRES_DB=koel
      - POSTGRES_USER=koel
      - POSTGRES_PASSWORD=password (same as before, not sure if this was supposed to be a different password?)
@viasux
Copy link
Author

viasux commented Mar 13, 2023

possibly related to #168

@viasux
Copy link
Author

viasux commented Mar 13, 2023

even with the updated docker-compose, the issue persists:

version: '3'

services:
  koel:
    image: phanan/koel
    depends_on:
      - database
    ports:
      - 87:87
    environment:
      - DB_PORT=5432
      - DB_CONNECTION=pgsql
      - DB_HOST=database
      - DB_USERNAME=koel
      - DB_PASSWORD=password
      - DB_DATABASE=koel
    volumes:
      - music:/music
      - covers:/var/www/html/public/img/covers
      - search_index:/var/www/html/storage/search-indexes

  database:
    image: postgres:13
    volumes:
      - db:/var/lib/postgresql/data'
    environment:
      - POSTGRES_DB=koel
      - POSTGRES_USER=koel
      - POSTGRES_PASSWORD=password
volumes:
  db:
    driver: local
  music:
    driver: local
  covers:
    driver: local
  search_index:
    driver: local

@viasux
Copy link
Author

viasux commented Mar 14, 2023

the issue was using docker-compose instead of docker compose

@viasux viasux closed this as completed Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant