[GH-ISSUE #1926] [Bug?]: #1038

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

Originally created by @camagada on GitHub (May 18, 2025).
Original GitHub issue: https://github.com/koel/koel/issues/1926

Originally assigned to: @phanan on GitHub.

Read the Troubleshooting guide.

  • I have read and followed the Troubleshooting guide

Reproduction steps

Hello
I installed Koel on an LXC, with Ubuntu version 24.
It is working 100% with the admin user.
When I add another user who is not an admin and create a playlist, it does not open the songs. When I log out and try to log in with this user again, the following message appears:

"App\Repositories\SongRepository::getMany(): Argument #1 ($ids) must be of type array, null given, called in /var/www/koel/app/Services/QueueService.php on line 29"

When I log in as admin, it continues to work normally.
I changed this other user as admin, however, it also showed the same message.

installed: v7.4.0

Expected behavior

log in to the system normally

Actual behavior

error: "App\Repositories\SongRepository::getMany(): Argument #1 ($ids) must be of type array, null given, called in /var/www/koel/app/Services/QueueService.php on line 29"

Logs

#22 /var/www/koel/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(681): Illuminate\Log\Logger->error()
#23 /var/www/koel/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(317): Illuminate\Log\LogManager->error()
[2025-05-18 02:09:01] production.ERROR: syntax error, unexpected token "public", expecting end of file {"exception":"[object] (ParseError(code: 0): syntax error, unexpected token "public", expecting end of file at /var/www/koel/app/Providers/AppServiceProvider.php:60)

[2025-05-18 07:58:11] production.ERROR: Failed attempt {"error":"[object] (Intervention\Image\Exception\NotReadableException(code: 0): Unable to init from given binary data. at /var/www/koel/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:131)

Koel version

v7.4.0

How did you install Koel?

Compiled from source

Additional information

Ubuntu 24.10
PHP 8.3.11
mysql Ver 8.0.42-0
node v20.16.0
npm 9.2.0

Originally created by @camagada on GitHub (May 18, 2025). Original GitHub issue: https://github.com/koel/koel/issues/1926 Originally assigned to: @phanan on GitHub. ### Read the Troubleshooting guide. - [x] I have read and followed the Troubleshooting guide ### Reproduction steps Hello I installed Koel on an LXC, with Ubuntu version 24. It is working 100% with the admin user. When I add another user who is not an admin and create a playlist, it does not open the songs. When I log out and try to log in with this user again, the following message appears: **"App\Repositories\SongRepository::getMany(): Argument #1 ($ids) must be of type array, null given, called in /var/www/koel/app/Services/QueueService.php on line 29"** When I log in as admin, it continues to work normally. I changed this other user as admin, however, it also showed the same message. installed: v7.4.0 ### Expected behavior log in to the system normally ### Actual behavior error: **"App\Repositories\SongRepository::getMany(): Argument #1 ($ids) must be of type array, null given, called in /var/www/koel/app/Services/QueueService.php on line 29"** ### Logs #22 /var/www/koel/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(681): Illuminate\\Log\\Logger->error() #23 /var/www/koel/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(317): Illuminate\\Log\\LogManager->error() [2025-05-18 02:09:01] production.ERROR: syntax error, unexpected token "public", expecting end of file {"exception":"[object] (ParseError(code: 0): syntax error, unexpected token \"public\", expecting end of file at /var/www/koel/app/Providers/AppServiceProvider.php:60) [2025-05-18 07:58:11] production.ERROR: Failed attempt {"error":"[object] (Intervention\\Image\\Exception\\NotReadableException(code: 0): Unable to init from given binary data. at /var/www/koel/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:131) ### Koel version v7.4.0 ### How did you install Koel? Compiled from source ### Additional information Ubuntu 24.10 PHP 8.3.11 mysql Ver 8.0.42-0 node v20.16.0 npm 9.2.0
kerem closed this issue 2026-02-26 02:35:01 +03:00
Author
Owner

@phanan commented on GitHub (May 18, 2025):

I can't reproduce the bug with the exact same details. Let's look at the code in QueueService.php:L28:

return QueueStateDTO::make(
    $this->songRepository->getMany(ids: $state->song_ids, preserveOrder: true, scopedUser: $user),
    $currentSong,
    $state->playback_position ?? 0
);

I don't see how $state->song_ids can be null, as a cast is in place in App\Models\QueueState:L22:

protected $casts = [
    'song_ids' => 'array',
    'playback_position' => 'int',
];

Can you help dig into the database and see what value song_ids holds?

<!-- gh-comment-id:2889142674 --> @phanan commented on GitHub (May 18, 2025): I can't reproduce the bug with the exact same details. Let's look at the code in QueueService.php:L28: ```php return QueueStateDTO::make( $this->songRepository->getMany(ids: $state->song_ids, preserveOrder: true, scopedUser: $user), $currentSong, $state->playback_position ?? 0 ); ``` I don't see how `$state->song_ids` can be null, as a cast is in place in App\Models\QueueState:L22: ```php protected $casts = [ 'song_ids' => 'array', 'playback_position' => 'int', ]; ``` Can you help dig into the database and see what value `song_ids` holds?
Author
Owner

@camagada commented on GitHub (May 19, 2025):

Solved.

I deleted the MySQL database and re-ran the KOEL INSTALLATION WIZARD.

Thanks for the feedback :)

<!-- gh-comment-id:2891032770 --> @camagada commented on GitHub (May 19, 2025): Solved. I deleted the MySQL database and re-ran the KOEL INSTALLATION WIZARD. Thanks for the feedback :)
Author
Owner

@phanan commented on GitHub (May 19, 2025):

Great!

<!-- gh-comment-id:2891204061 --> @phanan commented on GitHub (May 19, 2025): Great!
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#1038
No description provided.