[GH-ISSUE #1304] koel:init exits after two successful setup steps #753

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

Originally created by @MichaIng on GitHub (Apr 11, 2021).
Original GitHub issue: https://github.com/koel/koel/issues/1304

Describe the bug
When running koel:init, after the two setup steps "Migrating database" and "Seeding initial data", it exits with the following error message:

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

Repeating koel:init or checking the database shows that the previous step has actually succeeded, so that the setup goes one step further, before exiting with the same error. Repeating koel:init all together three times, allows it to succeed. A minor additional issue is that PHP does not return an error code when exiting that way.

To reproduce
Steps to reproduce the behavior:

  1. Tested on Debian Stretch, Buster and Bullseye with default PHP and MariaDB versions shipped by the distros APT repository, except Stretch, where https://packages.sury.org/php/pool/main/p/php7.3/ is used.
  2. Download and extract https://github.com/koel/koel/releases/download/v5.1.0/koel-v5.1.0.tar.gz
  3. cd koel && composer install
  4. Create MariaDB database + edit .env with database info + credentials
  5. Optional: Set MEDIA_PATH and add -n below.
  6. php artisan koel:init --no-assets

Expected behavior
The setup should succeed, either with interactive media directory input or unattended when MEDIA_PATH was set.

Screenshots

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

Running in no-interaction mode
Generating app key
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.
# php artisan koel:init -n --no-assets
Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
📙  https://docs.koel.dev

Running in no-interaction mode
App key exists -- skipping
Migrating database
Creating default admin account
Seeding initial data
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.
# php artisan koel:init -n --no-assets
Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
📙  https://docs.koel.dev

Running in no-interaction mode
App key exists -- skipping
Migrating database
Data seeded -- skipping

🎆  Success! Koel can now be run from localhost with `php artisan serve`.
You can also scan for media with `php artisan koel:sync`.
Again, visit 📙 https://docs.koel.dev for the official documentation.
Feeling generous and want to support Koel's development? Check out https://github.com/users/phanan/sponsorship 🤗
Thanks for using Koel. You rock! 🤘

Environment

  • Koel version v5.1.0
  • OS: Debian Stretch or Buster or Bullseye
  • Browser not relevant
  • PHP version v7.3.27 or 7.4.15
  • Node version not relevant, the pre-compiled install archive is used

Additional context
The used UNIX user doesn't play a rule. While above was done as root, the issue was recognised first when running it as an unprivileged service user, while R/W permissions were of course assured. Also it has been tested with MariaDB UNIX socket and TCP-based connection, which doesn't make a difference.

Originally created by @MichaIng on GitHub (Apr 11, 2021). Original GitHub issue: https://github.com/koel/koel/issues/1304 **Describe the bug** When running `koel:init`, after the two setup steps "Migrating database" and "Seeding initial data", it exits with the following error message: ``` Oops! Koel installation or upgrade didn't finish successfully. ``` Repeating `koel:init` or checking the database shows that the previous step has actually succeeded, so that the setup goes one step further, before exiting with the same error. Repeating `koel:init` all together three times, allows it to succeed. A minor additional issue is that PHP does not return an error code when exiting that way. **To reproduce** Steps to reproduce the behavior: 1. Tested on Debian Stretch, Buster and Bullseye with default PHP and MariaDB versions shipped by the distros APT repository, except Stretch, where https://packages.sury.org/php/pool/main/p/php7.3/ is used. 2. Download and extract https://github.com/koel/koel/releases/download/v5.1.0/koel-v5.1.0.tar.gz 3. `cd koel && composer install` 4. Create MariaDB database + edit `.env` with database info + credentials 5. _Optional: Set `MEDIA_PATH` and add `-n` below._ 6. `php artisan koel:init --no-assets` **Expected behavior** The setup should succeed, either with interactive media directory input or unattended when `MEDIA_PATH` was set. **Screenshots** ``` # php artisan koel:init -n --no-assets Attempting to install or upgrade Koel. Remember, you can always install/upgrade manually following the guide here: 📙 https://docs.koel.dev Running in no-interaction mode Generating app key 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. # php artisan koel:init -n --no-assets Attempting to install or upgrade Koel. Remember, you can always install/upgrade manually following the guide here: 📙 https://docs.koel.dev Running in no-interaction mode App key exists -- skipping Migrating database Creating default admin account Seeding initial data 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. # php artisan koel:init -n --no-assets Attempting to install or upgrade Koel. Remember, you can always install/upgrade manually following the guide here: 📙 https://docs.koel.dev Running in no-interaction mode App key exists -- skipping Migrating database Data seeded -- skipping 🎆 Success! Koel can now be run from localhost with `php artisan serve`. You can also scan for media with `php artisan koel:sync`. Again, visit 📙 https://docs.koel.dev for the official documentation. Feeling generous and want to support Koel's development? Check out https://github.com/users/phanan/sponsorship 🤗 Thanks for using Koel. You rock! 🤘 ``` **Environment** - Koel version **v5.1.0** - OS: **Debian Stretch or Buster or Bullseye** - Browser **not relevant** - PHP version **v7.3.27 or 7.4.15** - Node version **not relevant, the pre-compiled install archive is used** **Additional context** The used UNIX user doesn't play a rule. While above was done as `root`, the issue was recognised first when running it as an unprivileged service user, while R/W permissions were of course assured. Also it has been tested with MariaDB UNIX socket and TCP-based connection, which doesn't make a difference.
kerem closed this issue 2026-02-26 02:34:10 +03:00
Author
Owner

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

I want to live

Den sön 11 apr. 2021 21:36MichaIng @.***> skrev:

Describe the bug
When running koel:init, after the two setup steps "Migrating database"
and "Seeding initial data", it exits with the following error message:

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

Repeating koel:init or checking the database shows that the previous step
has actually succeeded, so that the setup goes one step further, before
exiting with the same error. Repeating koel:init all together three
times, allows it to succeed. A minor additional issue is that PHP does not
return an error code when exiting that way.

To reproduce
Steps to reproduce the behavior:

  1. Tested on Debian Stretch, Buster and Bullseye with default PHP and
    MariaDB versions shipped by the distros APT repository, except Stretch,
    where https://packages.sury.org/php/pool/main/p/php7.3/ is used.
  2. Download and extract
    https://github.com/koel/koel/releases/download/v5.1.0/koel-v5.1.0.tar.gz
  3. cd koel && composer install
  4. Create MariaDB database + edit .env with database info + credentials
  5. Optional: Set MEDIA_PATH and add -n below.
  6. php artisan koel:init --no-assets

Expected behavior
The setup should succeed, either with interactive media directory input or
unattended when MEDIA_PATH was set.

Screenshots

php artisan koel:init -n --no-assets

Attempting to install or upgrade Koel.

Remember, you can always install/upgrade manually following the guide here:

📙 https://docs.koel.dev

Running in no-interaction mode

Generating app key

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.

php artisan koel:init -n --no-assets

Attempting to install or upgrade Koel.

Remember, you can always install/upgrade manually following the guide here:

📙 https://docs.koel.dev

Running in no-interaction mode

App key exists -- skipping

Migrating database

Creating default admin account

Seeding initial data

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.

php artisan koel:init -n --no-assets

Attempting to install or upgrade Koel.

Remember, you can always install/upgrade manually following the guide here:

📙 https://docs.koel.dev

Running in no-interaction mode

App key exists -- skipping

Migrating database

Data seeded -- skipping

🎆 Success! Koel can now be run from localhost with php artisan serve.

You can also scan for media with php artisan koel:sync.

Again, visit 📙 https://docs.koel.dev for the official documentation.

Feeling generous and want to support Koel's development? Check out https://github.com/users/phanan/sponsorship 🤗

Thanks for using Koel. You rock! 🤘

Environment

  • Koel version v5.1.0
  • OS: Debian Stretch or Buster or Bullseye
  • Browser not relevant
  • PHP version v7.3.27 or 7.4.15
  • Node version not relevant, the pre-compiled install archive is used

Additional context
The used UNIX user doesn't play a rule. While above was done as root, the
issue was recognised first when running it as an unprivileged service user,
while R/W permissions were of course assured. Also it has been tested with
MariaDB UNIX socket and TCP-based connection, which doesn't make a
difference.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/koel/koel/issues/1304, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AF4SOT3TTOLYOBC745WHQM3TIH22FANCNFSM42X7Y7MQ
.

<!-- gh-comment-id:817379661 --> @Christoffaer commented on GitHub (Apr 11, 2021): I want to live Den sön 11 apr. 2021 21:36MichaIng ***@***.***> skrev: > *Describe the bug* > When running koel:init, after the two setup steps "Migrating database" > and "Seeding initial data", it exits with the following error message: > > Oops! Koel installation or upgrade didn't finish successfully. > > > Repeating koel:init or checking the database shows that the previous step > has actually succeeded, so that the setup goes one step further, before > exiting with the same error. Repeating koel:init all together three > times, allows it to succeed. A minor additional issue is that PHP does not > return an error code when exiting that way. > > *To reproduce* > Steps to reproduce the behavior: > > 1. Tested on Debian Stretch, Buster and Bullseye with default PHP and > MariaDB versions shipped by the distros APT repository, except Stretch, > where https://packages.sury.org/php/pool/main/p/php7.3/ is used. > 2. Download and extract > https://github.com/koel/koel/releases/download/v5.1.0/koel-v5.1.0.tar.gz > 3. cd koel && composer install > 4. Create MariaDB database + edit .env with database info + credentials > 5. *Optional: Set MEDIA_PATH and add -n below.* > 6. php artisan koel:init --no-assets > > *Expected behavior* > The setup should succeed, either with interactive media directory input or > unattended when MEDIA_PATH was set. > > *Screenshots* > > # php artisan koel:init -n --no-assets > > Attempting to install or upgrade Koel. > > Remember, you can always install/upgrade manually following the guide here: > > 📙 https://docs.koel.dev > > > > Running in no-interaction mode > > Generating app key > > 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. > > # php artisan koel:init -n --no-assets > > Attempting to install or upgrade Koel. > > Remember, you can always install/upgrade manually following the guide here: > > 📙 https://docs.koel.dev > > > > Running in no-interaction mode > > App key exists -- skipping > > Migrating database > > Creating default admin account > > Seeding initial data > > 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. > > # php artisan koel:init -n --no-assets > > Attempting to install or upgrade Koel. > > Remember, you can always install/upgrade manually following the guide here: > > 📙 https://docs.koel.dev > > > > Running in no-interaction mode > > App key exists -- skipping > > Migrating database > > Data seeded -- skipping > > > > 🎆 Success! Koel can now be run from localhost with `php artisan serve`. > > You can also scan for media with `php artisan koel:sync`. > > Again, visit 📙 https://docs.koel.dev for the official documentation. > > Feeling generous and want to support Koel's development? Check out https://github.com/users/phanan/sponsorship 🤗 > > Thanks for using Koel. You rock! 🤘 > > > *Environment* > > - Koel version *v5.1.0* > - OS: *Debian Stretch or Buster or Bullseye* > - Browser *not relevant* > - PHP version *v7.3.27 or 7.4.15* > - Node version *not relevant, the pre-compiled install archive is used* > > *Additional context* > The used UNIX user doesn't play a rule. While above was done as root, the > issue was recognised first when running it as an unprivileged service user, > while R/W permissions were of course assured. Also it has been tested with > MariaDB UNIX socket and TCP-based connection, which doesn't make a > difference. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/koel/koel/issues/1304>, or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AF4SOT3TTOLYOBC745WHQM3TIH22FANCNFSM42X7Y7MQ> > . >
Author
Owner

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

Obviously migrateDatabase and maybeSeedDatabase are throwing errors, even when they succeed. So running the included commands manually with additional verbosity could help to debug the issue:

  • Running php artisan migrate --force -vvv manually
    • Here clearing the media cache could be as well responsible for the error?
  • Running php artisan db:seed --force -vvv manually

Another minor issue is that even when the init command exits with that error message, it does not return an error code to artisan => the console.
artisan catches a status code to exist with:
github.com/koel/koel@c9446c4adb/artisan (L33)
I'm no experienced PHP coder, but would return 1 or return (bool) false work here: github.com/koel/koel@c9446c4adb/app/Console/Commands/InitCommand.php (L77)


🈯 php artisan key:generate
🈯 php artisan config:clear
🈴 php artisan migrate --force -vvv

# php artisan migrate --force -vvv
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table (25.21ms)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table (47.66ms)
Migrating: 2015_11_23_074600_create_artists_table
Migrated:  2015_11_23_074600_create_artists_table (19.52ms)
Migrating: 2015_11_23_074709_create_albums_table
Migrated:  2015_11_23_074709_create_albums_table (48.79ms)
Migrating: 2015_11_23_074713_create_songs_table
Migrated:  2015_11_23_074713_create_songs_table (70.45ms)
Migrating: 2015_11_23_074723_create_playlists_table
Migrated:  2015_11_23_074723_create_playlists_table (50.34ms)
Migrating: 2015_11_23_074733_create_interactions_table
Migrated:  2015_11_23_074733_create_interactions_table (80.56ms)
Migrating: 2015_11_23_082854_create_playlist_song_table
Migrated:  2015_11_23_082854_create_playlist_song_table (79.38ms)
Migrating: 2015_11_25_033351_create_settings_table
Migrated:  2015_11_25_033351_create_settings_table (27.00ms)
Migrating: 2015_12_18_072523_add_preferences_to_users_table
Migrated:  2015_12_18_072523_add_preferences_to_users_table (27.18ms)
Migrating: 2015_12_22_092542_add_image_to_artists_table
Migrated:  2015_12_22_092542_add_image_to_artists_table (22.34ms)
Migrating: 2016_03_20_134512_add_track_into_songs
Migrated:  2016_03_20_134512_add_track_into_songs (21.58ms)
Migrating: 2016_04_15_121215_add_is_complilation_into_albums
Migrated:  2016_04_15_121215_add_is_complilation_into_albums (31.18ms)
Migrating: 2016_04_15_125237_add_contributing_artist_id_into_songs
Migrated:  2016_04_15_125237_add_contributing_artist_id_into_songs (56.84ms)
Migrating: 2016_04_16_082627_create_various_artists

   PDOException

  SQLSTATE[HY000] [14] unable to open database file

  at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178
    174▕         if (file_exists($this->config['storage'].$indexName)) {
    175▕             unlink($this->config['storage'].$indexName);
    176▕         }
    177▕
  ➜ 178▕         $this->index = new PDO('sqlite:'.$this->config['storage'].$indexName);
    179▕         $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    180▕
    181▕         if($this->config['wal']) {
    182▕             $this->index->exec("PRAGMA journal_mode=wal;");

  1   vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178
      PDO::__construct("sqlite:/tmp/koel/storage/search-indexes/artists.index")

  2   vendor/teamtnt/tntsearch/src/TNTSearch.php:68
      TeamTNT\TNTSearch\Indexer\TNTIndexer::createIndex("artists.index")

  3   vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:275
      TeamTNT\TNTSearch\TNTSearch::createIndex("artists.index")

  4   vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:52
      TeamTNT\Scout\Engines\TNTSearchEngine::initIndex(Object(App\Models\Artist))

  5   vendor/laravel/scout/src/Searchable.php:63
      TeamTNT\Scout\Engines\TNTSearchEngine::update(Object(Illuminate\Database\Eloquent\Collection))

  6   vendor/laravel/scout/src/Searchable.php:42
      App\Models\Artist::queueMakeSearchable(Object(Illuminate\Database\Eloquent\Collection))

  7   vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:114
      Illuminate\Database\Eloquent\Collection::Laravel\Scout\{closure}()

  8   vendor/laravel/scout/src/Searchable.php:154
      Illuminate\Support\Collection::__call("searchable", [])

  9   vendor/laravel/scout/src/ModelObserver.php:87
      App\Models\Artist::searchable()

  10  vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:412
      Laravel\Scout\ModelObserver::saved(Object(App\Models\Artist))

  11  vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:237
      Illuminate\Events\Dispatcher::Illuminate\Events\{closure}("eloquent.saved: App\Models\Artist")

  12  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:189
      Illuminate\Events\Dispatcher::dispatch("eloquent.saved: App\Models\Artist")

  13  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:898
      Illuminate\Database\Eloquent\Model::fireModelEvent("saved")

  14  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:869
      Illuminate\Database\Eloquent\Model::finishSave([])

  15  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:799
      Illuminate\Database\Eloquent\Model::save()

  16  vendor/laravel/framework/src/Illuminate/Support/helpers.php:263
      Illuminate\Database\Eloquent\Builder::Illuminate\Database\Eloquent\{closure}(Object(App\Models\Artist))

  17  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:800
      tap(Object(App\Models\Artist), Object(Closure))

  18  vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23
      Illuminate\Database\Eloquent\Builder::create(["Various Artists"])

  19  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1885
      Illuminate\Database\Eloquent\Model::forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), "create")

  20  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1897
      Illuminate\Database\Eloquent\Model::__call("create")

  21  database/migrations/2016_04_16_082627_create_various_artists.php:43
      Illuminate\Database\Eloquent\Model::__callStatic("create")

  22  vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:392
      CreateVariousArtists::up()

  23  vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:401
      Illuminate\Database\Migrations\Migrator::Illuminate\Database\Migrations\{closure}()

  24  vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:200
      Illuminate\Database\Migrations\Migrator::runMigration(Object(CreateVariousArtists), "up")

  25  vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:165
      Illuminate\Database\Migrations\Migrator::runUp("/tmp/koel/database/migrations/2016_04_16_082627_create_various_artists.php")

  26  vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:110
      Illuminate\Database\Migrations\Migrator::runPending([])

  27  vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:85
      Illuminate\Database\Migrations\Migrator::run([])

  28  vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:541
      Illuminate\Database\Console\Migrations\MigrateCommand::Illuminate\Database\Console\Migrations\{closure}()

  29  vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:94
      Illuminate\Database\Migrations\Migrator::usingConnection(Object(Closure))

  30  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Illuminate\Database\Console\Migrations\MigrateCommand::handle()

  31  vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  32  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  33  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  34  vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  35  vendor/laravel/framework/src/Illuminate/Console/Command.php:136
      Illuminate\Container\Container::call()

  36  vendor/symfony/console/Command/Command.php:256
      Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  37  vendor/laravel/framework/src/Illuminate/Console/Command.php:121
      Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  38  vendor/symfony/console/Application.php:971
      Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  39  vendor/symfony/console/Application.php:290
      Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Database\Console\Migrations\MigrateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  40  vendor/symfony/console/Application.php:166
      Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  41  vendor/laravel/framework/src/Illuminate/Console/Application.php:93
      Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  42  vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129
      Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  43  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
