[GH-ISSUE #1294] Infinite loop with console commands in non-interactive mode #744

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

Originally created by @vitoyucepi on GitHub (Mar 26, 2021).
Original GitHub issue: https://github.com/koel/koel/issues/1294

Describe the bug
koel:init goes into infinite loop if called in non-interactive mode when some required parameters not set.
I checked only database related variables.

To reproduce
Steps to reproduce the behavior:

  1. Run php artisan koel:init --no-interaction --no-assets on clear install

Expected behavior
Fail with return non-zero return code.

Screenshots

Environment

  • Koel version: 5.0.2
  • OS: archlinux
  • Browser: Chrome 89
  • PHP version: 7.4.16
  • Node version: N/A (because 5.0.2 is already compiled)

Additional context

Originally created by @vitoyucepi on GitHub (Mar 26, 2021). Original GitHub issue: https://github.com/koel/koel/issues/1294 **Describe the bug** `koel:init` goes into infinite loop if called in non-interactive mode when some required parameters not set. I checked only database related variables. **To reproduce** Steps to reproduce the behavior: 1. Run `php artisan koel:init --no-interaction --no-assets` on clear install **Expected behavior** Fail with return non-zero return code. **Screenshots** **Environment** - Koel version: 5.0.2 - OS: archlinux - Browser: Chrome 89 - PHP version: 7.4.16 - Node version: N/A (because 5.0.2 is already compiled) **Additional context**
kerem closed this issue 2026-02-26 02:34:08 +03:00
Author
Owner

@phanan commented on GitHub (Mar 29, 2021):

What do you mean by "some required parameters not set"? What parameters are we looking at?

<!-- gh-comment-id:809463076 --> @phanan commented on GitHub (Mar 29, 2021): What do you mean by "some required parameters not set"? What parameters are we looking at?
Author
Owner

@vitoyucepi commented on GitHub (Mar 29, 2021):

Database related

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=koel
DB_USERNAME=koel
DB_PASSWORD=SoSecureMuchWow
<!-- gh-comment-id:809467996 --> @vitoyucepi commented on GitHub (Mar 29, 2021): Database related ``` DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=koel DB_USERNAME=koel DB_PASSWORD=SoSecureMuchWow ```
Author
Owner

@vitoyucepi commented on GitHub (Mar 29, 2021):

If I wouldn't set admin related variables

ADMIN_NAME=admin
ADMIN_EMAIL=admin@localhost
ADMIN_PASSWORD=123

then installation will fail with error

web_1      | Application key set successfully.
web_1      | Attempting to install or upgrade Koel.
web_1      | Remember, you can always install/upgrade manually following the guide here:
web_1      | 📙  https://docs.koel.dev
web_1      | 
web_1      | Running in no-interaction mode
web_1      | App key exists -- skipping
web_1      | Migrating database
web_1      | Let's create the admin account.
web_1      | Oops! Koel installation or upgrade didn't finish successfully.
web_1      | Please try again, or visit https://docs.koel.dev for manual installation.
web_1      | 😥 Sorry for this. You deserve better.
<!-- gh-comment-id:809510756 --> @vitoyucepi commented on GitHub (Mar 29, 2021): If I wouldn't set admin related variables ``` ADMIN_NAME=admin ADMIN_EMAIL=admin@localhost ADMIN_PASSWORD=123 ``` then installation will fail with error ``` web_1 | Application key set successfully. web_1 | Attempting to install or upgrade Koel. web_1 | Remember, you can always install/upgrade manually following the guide here: web_1 | 📙 https://docs.koel.dev web_1 | web_1 | Running in no-interaction mode web_1 | App key exists -- skipping web_1 | Migrating database web_1 | Let's create the admin account. web_1 | Oops! Koel installation or upgrade didn't finish successfully. web_1 | Please try again, or visit https://docs.koel.dev for manual installation. web_1 | 😥 Sorry for this. You deserve better. ```
Author
Owner

@MichaIng commented on GitHub (Apr 11, 2021):

Since the ADMIN_* settings have been removed with github.com/koel/koel@4432ad6c21, I don't think that the issue has to do with them. I initially as well made a wrong interpretation of an koel:init call failure, as it currently seems to error out on every database access one time, while repeating it reaches one step further: https://github.com/koel/koel/issues/1298#issuecomment-816872063

Wile facing that the first time, I though the pre-defined media directory was the issue, and removing it from the .env and re-running koel:init succeeded. But actually the .env setting was not relevant, but repeating koel:init alone brought the success. Probably in your case it's the same.

<!-- gh-comment-id:817325743 --> @MichaIng commented on GitHub (Apr 11, 2021): Since the `ADMIN_*` settings have been removed with https://github.com/koel/koel/commit/4432ad6c215500d6d808650fbeb542e69b14da4f, I don't think that the issue has to do with them. I initially as well made a wrong interpretation of an `koel:init` call failure, as it currently seems to error out on every database access one time, while repeating it reaches one step further: https://github.com/koel/koel/issues/1298#issuecomment-816872063 Wile facing that the first time, I though the pre-defined media directory was the issue, and removing it from the .env and re-running `koel:init` succeeded. But actually the .env setting was not relevant, but repeating `koel:init` alone brought the success. Probably in your case it's the same.
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#744
No description provided.