[GH-ISSUE #1400] PDOException while building TNT search index #796

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

Originally created by @Hyzual on GitHub (Dec 30, 2021).
Original GitHub issue: https://github.com/koel/koel/issues/1400

Describe the bug
When I run php artisan koel:sync or php artisan koel:search:import, I get a PDOException stating SQLSTATE[HY000]: General error: 8 attempt to write a readonly database

To reproduce
Steps to reproduce the behavior:

  1. Run php artisan koel:sync or php artisan koel:search:import
  2. Exception is printed on console

Expected behavior
Expected no error.

Environment

  • Koel version v5.1.12
  • Database: MySQL v5.7
  • OS: Linux (Docker container)
  • Browser: irrelevant
  • PHP version 7.4.27
  • Node version: irrelevant

Additional context
Here is the stacktrace:

$ php artisan koel:sync -v
Syncing media from /music

   PDOException 

  SQLSTATE[HY000]: General error: 8 attempt to write a readonly database

  at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:442
    438▕     {
    439▕         $this->updateInfoTableStmt = $this->index->prepare("UPDATE info SET value = :value WHERE key = :key");
    440▕         $this->updateInfoTableStmt->bindValue(':key', $key);
    441▕         $this->updateInfoTableStmt->bindValue(':value', $value);
  ➜ 442▕         $this->updateInfoTableStmt->execute();
    443▕     }
    444▕ 
    445▕     public function stemText($text)
    446▕     {
    
  1   vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:442
      PDOStatement::execute()

  2   vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:125
      TeamTNT\TNTSearch\Indexer\TNTIndexer::updateInfoTable()

 [ ... and 36 more lines all in vendor/ folder ]
    ```
Originally created by @Hyzual on GitHub (Dec 30, 2021). Original GitHub issue: https://github.com/koel/koel/issues/1400 **Describe the bug** When I run `php artisan koel:sync` or `php artisan koel:search:import`, I get a `PDOException` stating `SQLSTATE[HY000]: General error: 8 attempt to write a readonly database` **To reproduce** Steps to reproduce the behavior: 1. Run `php artisan koel:sync` or `php artisan koel:search:import` 2. Exception is printed on console **Expected behavior** Expected no error. **Environment** - Koel version v5.1.12 - Database: MySQL v5.7 - OS: Linux (Docker container) - Browser: _irrelevant_ - PHP version 7.4.27 - Node version: _irrelevant_ **Additional context** Here is the stacktrace: ``` $ php artisan koel:sync -v Syncing media from /music PDOException SQLSTATE[HY000]: General error: 8 attempt to write a readonly database at vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:442 438▕ { 439▕ $this->updateInfoTableStmt = $this->index->prepare("UPDATE info SET value = :value WHERE key = :key"); 440▕ $this->updateInfoTableStmt->bindValue(':key', $key); 441▕ $this->updateInfoTableStmt->bindValue(':value', $value); ➜ 442▕ $this->updateInfoTableStmt->execute(); 443▕ } 444▕ 445▕ public function stemText($text) 446▕ { 1 vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:442 PDOStatement::execute() 2 vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:125 TeamTNT\TNTSearch\Indexer\TNTIndexer::updateInfoTable() [ ... and 36 more lines all in vendor/ folder ] ```
kerem closed this issue 2026-02-26 02:34:18 +03:00
Author
Owner

@phanan commented on GitHub (Dec 30, 2021):

Try making the search database writable?

<!-- gh-comment-id:1003196434 --> @phanan commented on GitHub (Dec 30, 2021): Try making the search database writable?
Author
Owner

@Hyzual commented on GitHub (Dec 30, 2021):

Sorry about that. I thought I was testing from scratch but there was a leftover volume for the search index. It was the cause of the error.
Problem was due to my environment.

<!-- gh-comment-id:1003199967 --> @Hyzual commented on GitHub (Dec 30, 2021): Sorry about that. I thought I was testing from scratch but there was a leftover volume for the search index. It was the cause of the error. Problem was due to my environment.
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#796
No description provided.