# echo $?
1
# mysql -e 'show tables from koel'
+-----------------+
| Tables_in_koel  |
+-----------------+
| albums          |
| artists         |
| interactions    |
| migrations      |
| password_resets |
| playlist_song   |
| playlists       |
| settings        |
| songs           |
| users           |
+-----------------+
  • First it successfully creates all required tables within the MySQL database, as configured in .env. Then it tries to connect to an SQLite database, which of course fails as MySQL is configured?
  • It returns an error code indeed, so koel:init catches this correctly, but obviously the error messages override the error code so that it is not returned to the parent artisan instance.
  • Installing sqlite3 does not change something, resetting the MySQL database and redoing the above fails the same way.
  • A second php artisan migrate --force -vvv call (without resetting the MySQL database) succeeds without showing any attempt to use SQLite at all.

🈴 php artisan db:seed --force -vvv

# php artisan db:seed --force -vvv
Seeding: Database\Seeders\ArtistTableSeeder

   PDOException

  SQLSTATE[HY000] [14] unable to open database file

  at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178
    174▕         if (file_exists($this->config['storage'].$indexName)) {
    175▕             unlink($this->config['storage'].$indexName);
    176▕         }
    177▕
  ➜ 178▕         $this->index = new PDO('sqlite:'.$this->config['storage'].$indexName);
    179▕         $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    180▕
    181▕         if($this->config['wal']) {
    182▕             $this->index->exec("PRAGMA journal_mode=wal;");

  1   vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178
      PDO::__construct("sqlite:/tmp/koel/storage/search-indexes/artists.index")

  2   vendor/teamtnt/tntsearch/src/TNTSearch.php:68
      TeamTNT\TNTSearch\Indexer\TNTIndexer::createIndex("artists.index")

  3   vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:275
      TeamTNT\TNTSearch\TNTSearch::createIndex("artists.index")

  4   vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:52
      TeamTNT\Scout\Engines\TNTSearchEngine::initIndex(Object(App\Models\Artist))

  5   vendor/laravel/scout/src/Searchable.php:63
      TeamTNT\Scout\Engines\TNTSearchEngine::update(Object(Illuminate\Database\Eloquent\Collection))

  6   vendor/laravel/scout/src/Searchable.php:42
      App\Models\Artist::queueMakeSearchable(Object(Illuminate\Database\Eloquent\Collection))

  7   vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:114
      Illuminate\Database\Eloquent\Collection::Laravel\Scout\{closure}()

  8   vendor/laravel/scout/src/Searchable.php:154
      Illuminate\Support\Collection::__call("searchable", [])

  9   vendor/laravel/scout/src/ModelObserver.php:87
      App\Models\Artist::searchable()

  10  vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:412
      Laravel\Scout\ModelObserver::saved(Object(App\Models\Artist))

  11  vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:237
      Illuminate\Events\Dispatcher::Illuminate\Events\{closure}("eloquent.saved: App\Models\Artist")

  12  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:189
      Illuminate\Events\Dispatcher::dispatch("eloquent.saved: App\Models\Artist")

  13  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:898
      Illuminate\Database\Eloquent\Model::fireModelEvent("saved")

  14  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:869
      Illuminate\Database\Eloquent\Model::finishSave([])

  15  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:454
      Illuminate\Database\Eloquent\Model::save()

  16  vendor/laravel/framework/src/Illuminate/Support/helpers.php:263
      Illuminate\Database\Eloquent\Builder::Illuminate\Database\Eloquent\{closure}(Object(App\Models\Artist))

  17  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:455
      tap(Object(App\Models\Artist), Object(Closure))

  18  vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23
      Illuminate\Database\Eloquent\Builder::firstOrCreate([], ["Unknown Artist"])

  19  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1885
      Illuminate\Database\Eloquent\Model::forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), "firstOrCreate")

  20  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1897
      Illuminate\Database\Eloquent\Model::__call("firstOrCreate")

  21  database/seeders/ArtistTableSeeder.php:15
      Illuminate\Database\Eloquent\Model::__callStatic("firstOrCreate")

  22  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Database\Seeders\ArtistTableSeeder::run()

  23  vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  24  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  25  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  26  vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  27  vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149
      Illuminate\Container\Container::call([])

  28  vendor/laravel/framework/src/Illuminate/Database/Seeder.php:49
      Illuminate\Database\Seeder::__invoke([])

  29  database/seeders/DatabaseSeeder.php:14
      Illuminate\Database\Seeder::call("Database\Seeders\ArtistTableSeeder")

  30  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Database\Seeders\DatabaseSeeder::run()

  31  vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  32  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  33  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  34  vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  35  vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149
      Illuminate\Container\Container::call([])

  36  vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:65
      Illuminate\Database\Seeder::__invoke()

  37  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:157
      Illuminate\Database\Console\Seeds\SeedCommand::Illuminate\Database\Console\Seeds\{closure}()

  38  vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:66
      Illuminate\Database\Eloquent\Model::unguarded(Object(Closure))

  39  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Illuminate\Database\Console\Seeds\SeedCommand::handle()

  40  vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  41  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  42  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  43  vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  44  vendor/laravel/framework/src/Illuminate/Console/Command.php:136
      Illuminate\Container\Container::call()

  45  vendor/symfony/console/Command/Command.php:256
      Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  46  vendor/laravel/framework/src/Illuminate/Console/Command.php:121
      Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  47  vendor/symfony/console/Application.php:971
      Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  48  vendor/symfony/console/Application.php:290
      Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Database\Console\Seeds\SeedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  49  vendor/symfony/console/Application.php:166
      Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  50  vendor/laravel/framework/src/Illuminate/Console/Application.php:93
      Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  51  vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129
      Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  52  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
