[GH-ISSUE #1484] fread() error on koel:sync #849

Closed
opened 2026-02-26 02:34:26 +03:00 by kerem · 1 comment
Owner

Originally created by @CYBERBUGJR on GitHub (Aug 17, 2022).
Original GitHub issue: https://github.com/koel/koel/issues/1484

Hi folks,

I'm using koel for quite some time, i'm very thankful for what you achieve so far.
Still, i have a problem on music library import.
Information about my install :

platform : Docker 
Image : phanan/koel
PHP version : v8.1.8
php_memory_limit: 4096M

Most of my songs are FLAC. About 10k
Whats the problem ?
Trying to import my music lib with the traditional php artisan koel:sync,
process throws this error log :

/var/www/html# php artisan koel:sync

   INFO  Scanning /music.

 1972/6573 [========>-------------------]  30%
   ValueError

  fread(): Argument #2 ($length) must be greater than 0

  at vendor/james-heinrich/getid3/getid3/getid3.php:2215
    2211▕                       //if (($this->getid3->memory_limit > 0) && ($bytes > $this->getid3->memory_limit)) {
    2212▕                       if (($this->getid3->memory_limit > 0) && (($bytes / $this->getid3->memory_limit) > 0.99)) { // enable a more-fuzzy match to prevent close misses generating errors like "PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554464 bytes)"
    2213▕                               throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') that is more than available PHP memory ('.$this->getid3->memory_limit.')', 10);
    2214▕                       }
  ➜ 2215▕                       $part = fread($this->getid3->fp, $bytes);
    2216▕                       $partLength  = strlen($part);
    2217▕                       $bytes      -= $partLength;
    2218▕                       $contents   .= $part;
    2219▕               } while (($bytes > 0) && ($partLength > 0));

      +5 vendor frames
  6   app/Services/FileSynchronizer.php:51
      getID3::analyze()

  7   app/Services/FileSynchronizer.php:69
      App\Services\FileSynchronizer::getFileScanInformation()

What do you expect ?

Getting my lib imported inside Koel.

Have you try anything ?

  • Changed my php memory setting by overriding default value.
  • Search for any empty files inside my lib.

Thanks for the help 😄

Originally created by @CYBERBUGJR on GitHub (Aug 17, 2022). Original GitHub issue: https://github.com/koel/koel/issues/1484 Hi folks, I'm using koel for quite some time, i'm very thankful for what you achieve so far. Still, i have a problem on music library import. Information about my install : ``` platform : Docker Image : phanan/koel PHP version : v8.1.8 php_memory_limit: 4096M ``` Most of my songs are FLAC. About 10k **Whats the problem ?** Trying to import my music lib with the traditional `php artisan koel:sync`, process throws this error log : ``` /var/www/html# php artisan koel:sync INFO Scanning /music. 1972/6573 [========>-------------------] 30% ValueError fread(): Argument #2 ($length) must be greater than 0 at vendor/james-heinrich/getid3/getid3/getid3.php:2215 2211▕ //if (($this->getid3->memory_limit > 0) && ($bytes > $this->getid3->memory_limit)) { 2212▕ if (($this->getid3->memory_limit > 0) && (($bytes / $this->getid3->memory_limit) > 0.99)) { // enable a more-fuzzy match to prevent close misses generating errors like "PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554464 bytes)" 2213▕ throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') that is more than available PHP memory ('.$this->getid3->memory_limit.')', 10); 2214▕ } ➜ 2215▕ $part = fread($this->getid3->fp, $bytes); 2216▕ $partLength = strlen($part); 2217▕ $bytes -= $partLength; 2218▕ $contents .= $part; 2219▕ } while (($bytes > 0) && ($partLength > 0)); +5 vendor frames 6 app/Services/FileSynchronizer.php:51 getID3::analyze() 7 app/Services/FileSynchronizer.php:69 App\Services\FileSynchronizer::getFileScanInformation() ``` **What do you expect ?** Getting my lib imported inside Koel. **Have you try anything ?** - Changed my php memory setting by overriding default value. - Search for any empty files inside my lib. Thanks for the help 😄
kerem closed this issue 2026-02-26 02:34:26 +03:00
Author
Owner

@phanan commented on GitHub (Sep 11, 2022):

I'd suggest running koel:sync with -v to find out what the bad song is and maybe delete it.

<!-- gh-comment-id:1242914712 --> @phanan commented on GitHub (Sep 11, 2022): I'd suggest running `koel:sync` with `-v` to find out what the bad song is and maybe delete it.
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#849
No description provided.