[GH-ISSUE #1901] [Bug]: Search issues #1029

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

Originally created by @AEnterprise on GitHub (Feb 23, 2025).
Original GitHub issue: https://github.com/koel/koel/issues/1901

Originally assigned to: @phanan on GitHub.

Read the Troubleshooting guide.

  • I have read and followed the Troubleshooting guide

Reproduction steps

  1. start docker image and run initial setup command - when using the default tntsearch it already fails here
  2. switch to "database" scout driver - setup now works
  3. import songs
  4. search for anything

Expected behavior

  1. for the default tntsearch to work
  2. when using either option for search results to be shown

Actual behavior

  1. with tntsearch you just get an error thrown at you
  2. with database search setup completes but all search silently fails in the ui, with errors in the larvel log

Logs

for tntsearch:
see attached error.log , too much error output to fit

errors.log

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

  at vendor/teamtnt/tntsearch/src/Engines/SqliteEngine.php:61
     57▕         $this->indexName = $indexName;
     58▕ 
     59▕         $this->flushIndex($indexName);
     60▕ 
  ➜  61▕         $this->index = new PDO('sqlite:' . $this->config['storage'] . $indexName);
     62▕         $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     63▕ 
     64▕         if ($this->config['wal']) {
     65▕             $this->index->exec("PRAGMA journal_mode=wal;");

      +25 vendor frames 

  26  app/Console/Commands/ImportSearchableEntitiesCommand.php:28
      Illuminate\Console\Command::call()
      +12 vendor frames 

  39  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

for database search:

[2025-02-23 21:10:03] production.ERROR: Scout search failed {"exception":"[object] (TypeError(code: 0): App\\Models\\Album::App\\Models\\{closure}(): Argument #1 ($value) must be of type string, null given at /var/www/html/app/Models/Album.php:119)

Koel version

Koel v7.2.0 Community Edition

How did you install Koel?

Official Docker image

Additional information

  • Server OS: Unraid 7.0
  • PHP version: Docker image
  • Database: PostgreSQL 16.3
  • Node version: Docker image
  • Browser & device: Firefox
  • Additional context:
Originally created by @AEnterprise on GitHub (Feb 23, 2025). Original GitHub issue: https://github.com/koel/koel/issues/1901 Originally assigned to: @phanan on GitHub. ### Read the Troubleshooting guide. - [x] I have read and followed the Troubleshooting guide ### Reproduction steps 1. start docker image and run initial setup command - when using the default tntsearch it already fails here 2. switch to "database" scout driver - setup now works 3. import songs 4. search for anything ### Expected behavior 1. for the default tntsearch to work 2. when using either option for search results to be shown ### Actual behavior 1. with tntsearch you just get an error thrown at you 2. with database search setup completes but all search silently fails in the ui, with errors in the larvel log ### Logs for tntsearch: see attached error.log , too much error output to fit [errors.log](https://github.com/user-attachments/files/18933387/errors.log) ``` SQLSTATE[HY000] [14] unable to open database file at vendor/teamtnt/tntsearch/src/Engines/SqliteEngine.php:61 57▕ $this->indexName = $indexName; 58▕ 59▕ $this->flushIndex($indexName); 60▕ ➜ 61▕ $this->index = new PDO('sqlite:' . $this->config['storage'] . $indexName); 62▕ $this->index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 63▕ 64▕ if ($this->config['wal']) { 65▕ $this->index->exec("PRAGMA journal_mode=wal;"); +25 vendor frames 26 app/Console/Commands/ImportSearchableEntitiesCommand.php:28 Illuminate\Console\Command::call() +12 vendor frames 39 artisan:35 Illuminate\Foundation\Console\Kernel::handle() ``` for database search: ``` [2025-02-23 21:10:03] production.ERROR: Scout search failed {"exception":"[object] (TypeError(code: 0): App\\Models\\Album::App\\Models\\{closure}(): Argument #1 ($value) must be of type string, null given at /var/www/html/app/Models/Album.php:119) ``` ### Koel version Koel v7.2.0 Community Edition ### How did you install Koel? Official Docker image ### Additional information - **Server OS**: Unraid 7.0 - **PHP version**: Docker image - **Database**: PostgreSQL 16.3 - **Node version**: Docker image - **Browser & device**: Firefox - **Additional context**:
kerem closed this issue 2026-02-26 02:34:59 +03:00
Author
Owner

@phanan commented on GitHub (Feb 28, 2025):

@AEnterprise Can you check and make sure storage/search-indexes exists and is read-writable?

<!-- gh-comment-id:2689758567 --> @phanan commented on GitHub (Feb 28, 2025): @AEnterprise Can you check and make sure `storage/search-indexes` exists and is read-writable?
Author
Owner

@AEnterprise commented on GitHub (Mar 1, 2025):

Looks like it wasn't writable to the www-data user koel runs as (missed it at first cause unraid opens the terminal as the root user from the ui, and that one could write without issue)

However search still gives no results. it made database files but they seem to be empty even after running sync again

<!-- gh-comment-id:2692242673 --> @AEnterprise commented on GitHub (Mar 1, 2025): Looks like it wasn't writable to the www-data user koel runs as (missed it at first cause unraid opens the terminal as the root user from the ui, and that one could write without issue) However search still gives no results. it made database files but they seem to be empty even after running sync again
Author
Owner

@AEnterprise commented on GitHub (Mar 18, 2025):

managed to resolve this by just starting fresh with the correct permissions and importing everything again from scratch

<!-- gh-comment-id:2734534670 --> @AEnterprise commented on GitHub (Mar 18, 2025): managed to resolve this by just starting fresh with the correct permissions and importing everything again from scratch
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#1029
No description provided.