# php artisan db:seed --force -vvv
Seeding: Database\Seeders\ArtistTableSeeder
Seeded:  Database\Seeders\ArtistTableSeeder (30.60ms)
Seeding: Database\Seeders\AlbumTableSeeder

   PDOException

  SQLSTATE[HY000] [14] unable to open database file

  at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178
    174▕         if (file_exists($this->config['storage'].$indexName)) {
    175▕             unlink($this->config['storage'].$indexName);
    176▕         }
    177▕
  ➜ 178▕         $this->index = new PDO('sqlite:'.$this->config['storage'].$indexName);
    179▕         $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    180▕
    181▕         if($this->config['wal']) {
    182▕             $this->index->exec("PRAGMA journal_mode=wal;");

  1   vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178
      PDO::__construct("sqlite:/tmp/koel/storage/search-indexes/albums.index")

  2   vendor/teamtnt/tntsearch/src/TNTSearch.php:68
      TeamTNT\TNTSearch\Indexer\TNTIndexer::createIndex("albums.index")

  3   vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:275
      TeamTNT\TNTSearch\TNTSearch::createIndex("albums.index")

  4   vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:52
      TeamTNT\Scout\Engines\TNTSearchEngine::initIndex(Object(App\Models\Album))

  5   vendor/laravel/scout/src/Searchable.php:63
      TeamTNT\Scout\Engines\TNTSearchEngine::update(Object(Illuminate\Database\Eloquent\Collection))

  6   vendor/laravel/scout/src/Searchable.php:42
      App\Models\Artist::queueMakeSearchable(Object(Illuminate\Database\Eloquent\Collection))

  7   vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:114
      Illuminate\Database\Eloquent\Collection::Laravel\Scout\{closure}()

  8   vendor/laravel/scout/src/Searchable.php:154
      Illuminate\Support\Collection::__call("searchable", [])

  9   vendor/laravel/scout/src/ModelObserver.php:87
      App\Models\Album::searchable()

  10  vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:412
      Laravel\Scout\ModelObserver::saved(Object(App\Models\Album))

  11  vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:237
      Illuminate\Events\Dispatcher::Illuminate\Events\{closure}("eloquent.saved: App\Models\Album")

  12  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:189
      Illuminate\Events\Dispatcher::dispatch("eloquent.saved: App\Models\Album")

  13  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:898
      Illuminate\Database\Eloquent\Model::fireModelEvent("saved")

  14  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:869
      Illuminate\Database\Eloquent\Model::finishSave([])

  15  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:454
      Illuminate\Database\Eloquent\Model::save()

  16  vendor/laravel/framework/src/Illuminate/Support/helpers.php:263
      Illuminate\Database\Eloquent\Builder::Illuminate\Database\Eloquent\{closure}(Object(App\Models\Album))

  17  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:455
      tap(Object(App\Models\Album), Object(Closure))

  18  vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23
      Illuminate\Database\Eloquent\Builder::firstOrCreate([], ["Unknown Album", "unknown-album.png"])

  19  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1885
      Illuminate\Database\Eloquent\Model::forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), "firstOrCreate")

  20  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1897
      Illuminate\Database\Eloquent\Model::__call("firstOrCreate")

  21  database/seeders/AlbumTableSeeder.php:16
      Illuminate\Database\Eloquent\Model::__callStatic("firstOrCreate")

  22  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Database\Seeders\AlbumTableSeeder::run()

  23  vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  24  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  25  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  26  vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  27  vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149
      Illuminate\Container\Container::call([])

  28  vendor/laravel/framework/src/Illuminate/Database/Seeder.php:49
      Illuminate\Database\Seeder::__invoke([])

  29  database/seeders/DatabaseSeeder.php:15
      Illuminate\Database\Seeder::call("Database\Seeders\AlbumTableSeeder")

  30  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Database\Seeders\DatabaseSeeder::run()

  31  vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  32  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  33  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  34  vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  35  vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149
      Illuminate\Container\Container::call([])

  36  vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:65
      Illuminate\Database\Seeder::__invoke()

  37  vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:157
      Illuminate\Database\Console\Seeds\SeedCommand::Illuminate\Database\Console\Seeds\{closure}()

  38  vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:66
      Illuminate\Database\Eloquent\Model::unguarded(Object(Closure))

  39  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      Illuminate\Database\Console\Seeds\SeedCommand::handle()

  40  vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  41  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  42  vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  43  vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  44  vendor/laravel/framework/src/Illuminate/Console/Command.php:136
      Illuminate\Container\Container::call()

  45  vendor/symfony/console/Command/Command.php:256
      Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  46  vendor/laravel/framework/src/Illuminate/Console/Command.php:121
      Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  47  vendor/symfony/console/Application.php:971
      Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  48  vendor/symfony/console/Application.php:290
      Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Database\Console\Seeds\SeedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  49  vendor/symfony/console/Application.php:166
      Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  50  vendor/laravel/framework/src/Illuminate/Console/Application.php:93
      Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  51  vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129
      Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  52  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
