[GH-ISSUE #2197] /usr/local/bin/koel-init: line 12: OPTIMIZE_CONFIG: command not found #1117

Open
opened 2026-02-26 02:35:18 +03:00 by kerem · 1 comment
Owner

Originally created by @Anduin2017 on GitHub (Jan 15, 2026).
Original GitHub issue: https://github.com/koel/koel/issues/2197

The error is caused by the use of backticks (`) inside a double-quoted string in the koel-init script, which Bash interprets as a command execution.

Image
anduin@proart:~$ sudo docker logs -f c88ba9060c3d
/usr/local/bin/koel-init: line 12: OPTIMIZE_CONFIG: command not found
Config not optimized. You can optimize the config with . Note that this will prevent config modifications from being applied until the container is restarted.
Running installer...

                                                                                
                           KOEL INSTALLATION WIZARD.                            
                                                                                

   INFO  Remember, you can always install/upgrade manually using the guide at https://docs.koel.dev.  

   INFO  Running in no-interaction mode.  

  Clearing caches ............................................... 32.06ms DONE
  .env file exists -- skipping .......................................... DONE
  Retrieving app key ............................................. 0.00ms DONE
  Using app key: base64:BZBiWJjpz.. ..................................... DONE
  Migrating database ............................................. 1.76ms DONE
  Data already seeded -- skipping ....................................... DONE
  manifest.json already exists -- skipping .............................. DONE
  manifest-remote.json already exists -- skipping ....................... DONE

   ERROR  Oops! Koel installation or upgrade didn't finish successfully.  

   ERROR  Please check the error log at storage/logs/laravel.log and try again.  

   ERROR  For further troubleshooting, visit https://docs.koel.dev/troubleshooting.  

   ERROR  😥 Sorry for this. You deserve better.  

anduin@proart:~$ 


Since OPTIMIZE_CONFIG is not a command, it crashes.

Issue Template (English)

Title:
Bug: Syntax error in koel-init script causes "OPTIMIZE_CONFIG: command not found"

Description:
I encountered an error when starting the Koel container. The koel-init script fails at line 12 because it attempts to execute OPTIMIZE_CONFIG as a command due to unescaped backticks inside a double-quoted string.

Steps to Reproduce:

  1. Run the koel docker image with OPTIMIZE_CONFIG unset (default behavior).
  2. Observe the logs during container startup.

Observed Log Output:

/usr/local/bin/koel-init: line 12: OPTIMIZE_CONFIG: command not found
Config not optimized. You can optimize the config with . Note that this will prevent config modifications from being applied until the container is restarted.

Root Cause:
In koel-init line 12:

echo "Config not optimized. You can optimize the config with `OPTIMIZE_CONFIG`. Note that this will prevent config modifications from being applied until the container is restarted."

The backticks around OPTIMIZE_CONFIG cause Bash to try and execute it as a command. Since the variable is empty (which is why we are in this if block) or simply not a command, it throws an error.

Suggested Fix:
Escape the backticks or use single quotes for that part of the string.

# Fix example:
echo "Config not optimized. You can optimize the config with 'OPTIMIZE_CONFIG'. Note that this will prevent config modifications from being applied until the container is restarted."

Environment:

  • Image: phanan/koel:latest (or koel/koel:latest)
  • OS: Linux
Originally created by @Anduin2017 on GitHub (Jan 15, 2026). Original GitHub issue: https://github.com/koel/koel/issues/2197 The error is caused by the use of backticks (\`) inside a double-quoted string in the `koel-init` script, which Bash interprets as a command execution. <img width="2225" height="984" alt="Image" src="https://github.com/user-attachments/assets/e8bd051b-3ebf-4b0e-815a-698b7c5dc85d" /> ```bash anduin@proart:~$ sudo docker logs -f c88ba9060c3d /usr/local/bin/koel-init: line 12: OPTIMIZE_CONFIG: command not found Config not optimized. You can optimize the config with . Note that this will prevent config modifications from being applied until the container is restarted. Running installer... KOEL INSTALLATION WIZARD. INFO Remember, you can always install/upgrade manually using the guide at https://docs.koel.dev. INFO Running in no-interaction mode. Clearing caches ............................................... 32.06ms DONE .env file exists -- skipping .......................................... DONE Retrieving app key ............................................. 0.00ms DONE Using app key: base64:BZBiWJjpz.. ..................................... DONE Migrating database ............................................. 1.76ms DONE Data already seeded -- skipping ....................................... DONE manifest.json already exists -- skipping .............................. DONE manifest-remote.json already exists -- skipping ....................... DONE ERROR Oops! Koel installation or upgrade didn't finish successfully. ERROR Please check the error log at storage/logs/laravel.log and try again. ERROR For further troubleshooting, visit https://docs.koel.dev/troubleshooting. ERROR 😥 Sorry for this. You deserve better. anduin@proart:~$ ``` Since `OPTIMIZE_CONFIG` is not a command, it crashes. ### Issue Template (English) **Title:** Bug: Syntax error in `koel-init` script causes "OPTIMIZE_CONFIG: command not found" **Description:** I encountered an error when starting the Koel container. The `koel-init` script fails at line 12 because it attempts to execute `OPTIMIZE_CONFIG` as a command due to unescaped backticks inside a double-quoted string. **Steps to Reproduce:** 1. Run the `koel` docker image with `OPTIMIZE_CONFIG` unset (default behavior). 2. Observe the logs during container startup. **Observed Log Output:** ``` /usr/local/bin/koel-init: line 12: OPTIMIZE_CONFIG: command not found Config not optimized. You can optimize the config with . Note that this will prevent config modifications from being applied until the container is restarted. ``` **Root Cause:** In [`koel-init` line 12](https://github.com/koel/docker/blob/master/koel-init#L12): ```bash echo "Config not optimized. You can optimize the config with `OPTIMIZE_CONFIG`. Note that this will prevent config modifications from being applied until the container is restarted." ``` The backticks around `OPTIMIZE_CONFIG` cause Bash to try and execute it as a command. Since the variable is empty (which is why we are in this `if` block) or simply not a command, it throws an error. **Suggested Fix:** Escape the backticks or use single quotes for that part of the string. ```bash # Fix example: echo "Config not optimized. You can optimize the config with 'OPTIMIZE_CONFIG'. Note that this will prevent config modifications from being applied until the container is restarted." ``` **Environment:** - Image: `phanan/koel:latest` (or `koel/koel:latest`) - OS: Linux
Author
Owner

@Goumboul commented on GitHub (Jan 17, 2026):

Thanks for the detailed investigation!
I'll submit a PR to fix the shell quoting issue in koel-init.

<!-- gh-comment-id:3763984342 --> @Goumboul commented on GitHub (Jan 17, 2026): Thanks for the detailed investigation! I'll submit a PR to fix the shell quoting issue in `koel-init`.
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#1117
No description provided.