[GH-ISSUE #285] [RuntimeException] #205

Closed
opened 2026-02-26 02:32:26 +03:00 by kerem · 8 comments
Owner

Originally created by @BernardGoldberger on GitHub (Mar 24, 2016).
Original GitHub issue: https://github.com/koel/koel/issues/285

Good Morning

On Master with latest commits.

I just tried Koel:sync a few times and it seems like that whenever there is a weird character in a filename it throws an exception error and if I rename the file and remove that character it will continue but then throws an exception for another filename.

Example weird character 챕 or ע

Error.......

[RuntimeException] SplFileInfo::getMTime(): stat failed for \Benny Freidman 3\Benny Friedman-Kol Haneshama Sheli-10-Yesoid V?shoiresh.mp3

Exception trace: () at C:\wamp64\www\koel\app\Models\File.php:72 SplFileInfo->getMTime() at C:\wamp64\www\koel\app\Models\File.php:72 App\Models\File->__construct() at C:\wamp64\www\koel\app\Services\Media.php:64 App\Services\Media->sync() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:227 Illuminate\Support\Facades\Facade::__callStatic() at C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php:75 App\Console\Commands\SyncMedia->syncAll() at C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php:55 App\Console\Commands\SyncMedia->handle() at n/a:n/a call_user_func_array() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Container\Container.php:507 Illuminate\Container\Container->call() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php:169 Illuminate\Console\Command->execute() at C:\wamp64\www\koel\vendor\symfony\console\Command\Command.php:256 Symfony\Component\Console\Command\Command->run() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php:155 Illuminate\Console\Command->run() at C:\wamp64\www\koel\vendor\symfony\console\Application.php:791 Symfony\Component\Console\Application->doRunCommand() at C:\wamp64\www\koel\vendor\symfony\console\Application.php:186 Symfony\Component\Console\Application->doRun() at C:\wamp64\www\koel\vendor\symfony\console\Application.php:117 Symfony\Component\Console\Application->run() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:107 Illuminate\Foundation\Console\Kernel->handle() at C:\wamp64\www\koel\artisan:35

Originally created by @BernardGoldberger on GitHub (Mar 24, 2016). Original GitHub issue: https://github.com/koel/koel/issues/285 Good Morning On Master with latest commits. I just tried Koel:sync a few times and it seems like that whenever there is a weird character in a filename it throws an exception error and if I rename the file and remove that character it will continue but then throws an exception for another filename. Example weird character 챕 or ע Error....... `[RuntimeException] SplFileInfo::getMTime(): stat failed for \Benny Freidman 3\Benny Friedman-Kol Haneshama Sheli-10-Yesoid V?shoiresh.mp3` `Exception trace: () at C:\wamp64\www\koel\app\Models\File.php:72 SplFileInfo->getMTime() at C:\wamp64\www\koel\app\Models\File.php:72 App\Models\File->__construct() at C:\wamp64\www\koel\app\Services\Media.php:64 App\Services\Media->sync() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:227 Illuminate\Support\Facades\Facade::__callStatic() at C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php:75 App\Console\Commands\SyncMedia->syncAll() at C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php:55 App\Console\Commands\SyncMedia->handle() at n/a:n/a call_user_func_array() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Container\Container.php:507 Illuminate\Container\Container->call() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php:169 Illuminate\Console\Command->execute() at C:\wamp64\www\koel\vendor\symfony\console\Command\Command.php:256 Symfony\Component\Console\Command\Command->run() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php:155 Illuminate\Console\Command->run() at C:\wamp64\www\koel\vendor\symfony\console\Application.php:791 Symfony\Component\Console\Application->doRunCommand() at C:\wamp64\www\koel\vendor\symfony\console\Application.php:186 Symfony\Component\Console\Application->doRun() at C:\wamp64\www\koel\vendor\symfony\console\Application.php:117 Symfony\Component\Console\Application->run() at C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:107 Illuminate\Foundation\Console\Kernel->handle() at C:\wamp64\www\koel\artisan:35`
kerem closed this issue 2026-02-26 02:32:26 +03:00
Author
Owner

@phanan commented on GitHub (Mar 25, 2016):

Does this happen with the same file and an older version?

<!-- gh-comment-id:201317888 --> @phanan commented on GitHub (Mar 25, 2016): Does this happen with the same file and an older version?
Author
Owner

@BernardGoldberger commented on GitHub (Mar 25, 2016):

No

I believe it was still working fine on the latest tag 2.2.0, you should be able to reproduce by renaming a file and having one of those character in the filename.

<!-- gh-comment-id:201333451 --> @BernardGoldberger commented on GitHub (Mar 25, 2016): No I believe it was still working fine on the latest tag 2.2.0, you should be able to reproduce by renaming a file and having one of those character in the filename.
Author
Owner

@phanan commented on GitHub (Mar 26, 2016):

Hmm I tested the master branch locally with those characters above, all was fine…
The only change I could think of that can modify the sync behavior (though very unlikely) is https://github.com/phanan/koel/blob/master/app/Services/Media.php#L102. Can you try removing the line and see?

<!-- gh-comment-id:201635281 --> @phanan commented on GitHub (Mar 26, 2016): Hmm I tested the master branch locally with those characters above, all was fine… The only change I could think of that can modify the sync behavior (though very unlikely) is https://github.com/phanan/koel/blob/master/app/Services/Media.php#L102. Can you try removing the line and see?
Author
Owner

@BernardGoldberger commented on GitHub (Mar 27, 2016):

Tried suggested and the same was still happening but I had some time and began going through the commits and found that it breaks at github.com/phanan/koel@d8d2dc8a5d and on commit github.com/phanan/koel@66f68d65cf it still works.

An important note thugh is that because it errors out I actually noticed that even before github.com/phanan/koel@d8d2dc8a5d if these weird characters are in there it says Benny Friedman-Kol Haneshama Sheli-10-Yesoid V?shoiresh.mp3 is not a valid media file but continues on to the next file.

<!-- gh-comment-id:201970774 --> @BernardGoldberger commented on GitHub (Mar 27, 2016): Tried suggested and the same was still happening but I had some time and began going through the commits and found that it breaks at https://github.com/phanan/koel/commit/d8d2dc8a5d0bb8a8bacef143fd9d5f14a01e12cd and on commit https://github.com/phanan/koel/commit/66f68d65cfd28033328c09b6555fce6d9f8273b9 it still works. An important note thugh is that because it errors out I actually noticed that even before https://github.com/phanan/koel/commit/d8d2dc8a5d0bb8a8bacef143fd9d5f14a01e12cd if these weird characters are in there it says `Benny Friedman-Kol Haneshama Sheli-10-Yesoid V?shoiresh.mp3 is not a valid media file` but continues on to the next file.
Author
Owner

@phanan commented on GitHub (Mar 27, 2016):

From the trace, the error comes from C:\wamp64\www\koel\app\Models\File.php:72 SplFileInfo->getMTime(). Can you try wrapping this call in a try... catch and see what the error is? Sorry to keep bothering you, this looks like a Windows-specific bug to me, and I don't have a Windows box to test.

<!-- gh-comment-id:201980531 --> @phanan commented on GitHub (Mar 27, 2016): From the trace, the error comes from `C:\wamp64\www\koel\app\Models\File.php:72 SplFileInfo->getMTime()`. Can you try wrapping this call in a `try... catch` and see what the error is? Sorry to keep bothering you, this looks like a Windows-specific bug to me, and I don't have a Windows box to test.
Author
Owner

@BernardGoldberger commented on GitHub (Mar 27, 2016):

So I did the following

    try
    {
    $this->mtime = $this->splFileInfo->getMTime();
    }
    catch (Exception $e)
    {
    Log::info($e);
    }

and here is the output

[2016-03-27 14:14:32] production.INFO: RuntimeException: SplFileInfo::getMTime(): stat failed for \01-Ya'alili?.m4a in C:\wamp64\www\koel\app\Models\File.php:74 Stack trace: #0 C:\wamp64\www\koel\app\Models\File.php(74): SplFileInfo->getMTime() #1 C:\wamp64\www\koel\app\Services\Media.php(64): App\Models\File->__construct(Object(Symfony\Component\Finder\SplFileInfo), Object(getID3)) #2 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(227): App\Services\Media->sync('C:\\wamp64\\Music', Array, false, Object(App\Console\Commands\SyncMedia)) #3 C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php(75): Illuminate\Support\Facades\Facade::__callStatic('sync', Array) #4 C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php(55): App\Console\Commands\SyncMedia->syncAll() #5 [internal function]: App\Console\Commands\SyncMedia->handle() #6 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Container\Container.php(507): call_user_func_array(Array, Array) #7 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php(169): Illuminate\Container\Container->call(Array) #8 C:\wamp64\www\koel\vendor\symfony\console\Command\Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #9 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #10 C:\wamp64\www\koel\vendor\symfony\console\Application.php(791): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #11 C:\wamp64\www\koel\vendor\symfony\console\Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\SyncMedia), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #12 C:\wamp64\www\koel\vendor\symfony\console\Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #13 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #14 C:\wamp64\www\koel\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 {main}

The interesting thing is that once I have the try...catch it doesn't stop the scan anymore and it just continues the it would before github.com/phanan/koel@d8d2dc8a5d

I hope I got you what you need, I'm not an advanced programmer.

<!-- gh-comment-id:202077870 --> @BernardGoldberger commented on GitHub (Mar 27, 2016): So I did the following ``` try { $this->mtime = $this->splFileInfo->getMTime(); } catch (Exception $e) { Log::info($e); } ``` and here is the output `[2016-03-27 14:14:32] production.INFO: RuntimeException: SplFileInfo::getMTime(): stat failed for \01-Ya'alili?.m4a in C:\wamp64\www\koel\app\Models\File.php:74 Stack trace: #0 C:\wamp64\www\koel\app\Models\File.php(74): SplFileInfo->getMTime() #1 C:\wamp64\www\koel\app\Services\Media.php(64): App\Models\File->__construct(Object(Symfony\Component\Finder\SplFileInfo), Object(getID3)) #2 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(227): App\Services\Media->sync('C:\\wamp64\\Music', Array, false, Object(App\Console\Commands\SyncMedia)) #3 C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php(75): Illuminate\Support\Facades\Facade::__callStatic('sync', Array) #4 C:\wamp64\www\koel\app\Console\Commands\SyncMedia.php(55): App\Console\Commands\SyncMedia->syncAll() #5 [internal function]: App\Console\Commands\SyncMedia->handle() #6 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Container\Container.php(507): call_user_func_array(Array, Array) #7 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php(169): Illuminate\Container\Container->call(Array) #8 C:\wamp64\www\koel\vendor\symfony\console\Command\Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #9 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Console\Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #10 C:\wamp64\www\koel\vendor\symfony\console\Application.php(791): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #11 C:\wamp64\www\koel\vendor\symfony\console\Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\SyncMedia), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #12 C:\wamp64\www\koel\vendor\symfony\console\Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #13 C:\wamp64\www\koel\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #14 C:\wamp64\www\koel\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 {main}` The interesting thing is that once I have the try...catch it doesn't stop the scan anymore and it just continues the it would before https://github.com/phanan/koel/commit/d8d2dc8a5d0bb8a8bacef143fd9d5f14a01e12cd I hope I got you what you need, I'm not an advanced programmer.
Author
Owner

@phanan commented on GitHub (Apr 1, 2016):

I can't reproduce, sorry :(

<!-- gh-comment-id:204328892 --> @phanan commented on GitHub (Apr 1, 2016): I can't reproduce, sorry :(
Author
Owner

@BernardGoldberger commented on GitHub (Apr 1, 2016):

Thats alright, Thank You :-)

I did a lot of research on this and you are definitely correct about it being a windows issue and I'm still investigating to find a permanent solution and will comment.

For now I found a way around by changing the "system locale" to Hebrew (Israel)
image

Closing Issue

<!-- gh-comment-id:204499688 --> @BernardGoldberger commented on GitHub (Apr 1, 2016): Thats alright, Thank You :-) I did a lot of research on this and you are definitely correct about it being a windows issue and I'm still investigating to find a permanent solution and will comment. For now I found a way around by changing the "system locale" to Hebrew (Israel) ![image](https://cloud.githubusercontent.com/assets/10334679/14215911/ed5a04f2-f813-11e5-9e23-ac1d01a824ae.png) Closing Issue
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#205
No description provided.