# php artisan db:seed --force -vvv
Seeding: Database\Seeders\ArtistTableSeeder
Seeded:  Database\Seeders\ArtistTableSeeder (47.21ms)
Seeding: Database\Seeders\AlbumTableSeeder
Seeded:  Database\Seeders\AlbumTableSeeder (1.87ms)
Seeding: Database\Seeders\SettingTableSeeder
Seeded:  Database\Seeders\SettingTableSeeder (4.89ms)
Database seeding completed successfully.
  • Similar, on first attempt ArtistTableSeeder fails as it tries to access via SQLite.
  • On second attempt, ArtistTableSeeder succeeds but AlbumTableSeeder fails.
  • On third attempt, all seedings succeed.

So it seems like for unknown reasons, it is tried to access the database via SQLite while it has been configured to use MySQL. And this seems to be the case only when the affected database tables or entries do not exist yet. It's a bit above my insights to understand where the database driver selection is done and why the .env entries (even that MySQL is the default already) are not respected in every case. At least it's not a bug in a specific PHP version, as two versions and three builds have been tested with the same behaviour. Probably an issue with Laravel. I'd be happy to do further debug steps or provide additional information/outputs/logs, but I'm not sure at this point how to go on best.

<!-- gh-comment-id:817775478 --> @MichaIng commented on GitHub (Apr 12, 2021): Obviously `migrateDatabase` and `maybeSeedDatabase` are throwing errors, even when they succeed. So running the included commands manually with additional verbosity could help to debug the issue: - [x] Running `php artisan migrate --force -vvv` manually - Here clearing the media cache could be as well responsible for the error? - [x] Running `php artisan db:seed --force -vvv` manually Another minor issue is that even when the init command exits with that error message, it does not return an error code to artisan => the console. `artisan` catches a status code to exist with: https://github.com/koel/koel/blob/c9446c4adb9566a78321300c5a68ec3e57ca269d/artisan#L33 I'm no experienced PHP coder, but would `return 1` or `return (bool) false` work here: https://github.com/koel/koel/blob/c9446c4adb9566a78321300c5a68ec3e57ca269d/app/Console/Commands/InitCommand.php#L77 _______________ 🈯 `php artisan key:generate` 🈯 `php artisan config:clear` 🈴 `php artisan migrate --force -vvv` <details> ``` # php artisan migrate --force -vvv Migration table created successfully. Migrating: 2014_10_12_000000_create_users_table Migrated: 2014_10_12_000000_create_users_table (25.21ms) Migrating: 2014_10_12_100000_create_password_resets_table Migrated: 2014_10_12_100000_create_password_resets_table (47.66ms) Migrating: 2015_11_23_074600_create_artists_table Migrated: 2015_11_23_074600_create_artists_table (19.52ms) Migrating: 2015_11_23_074709_create_albums_table Migrated: 2015_11_23_074709_create_albums_table (48.79ms) Migrating: 2015_11_23_074713_create_songs_table Migrated: 2015_11_23_074713_create_songs_table (70.45ms) Migrating: 2015_11_23_074723_create_playlists_table Migrated: 2015_11_23_074723_create_playlists_table (50.34ms) Migrating: 2015_11_23_074733_create_interactions_table Migrated: 2015_11_23_074733_create_interactions_table (80.56ms) Migrating: 2015_11_23_082854_create_playlist_song_table Migrated: 2015_11_23_082854_create_playlist_song_table (79.38ms) Migrating: 2015_11_25_033351_create_settings_table Migrated: 2015_11_25_033351_create_settings_table (27.00ms) Migrating: 2015_12_18_072523_add_preferences_to_users_table Migrated: 2015_12_18_072523_add_preferences_to_users_table (27.18ms) Migrating: 2015_12_22_092542_add_image_to_artists_table Migrated: 2015_12_22_092542_add_image_to_artists_table (22.34ms) Migrating: 2016_03_20_134512_add_track_into_songs Migrated: 2016_03_20_134512_add_track_into_songs (21.58ms) Migrating: 2016_04_15_121215_add_is_complilation_into_albums Migrated: 2016_04_15_121215_add_is_complilation_into_albums (31.18ms) Migrating: 2016_04_15_125237_add_contributing_artist_id_into_songs Migrated: 2016_04_15_125237_add_contributing_artist_id_into_songs (56.84ms) Migrating: 2016_04_16_082627_create_various_artists PDOException SQLSTATE[HY000] [14] unable to open database file at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178 174▕ if (file_exists($this->config['storage'].$indexName)) { 175▕ unlink($this->config['storage'].$indexName); 176▕ } 177▕ ➜ 178▕ $this->index = new PDO('sqlite:'.$this->config['storage'].$indexName); 179▕ $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 180▕ 181▕ if($this->config['wal']) { 182▕ $this->index->exec("PRAGMA journal_mode=wal;"); 1 vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178 PDO::__construct("sqlite:/tmp/koel/storage/search-indexes/artists.index") 2 vendor/teamtnt/tntsearch/src/TNTSearch.php:68 TeamTNT\TNTSearch\Indexer\TNTIndexer::createIndex("artists.index") 3 vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:275 TeamTNT\TNTSearch\TNTSearch::createIndex("artists.index") 4 vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:52 TeamTNT\Scout\Engines\TNTSearchEngine::initIndex(Object(App\Models\Artist)) 5 vendor/laravel/scout/src/Searchable.php:63 TeamTNT\Scout\Engines\TNTSearchEngine::update(Object(Illuminate\Database\Eloquent\Collection)) 6 vendor/laravel/scout/src/Searchable.php:42 App\Models\Artist::queueMakeSearchable(Object(Illuminate\Database\Eloquent\Collection)) 7 vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:114 Illuminate\Database\Eloquent\Collection::Laravel\Scout\{closure}() 8 vendor/laravel/scout/src/Searchable.php:154 Illuminate\Support\Collection::__call("searchable", []) 9 vendor/laravel/scout/src/ModelObserver.php:87 App\Models\Artist::searchable() 10 vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:412 Laravel\Scout\ModelObserver::saved(Object(App\Models\Artist)) 11 vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:237 Illuminate\Events\Dispatcher::Illuminate\Events\{closure}("eloquent.saved: App\Models\Artist") 12 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:189 Illuminate\Events\Dispatcher::dispatch("eloquent.saved: App\Models\Artist") 13 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:898 Illuminate\Database\Eloquent\Model::fireModelEvent("saved") 14 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:869 Illuminate\Database\Eloquent\Model::finishSave([]) 15 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:799 Illuminate\Database\Eloquent\Model::save() 16 vendor/laravel/framework/src/Illuminate/Support/helpers.php:263 Illuminate\Database\Eloquent\Builder::Illuminate\Database\Eloquent\{closure}(Object(App\Models\Artist)) 17 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:800 tap(Object(App\Models\Artist), Object(Closure)) 18 vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23 Illuminate\Database\Eloquent\Builder::create(["Various Artists"]) 19 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1885 Illuminate\Database\Eloquent\Model::forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), "create") 20 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1897 Illuminate\Database\Eloquent\Model::__call("create") 21 database/migrations/2016_04_16_082627_create_various_artists.php:43 Illuminate\Database\Eloquent\Model::__callStatic("create") 22 vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:392 CreateVariousArtists::up() 23 vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:401 Illuminate\Database\Migrations\Migrator::Illuminate\Database\Migrations\{closure}() 24 vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:200 Illuminate\Database\Migrations\Migrator::runMigration(Object(CreateVariousArtists), "up") 25 vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:165 Illuminate\Database\Migrations\Migrator::runUp("/tmp/koel/database/migrations/2016_04_16_082627_create_various_artists.php") 26 vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:110 Illuminate\Database\Migrations\Migrator::runPending([]) 27 vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:85 Illuminate\Database\Migrations\Migrator::run([]) 28 vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:541 Illuminate\Database\Console\Migrations\MigrateCommand::Illuminate\Database\Console\Migrations\{closure}() 29 vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:94 Illuminate\Database\Migrations\Migrator::usingConnection(Object(Closure)) 30 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Database\Console\Migrations\MigrateCommand::handle() 31 vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() 32 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) 33 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure)) 34 vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), []) 35 vendor/laravel/framework/src/Illuminate/Console/Command.php:136 Illuminate\Container\Container::call() 36 vendor/symfony/console/Command/Command.php:256 Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 37 vendor/laravel/framework/src/Illuminate/Console/Command.php:121 Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 38 vendor/symfony/console/Application.php:971 Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 39 vendor/symfony/console/Application.php:290 Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Database\Console\Migrations\MigrateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 40 vendor/symfony/console/Application.php:166 Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 41 vendor/laravel/framework/src/Illuminate/Console/Application.php:93 Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 42 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129 Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 43 artisan:35 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) # echo $? 1 # mysql -e 'show tables from koel' +-----------------+ | Tables_in_koel | +-----------------+ | albums | | artists | | interactions | | migrations | | password_resets | | playlist_song | | playlists | | settings | | songs | | users | +-----------------+ ``` </details> - First it successfully creates all required tables within the MySQL database, as configured in `.env`. Then it tries to connect to an SQLite database, which of course fails as MySQL is configured? - It returns an error code indeed, so `koel:init` catches this correctly, but obviously the error messages override the error code so that it is not returned to the parent artisan instance. - Installing `sqlite3` does not change something, resetting the MySQL database and redoing the above fails the same way. - A second `php artisan migrate --force -vvv` call (without resetting the MySQL database) succeeds without showing any attempt to use SQLite at all. 🈴 `php artisan db:seed --force -vvv` <details> ``` # php artisan db:seed --force -vvv Seeding: Database\Seeders\ArtistTableSeeder PDOException SQLSTATE[HY000] [14] unable to open database file at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178 174▕ if (file_exists($this->config['storage'].$indexName)) { 175▕ unlink($this->config['storage'].$indexName); 176▕ } 177▕ ➜ 178▕ $this->index = new PDO('sqlite:'.$this->config['storage'].$indexName); 179▕ $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 180▕ 181▕ if($this->config['wal']) { 182▕ $this->index->exec("PRAGMA journal_mode=wal;"); 1 vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178 PDO::__construct("sqlite:/tmp/koel/storage/search-indexes/artists.index") 2 vendor/teamtnt/tntsearch/src/TNTSearch.php:68 TeamTNT\TNTSearch\Indexer\TNTIndexer::createIndex("artists.index") 3 vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:275 TeamTNT\TNTSearch\TNTSearch::createIndex("artists.index") 4 vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:52 TeamTNT\Scout\Engines\TNTSearchEngine::initIndex(Object(App\Models\Artist)) 5 vendor/laravel/scout/src/Searchable.php:63 TeamTNT\Scout\Engines\TNTSearchEngine::update(Object(Illuminate\Database\Eloquent\Collection)) 6 vendor/laravel/scout/src/Searchable.php:42 App\Models\Artist::queueMakeSearchable(Object(Illuminate\Database\Eloquent\Collection)) 7 vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:114 Illuminate\Database\Eloquent\Collection::Laravel\Scout\{closure}() 8 vendor/laravel/scout/src/Searchable.php:154 Illuminate\Support\Collection::__call("searchable", []) 9 vendor/laravel/scout/src/ModelObserver.php:87 App\Models\Artist::searchable() 10 vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:412 Laravel\Scout\ModelObserver::saved(Object(App\Models\Artist)) 11 vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:237 Illuminate\Events\Dispatcher::Illuminate\Events\{closure}("eloquent.saved: App\Models\Artist") 12 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:189 Illuminate\Events\Dispatcher::dispatch("eloquent.saved: App\Models\Artist") 13 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:898 Illuminate\Database\Eloquent\Model::fireModelEvent("saved") 14 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:869 Illuminate\Database\Eloquent\Model::finishSave([]) 15 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:454 Illuminate\Database\Eloquent\Model::save() 16 vendor/laravel/framework/src/Illuminate/Support/helpers.php:263 Illuminate\Database\Eloquent\Builder::Illuminate\Database\Eloquent\{closure}(Object(App\Models\Artist)) 17 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:455 tap(Object(App\Models\Artist), Object(Closure)) 18 vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23 Illuminate\Database\Eloquent\Builder::firstOrCreate([], ["Unknown Artist"]) 19 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1885 Illuminate\Database\Eloquent\Model::forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), "firstOrCreate") 20 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1897 Illuminate\Database\Eloquent\Model::__call("firstOrCreate") 21 database/seeders/ArtistTableSeeder.php:15 Illuminate\Database\Eloquent\Model::__callStatic("firstOrCreate") 22 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Database\Seeders\ArtistTableSeeder::run() 23 vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() 24 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) 25 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure)) 26 vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), []) 27 vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149 Illuminate\Container\Container::call([]) 28 vendor/laravel/framework/src/Illuminate/Database/Seeder.php:49 Illuminate\Database\Seeder::__invoke([]) 29 database/seeders/DatabaseSeeder.php:14 Illuminate\Database\Seeder::call("Database\Seeders\ArtistTableSeeder") 30 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Database\Seeders\DatabaseSeeder::run() 31 vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() 32 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) 33 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure)) 34 vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), []) 35 vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149 Illuminate\Container\Container::call([]) 36 vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:65 Illuminate\Database\Seeder::__invoke() 37 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:157 Illuminate\Database\Console\Seeds\SeedCommand::Illuminate\Database\Console\Seeds\{closure}() 38 vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:66 Illuminate\Database\Eloquent\Model::unguarded(Object(Closure)) 39 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Database\Console\Seeds\SeedCommand::handle() 40 vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() 41 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) 42 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure)) 43 vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), []) 44 vendor/laravel/framework/src/Illuminate/Console/Command.php:136 Illuminate\Container\Container::call() 45 vendor/symfony/console/Command/Command.php:256 Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 46 vendor/laravel/framework/src/Illuminate/Console/Command.php:121 Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 47 vendor/symfony/console/Application.php:971 Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 48 vendor/symfony/console/Application.php:290 Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Database\Console\Seeds\SeedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 49 vendor/symfony/console/Application.php:166 Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 50 vendor/laravel/framework/src/Illuminate/Console/Application.php:93 Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 51 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129 Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 52 artisan:35 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) # php artisan db:seed --force -vvv Seeding: Database\Seeders\ArtistTableSeeder Seeded: Database\Seeders\ArtistTableSeeder (30.60ms) Seeding: Database\Seeders\AlbumTableSeeder PDOException SQLSTATE[HY000] [14] unable to open database file at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178 174▕ if (file_exists($this->config['storage'].$indexName)) { 175▕ unlink($this->config['storage'].$indexName); 176▕ } 177▕ ➜ 178▕ $this->index = new PDO('sqlite:'.$this->config['storage'].$indexName); 179▕ $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 180▕ 181▕ if($this->config['wal']) { 182▕ $this->index->exec("PRAGMA journal_mode=wal;"); 1 vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:178 PDO::__construct("sqlite:/tmp/koel/storage/search-indexes/albums.index") 2 vendor/teamtnt/tntsearch/src/TNTSearch.php:68 TeamTNT\TNTSearch\Indexer\TNTIndexer::createIndex("albums.index") 3 vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:275 TeamTNT\TNTSearch\TNTSearch::createIndex("albums.index") 4 vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php:52 TeamTNT\Scout\Engines\TNTSearchEngine::initIndex(Object(App\Models\Album)) 5 vendor/laravel/scout/src/Searchable.php:63 TeamTNT\Scout\Engines\TNTSearchEngine::update(Object(Illuminate\Database\Eloquent\Collection)) 6 vendor/laravel/scout/src/Searchable.php:42 App\Models\Artist::queueMakeSearchable(Object(Illuminate\Database\Eloquent\Collection)) 7 vendor/laravel/framework/src/Illuminate/Macroable/Traits/Macroable.php:114 Illuminate\Database\Eloquent\Collection::Laravel\Scout\{closure}() 8 vendor/laravel/scout/src/Searchable.php:154 Illuminate\Support\Collection::__call("searchable", []) 9 vendor/laravel/scout/src/ModelObserver.php:87 App\Models\Album::searchable() 10 vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:412 Laravel\Scout\ModelObserver::saved(Object(App\Models\Album)) 11 vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:237 Illuminate\Events\Dispatcher::Illuminate\Events\{closure}("eloquent.saved: App\Models\Album") 12 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:189 Illuminate\Events\Dispatcher::dispatch("eloquent.saved: App\Models\Album") 13 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:898 Illuminate\Database\Eloquent\Model::fireModelEvent("saved") 14 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:869 Illuminate\Database\Eloquent\Model::finishSave([]) 15 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:454 Illuminate\Database\Eloquent\Model::save() 16 vendor/laravel/framework/src/Illuminate/Support/helpers.php:263 Illuminate\Database\Eloquent\Builder::Illuminate\Database\Eloquent\{closure}(Object(App\Models\Album)) 17 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:455 tap(Object(App\Models\Album), Object(Closure)) 18 vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23 Illuminate\Database\Eloquent\Builder::firstOrCreate([], ["Unknown Album", "unknown-album.png"]) 19 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1885 Illuminate\Database\Eloquent\Model::forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), "firstOrCreate") 20 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1897 Illuminate\Database\Eloquent\Model::__call("firstOrCreate") 21 database/seeders/AlbumTableSeeder.php:16 Illuminate\Database\Eloquent\Model::__callStatic("firstOrCreate") 22 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Database\Seeders\AlbumTableSeeder::run() 23 vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() 24 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) 25 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure)) 26 vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), []) 27 vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149 Illuminate\Container\Container::call([]) 28 vendor/laravel/framework/src/Illuminate/Database/Seeder.php:49 Illuminate\Database\Seeder::__invoke([]) 29 database/seeders/DatabaseSeeder.php:15 Illuminate\Database\Seeder::call("Database\Seeders\AlbumTableSeeder") 30 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Database\Seeders\DatabaseSeeder::run() 31 vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() 32 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) 33 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure)) 34 vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), []) 35 vendor/laravel/framework/src/Illuminate/Database/Seeder.php:149 Illuminate\Container\Container::call([]) 36 vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:65 Illuminate\Database\Seeder::__invoke() 37 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:157 Illuminate\Database\Console\Seeds\SeedCommand::Illuminate\Database\Console\Seeds\{closure}() 38 vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php:66 Illuminate\Database\Eloquent\Model::unguarded(Object(Closure)) 39 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Database\Console\Seeds\SeedCommand::handle() 40 vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() 41 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) 42 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure)) 43 vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), []) 44 vendor/laravel/framework/src/Illuminate/Console/Command.php:136 Illuminate\Container\Container::call() 45 vendor/symfony/console/Command/Command.php:256 Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 46 vendor/laravel/framework/src/Illuminate/Console/Command.php:121 Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 47 vendor/symfony/console/Application.php:971 Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 48 vendor/symfony/console/Application.php:290 Symfony\Component\Console\Application::doRunCommand(Object(Illuminate\Database\Console\Seeds\SeedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 49 vendor/symfony/console/Application.php:166 Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 50 vendor/laravel/framework/src/Illuminate/Console/Application.php:93 Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 51 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129 Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 52 artisan:35 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) # php artisan db:seed --force -vvv Seeding: Database\Seeders\ArtistTableSeeder Seeded: Database\Seeders\ArtistTableSeeder (47.21ms) Seeding: Database\Seeders\AlbumTableSeeder Seeded: Database\Seeders\AlbumTableSeeder (1.87ms) Seeding: Database\Seeders\SettingTableSeeder Seeded: Database\Seeders\SettingTableSeeder (4.89ms) Database seeding completed successfully. ``` </details> - Similar, on first attempt `ArtistTableSeeder` fails as it tries to access via SQLite. - On second attempt, `ArtistTableSeeder` succeeds but `AlbumTableSeeder` fails. - On third attempt, all seedings succeed. So it seems like for unknown reasons, it is tried to access the database via SQLite while it has been configured to use MySQL. And this seems to be the case only when the affected database tables or entries do not exist yet. It's a bit above my insights to understand where the database driver selection is done and why the `.env` entries (even that MySQL is the default already) are not respected in every case. At least it's not a bug in a specific PHP version, as two versions and three builds have been tested with the same behaviour. Probably an issue with Laravel. I'd be happy to do further debug steps or provide additional information/outputs/logs, but I'm not sure at this point how to go on best.
Author
Owner

