[GH-ISSUE #1412] Unable to setup docker container with postgres #809

Closed
opened 2026-02-26 02:34:20 +03:00 by kerem · 4 comments
Owner

Originally created by @xeruf on GitHub (Jan 21, 2022).
Original GitHub issue: https://github.com/koel/koel/issues/1412

Describe the bug
Trying to run the docker container with postgres, I get an error upon initialization as mentioned in https://github.com/koel/docker/issues/117:

To reproduce

❯ sudo docker-compose -f ./docker-compose.postgres.yml up -d
Starting koel_database_1 ... done
Starting koel_koel_1     ... done
❯ sudo docker ps
CONTAINER ID   IMAGE         COMMAND                  CREATED             STATUS                    PORTS                                 NAMES
d762f1325c44   hyzual/koel   "koel-entrypoint apa…"   About an hour ago   Up 36 minutes (healthy)   0.0.0.0:380->80/tcp, :::380->80/tcp   koel_koel_1
912a728dd875   postgres:13   "docker-entrypoint.s…"   About an hour ago   Up 36 minutes             5432/tcp                              koel_database_1
❯ sudo docker exec --user www-data -it koel_koel_1 bash
www-data@d762f1325c44:~/html$ php artisan koel:init --no-assets
Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
📙  https://docs.koel.dev

App key exists -- skipping
Migrating database
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
😥 Sorry for this. You deserve better.

Corresponding output from the container log:

database_1  | 2022-01-17 17:39:37.068 UTC [116] ERROR:  cannot drop index artists_name_unique because constraint artists_name_unique on table artists requires it
database_1  | 2022-01-17 17:39:37.068 UTC [116] HINT:  You can drop constraint artists_name_unique on table artists instead.
database_1  | 2022-01-17 17:39:37.068 UTC [116] STATEMENT:  drop index "artists_name_unique"
database_1  | 2022-01-17 17:39:37.068 UTC [116] ERROR:  current transaction is aborted, commands ignored until end of transaction block
database_1  | 2022-01-17 17:39:37.068 UTC [116] STATEMENT:  DEALLOCATE pdo_stmt_00000008
Originally created by @xeruf on GitHub (Jan 21, 2022). Original GitHub issue: https://github.com/koel/koel/issues/1412 **Describe the bug** Trying to run the docker container with postgres, I get an error upon initialization as mentioned in https://github.com/koel/docker/issues/117: **To reproduce** ```sh ❯ sudo docker-compose -f ./docker-compose.postgres.yml up -d Starting koel_database_1 ... done Starting koel_koel_1 ... done ❯ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d762f1325c44 hyzual/koel "koel-entrypoint apa…" About an hour ago Up 36 minutes (healthy) 0.0.0.0:380->80/tcp, :::380->80/tcp koel_koel_1 912a728dd875 postgres:13 "docker-entrypoint.s…" About an hour ago Up 36 minutes 5432/tcp koel_database_1 ❯ sudo docker exec --user www-data -it koel_koel_1 bash www-data@d762f1325c44:~/html$ php artisan koel:init --no-assets Attempting to install or upgrade Koel. Remember, you can always install/upgrade manually following the guide here: 📙 https://docs.koel.dev App key exists -- skipping Migrating database Oops! Koel installation or upgrade didn't finish successfully. Please try again, or visit https://docs.koel.dev for manual installation. 😥 Sorry for this. You deserve better. ``` Corresponding output from the container log: ```sh database_1 | 2022-01-17 17:39:37.068 UTC [116] ERROR: cannot drop index artists_name_unique because constraint artists_name_unique on table artists requires it database_1 | 2022-01-17 17:39:37.068 UTC [116] HINT: You can drop constraint artists_name_unique on table artists instead. database_1 | 2022-01-17 17:39:37.068 UTC [116] STATEMENT: drop index "artists_name_unique" database_1 | 2022-01-17 17:39:37.068 UTC [116] ERROR: current transaction is aborted, commands ignored until end of transaction block database_1 | 2022-01-17 17:39:37.068 UTC [116] STATEMENT: DEALLOCATE pdo_stmt_00000008 ```
kerem closed this issue 2026-02-26 02:34:20 +03:00
Author
Owner

@xeruf commented on GitHub (Jan 21, 2022):

Same issue without docker:

❯ php artisan koel:init --no-assets -vvv
Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
📙  https://docs.koel.dev

Generating app key
Oops! Koel installation or upgrade didn't finish successfully.
Please try again, or visit https://docs.koel.dev for manual installation.
😥 Sorry for this. You deserve better.

Unfortunately verbosity did not yield any extra output.

Error only occurs when using postgres as far as I am aware.

<!-- gh-comment-id:1018493667 --> @xeruf commented on GitHub (Jan 21, 2022): Same issue without docker: ```sh ❯ php artisan koel:init --no-assets -vvv Attempting to install or upgrade Koel. Remember, you can always install/upgrade manually following the guide here: 📙 https://docs.koel.dev Generating app key Oops! Koel installation or upgrade didn't finish successfully. Please try again, or visit https://docs.koel.dev for manual installation. 😥 Sorry for this. You deserve better. ``` Unfortunately verbosity did not yield any extra output. Error only occurs when using postgres as far as I am aware.
Author
Owner

@xeruf commented on GitHub (Mar 14, 2022):

Confirmed again - postgres did not work, mysql did

<!-- gh-comment-id:1067333266 --> @xeruf commented on GitHub (Mar 14, 2022): Confirmed again - postgres did not work, mysql did
Author
Owner

@Phat-Loc commented on GitHub (Mar 22, 2022):

I have fix in https://github.com/koel/koel/issues/1435
I modify the migration file to $table->dropUnique('artists_name_unique'); then ran php artisan koel:init --no-assets. That worked for me.

<!-- gh-comment-id:1074721753 --> @Phat-Loc commented on GitHub (Mar 22, 2022): I have fix in https://github.com/koel/koel/issues/1435 I modify the migration file to `$table->dropUnique('artists_name_unique'); ` then ran `php artisan koel:init --no-assets`. That worked for me.
Author
Owner

@phanan commented on GitHub (Apr 13, 2022):

Fixed in c4e0a0534e.

<!-- gh-comment-id:1097909437 --> @phanan commented on GitHub (Apr 13, 2022): Fixed in c4e0a0534ef64dba8e1f9815ee69deabd4e5f720.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#809
No description provided.