[GH-ISSUE #1300] SQLSTATE[HY000] [14] unable to open database file #748

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

Originally created by @edition89 on GitHub (Apr 1, 2021).
Original GitHub issue: https://github.com/koel/koel/issues/1300

When I try to sync the list of songs, I get an error:

php artisan koel:sync
Syncing media from /var/koel/music

1/508 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%
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;");

  +20 vendor frames

21 app/Services/FileSynchronizer.php:209
Illuminate\Database\Eloquent\Model::__callStatic("updateOrCreate")

22 app/Services/MediaSyncService.php:112
App\Services\FileSynchronizer::sync()

But if you enter the command every time, then the songs will be added.

I gave 777 permissions to all files.
What could be the reason?

Originally created by @edition89 on GitHub (Apr 1, 2021). Original GitHub issue: https://github.com/koel/koel/issues/1300 When I try to sync the list of songs, I get an error: php artisan koel:sync Syncing media from /var/koel/music 1/508 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 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;"); +20 vendor frames 21 app/Services/FileSynchronizer.php:209 Illuminate\Database\Eloquent\Model::__callStatic("updateOrCreate") 22 app/Services/MediaSyncService.php:112 App\Services\FileSynchronizer::sync() But if you enter the command every time, then the songs will be added. I gave 777 permissions to all files. What could be the reason?
kerem closed this issue 2026-02-26 02:34:09 +03:00
Author
Owner

@kartikcool15 commented on GitHub (Apr 2, 2021):

Same error here

<!-- gh-comment-id:812396897 --> @kartikcool15 commented on GitHub (Apr 2, 2021): Same error here
Author
Owner

@phcco commented on GitHub (Apr 3, 2021):

Was able to sync after cd your-koel-folder; mkdir storage/search-indexes

<!-- gh-comment-id:812823680 --> @phcco commented on GitHub (Apr 3, 2021): Was able to sync after `cd your-koel-folder; mkdir storage/search-indexes`
Author
Owner

@edition89 commented on GitHub (Apr 5, 2021):

Was able to sync after cd your-koel-folder; mkdir storage/search-indexes

Thanks! Your suggestion helped.

<!-- gh-comment-id:813365400 --> @edition89 commented on GitHub (Apr 5, 2021): > Was able to sync after `cd your-koel-folder; mkdir storage/search-indexes` Thanks! Your suggestion helped.
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#748
No description provided.