@phanan commented on GitHub (Apr 16, 2021):

So it seems like for unknown reasons, it is tried to access the database via SQLite while it has been configured to use MySQL.

That's because TNTSearch (the full-text search engine that Koel uses) uses SQLite. Make sure /storage/search-indexes exists (which it should).

Edit: I've just checked the installation archives, indeed the directory isn't there, which is a bug.

<!-- gh-comment-id:821048294 --> @phanan commented on GitHub (Apr 16, 2021): > So it seems like for unknown reasons, it is tried to access the database via SQLite while it has been configured to use MySQL. That's because TNTSearch (the full-text search engine that Koel uses) uses SQLite. Make sure `/storage/search-indexes` exists (which it should). Edit: I've just checked the installation archives, indeed the directory isn't there, which is a bug.
Author
Owner

@phanan commented on GitHub (Apr 16, 2021):

Released v5.1.1 which fixes the TNTSearch/SQLite issue.

<!-- gh-comment-id:821060467 --> @phanan commented on GitHub (Apr 16, 2021): Released v5.1.1 which fixes the TNTSearch/SQLite issue.
Author
Owner

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

Ah I see: github.com/koel/koel@0e0e6f436b

Many thanks for the quick fix. Just tested it and it works all as expected now 👍. I'm marking this issue as closed.

<!-- gh-comment-id:821185430 --> @MichaIng commented on GitHub (Apr 16, 2021): Ah I see: https://github.com/koel/koel/commit/0e0e6f436bd6218e7264d17d2f464d05759afab4 Many thanks for the quick fix. Just tested it and it works all as expected now 👍. I'm marking this issue as closed.
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#753
No description provided.