[GH-ISSUE #1221] Koel doesn't load covers, albums and artist #696

Closed
opened 2026-02-26 02:33:59 +03:00 by kerem · 13 comments
Owner

Originally created by @NooodyFR on GitHub (Apr 24, 2020).
Original GitHub issue: https://github.com/koel/koel/issues/1221

Describe the bug
Koel does not load album covers, despite the fact that the covers are in the file and in a cover.jpg or cover.png file in the album folder.
It also does not load the albums in the Albums category, nor does it load the artists.

To reproduce
Steps to reproduce the behavior:

  1. Import your music
  2. Scan directory
  3. Play a music / Go to Albums / Go to Artists
  4. Open console and see error

Expected behavior
Preview the album cover

Screenshots
Album
Artists
No covers
Errors

Environment

Additional context
It just don't load, I also checked the files in /public/img/covers, there is only a file name unknown-album.png

Originally created by @NooodyFR on GitHub (Apr 24, 2020). Original GitHub issue: https://github.com/koel/koel/issues/1221 **Describe the bug** Koel does not load album covers, despite the fact that the covers are in the file and in a cover.jpg or cover.png file in the album folder. It also does not load the albums in the Albums category, nor does it load the artists. **To reproduce** Steps to reproduce the behavior: 1. Import your music 2. Scan directory 3. Play a music / Go to Albums / Go to Artists 4. Open console and see error **Expected behavior** Preview the album cover **Screenshots** [Album](https://i.imgur.com/LbC8rIX.png) [Artists](https://i.imgur.com/sbavOMS.png) [No covers](https://i.imgur.com/StaC5Id.png) [Errors](https://i.imgur.com/sYClyVn.png) **Environment** - Koel version d55a823 (clonned repo https://github.com/phanan/koel.git) - OS: Server Debian 10 - Client Windows 10 - Browser Chrome 81.0.4044.113 - PHP version 7.3.17 - Node version v13.11.0 **Additional context** It just don't load, I also checked the files in /public/img/covers, there is only a file name unknown-album.png
Author
Owner

@BrookeDot commented on GitHub (Apr 25, 2020):

Hi @NooodyFR I don't believe Koel currently supports Node 13.11.0 can you please downgrade to Node 12 which is the current LTS?

In addition, the PR you linked to is an older version of Node, can you please upgrade to 4.3.1 which was released this week? We don't want to try to support older versions.

It would also be helpful to know if there are any errors in your PHP, Node, or MySQL logs since nothing is loading the problem is likely not with Koel itself but with something on your server.

<!-- gh-comment-id:619324784 --> @BrookeDot commented on GitHub (Apr 25, 2020): Hi @NooodyFR I don't believe Koel currently supports Node 13.11.0 can you please downgrade to Node 12 which is the current LTS? In addition, the PR you linked to is an older version of Node, can you please upgrade to 4.3.1 which was released this week? We don't want to try to support older versions. It would also be helpful to know if there are any errors in your PHP, Node, or MySQL logs since nothing is loading the problem is likely not with Koel itself but with something on your server.
Author
Owner

@NooodyFR commented on GitHub (Apr 25, 2020):

I have switched to Koel 4.3.1 and downgraded to Node 12.16.2, and now some covers are loading but not all, and artists too but without images, there is no errors in the console now and there are no errors in the Mysql, PHP and Node logs.

<!-- gh-comment-id:619367925 --> @NooodyFR commented on GitHub (Apr 25, 2020): I have switched to Koel 4.3.1 and downgraded to Node 12.16.2, and now [some covers are loading](https://i.imgur.com/2rjzcUA.png) but not all, and artists [too but without images](https://i.imgur.com/WKwZ4dk.png), there is no errors in the console now and there are no errors in the Mysql, PHP and Node logs.
Author
Owner

@songliqiangcn commented on GitHub (May 5, 2020):

I have same issue.
Environment

Koel: v4.3.1
OS: Ubuntu18.04
Browser Chrome Version 81.0.4044.129 (Official Build) (64-bit)
PHP 7.2.24-0ubuntu0.18.04.4 (cli) (built: Apr 8 2020 15:45:57) ( NTS )
Node version v12.16.3

Screenshot from 2020-05-05 23-39-05

<!-- gh-comment-id:624059686 --> @songliqiangcn commented on GitHub (May 5, 2020): I have same issue. Environment Koel: v4.3.1 OS: Ubuntu18.04 Browser Chrome Version 81.0.4044.129 (Official Build) (64-bit) PHP 7.2.24-0ubuntu0.18.04.4 (cli) (built: Apr 8 2020 15:45:57) ( NTS ) Node version v12.16.3 ![Screenshot from 2020-05-05 23-39-05](https://user-images.githubusercontent.com/12743413/81072605-ba490480-8f29-11ea-935d-9aaad3f5a8c1.png)
Author
Owner

@phanan commented on GitHub (May 6, 2020):

I don't believe Koel currently supports Node 13.11.0

Correction: Koel should support all officially-supported Node versions.

It also does not load the albums in the Albums category, nor does it load the artists.

This has been fixed in the latest version.

some covers are loading but not all

This means Koel was able to extract the covers from some of your media but not others. I can't really help here without looking at the files.

and artists too but without images

Judging from the screenshot, there must be 404-error requests in the Network tab. Please have a look and see what they are.

I can't reproduce this problem with my own Koel installation.

<!-- gh-comment-id:624540941 --> @phanan commented on GitHub (May 6, 2020): > I don't believe Koel currently supports Node 13.11.0 Correction: Koel should support all officially-supported Node versions. > It also does not load the albums in the Albums category, nor does it load the artists. This has been fixed in the latest version. > some covers are loading but not all This means Koel was able to extract the covers from some of your media but not others. I can't really help here without looking at the files. > and artists too but without images Judging from the screenshot, there must be 404-error requests in the Network tab. Please have a look and see what they are. I can't reproduce this problem with my own Koel installation.
Author
Owner

@BrookeDot commented on GitHub (May 6, 2020):

Koel should support all officially-supported Node versions.

This is great to hear, I know when I first started using Koel it didn't support Node 12 which was fixed at some point. Can you clarify this a bit? By current you mean anything that is current here:
https://nodejs.org/en/about/releases/

I tend to stick to LTS, but it sounds like you are saying that Koel should work with Node 10,12,13,14,and 15?

<!-- gh-comment-id:624685769 --> @BrookeDot commented on GitHub (May 6, 2020): > Koel should support all officially-supported Node versions. This is great to hear, I know when I first started using Koel it didn't support Node 12 which was fixed at some point. Can you clarify this a bit? By current you mean anything that is current here: https://nodejs.org/en/about/releases/ I tend to stick to LTS, but it sounds like you are saying that Koel should work with Node 10,12,13,14,and 15?
Author
Owner

@phanan commented on GitHub (May 6, 2020):

Yeah, for example, this is one of the builds: https://travis-ci.org/github/koel/core/builds/682680047. The branch is ts (TypeScript, as I'm porting Koel's core to TS), but the same should apply for JS.

<!-- gh-comment-id:624690074 --> @phanan commented on GitHub (May 6, 2020): Yeah, for example, this is one of the builds: https://travis-ci.org/github/koel/core/builds/682680047. The branch is `ts` (TypeScript, as I'm porting Koel's core to TS), but the same should apply for JS.
Author
Owner

@mshernandez5 commented on GitHub (Jun 13, 2020):

I have this same issue with a new installation of Koel v4.4.0, all album covers are missing in the interface:

image

The cover files were generated in the public/img/covers directory and Koel has permissions to search the cover directory and read all of its contents:

image

The entries even exist in the database:

image

There doesn't appear to be any 404 errors, the client only appears to attempt to fetch the default album cover:

image

Originally, the database and covers folder were not populated but I saw the the logs were complaining about missing php-gd; I installed this and dropped/reinitialized the database which created all the album cover images but still does not display them in the client. There are no longer any issues in the log files.

Any suggestions?

Server:
Ubuntu Server 20.04
Node v12.18.0
PHP v7.4.3

Browsers Tested:
Firefox 77.0.1
Chromium Version 83.0.4103.61

<!-- gh-comment-id:643532148 --> @mshernandez5 commented on GitHub (Jun 13, 2020): I have this same issue with a new installation of Koel v4.4.0, all album covers are missing in the interface: ![image](https://user-images.githubusercontent.com/62854710/84555004-86eb5980-accf-11ea-9acd-817b3360c60f.png) The cover files were generated in the public/img/covers directory and Koel has permissions to search the cover directory and read all of its contents: ![image](https://user-images.githubusercontent.com/62854710/84555262-e5fd9e00-acd0-11ea-8d3b-7aa6055db95b.png) The entries even exist in the database: ![image](https://user-images.githubusercontent.com/62854710/84555360-54daf700-acd1-11ea-947c-7888ce2b5b0c.png) There doesn't appear to be any 404 errors, the client only appears to attempt to fetch the default album cover: ![image](https://user-images.githubusercontent.com/62854710/84555661-d5e6be00-acd2-11ea-946e-b1e12712338d.png) Originally, the database and covers folder were not populated but I saw the the logs were complaining about missing php-gd; I installed this and dropped/reinitialized the database which created all the album cover images but still does not display them in the client. There are no longer any issues in the log files. Any suggestions? Server: Ubuntu Server 20.04 Node v12.18.0 PHP v7.4.3 Browsers Tested: Firefox 77.0.1 Chromium Version 83.0.4103.61
Author
Owner

@phanan commented on GitHub (Jun 13, 2020):

Looks like Koel can't find the covers for some reason. If you put some debug statements e.g. dd(public_path("/public/img/covers/$cover")) at Album.php:93 what does it say?

<!-- gh-comment-id:643587711 --> @phanan commented on GitHub (Jun 13, 2020): Looks like Koel can't find the covers for some reason. If you put some debug statements e.g. `dd(public_path("/public/img/covers/$cover"))` at `Album.php:93` what does it say?
Author
Owner

@mshernandez5 commented on GitHub (Jun 13, 2020):

image

The issue has resolved itself after another forced sync, but I did not make any modifications other than importing Illuminate\Support\Facades\Log and adding a log statement or two in the Album.php file.

I was poking around the functions and when logging the $value parameter of getCoverAttribute(?string $value) found that is was null for all albums when the covers didn't work and contained the correct file names after it suddenly began working.

The getCoverPathAttribute() function did not appear to run and I did not get any output when logging a string at the beginning of the function.

I apologize that I can't give you better insight into what went wrong when it was acting up, I am not familiar with PHP/Laravel/Koel so I'm not exactly sure where these methods are being called from and how their results are used.

Thanks for your work by the way this is an awesome project!

<!-- gh-comment-id:643692295 --> @mshernandez5 commented on GitHub (Jun 13, 2020): ![image](https://user-images.githubusercontent.com/62854710/84581102-486aa300-ad92-11ea-8d54-378f92ace95a.png) The issue has resolved itself after another forced sync, but I did not make any modifications other than importing Illuminate\Support\Facades\Log and adding a log statement or two in the Album.php file. I was poking around the functions and when logging the `$value` parameter of `getCoverAttribute(?string $value)` found that is was null for all albums when the covers didn't work and contained the correct file names after it suddenly began working. The `getCoverPathAttribute()` function did not appear to run and I did not get any output when logging a string at the beginning of the function. I apologize that I can't give you better insight into what went wrong when it was acting up, I am not familiar with PHP/Laravel/Koel so I'm not exactly sure where these methods are being called from and how their results are used. Thanks for your work by the way this is an awesome project!
Author
Owner

@phanan commented on GitHub (Aug 4, 2020):

Glad it works for you :)

<!-- gh-comment-id:668459669 --> @phanan commented on GitHub (Aug 4, 2020): Glad it works for you :)
Author
Owner

@phanan commented on GitHub (Aug 4, 2020):

Great music taste btw!

<!-- gh-comment-id:668459833 --> @phanan commented on GitHub (Aug 4, 2020): Great music taste btw!
Author
Owner

@manjotsc commented on GitHub (Aug 12, 2021):

@mshernandez5 How do I reinitialize the database?

<!-- gh-comment-id:897331439 --> @manjotsc commented on GitHub (Aug 12, 2021): @mshernandez5 How do I reinitialize the database?
Author
Owner

@mshernandez5 commented on GitHub (Aug 12, 2021):

@mshernandez5 How do I reinitialize the database?

Hello, it's been awhile since I had this problem and had to mess with the setup but I believe you can start fresh by dropping and recreating the database (ex. through mysql console command if you are using MariaDB or MySQL but varies based on which database you are using) and then running php artisan koel:init again to recreate all the (now empty) tables and everything.

Make sure to keep the database name the same after recreating it unless you change the Koel configuration to match and you will also have to re-grant permissions to the database user.

ex. SQL Statements:

DROP DATABASE koeldb;
CREATE DATABASE koeldb;
GRANT ALL PRIVILEGES ON koeldb.* TO koeluser;
FLUSH PRIVILEGES;

Replacing koeldb and koeluser with whatever the database and usernames are.

I don't remember finding out exactly what fixed this issue but I think all I did was install php-gd package, double check that the permissions were right for the Koel directory, and reset the database.

<!-- gh-comment-id:897491922 --> @mshernandez5 commented on GitHub (Aug 12, 2021): > @mshernandez5 How do I reinitialize the database? Hello, it's been awhile since I had this problem and had to mess with the setup but I believe you can start fresh by dropping and recreating the database (ex. through `mysql` console command if you are using MariaDB or MySQL but varies based on which database you are using) and then running `php artisan koel:init` again to recreate all the (now empty) tables and everything. Make sure to keep the database name the same after recreating it unless you change the Koel configuration to match and you will also have to re-grant permissions to the database user. ex. SQL Statements: ```sql DROP DATABASE koeldb; CREATE DATABASE koeldb; GRANT ALL PRIVILEGES ON koeldb.* TO koeluser; FLUSH PRIVILEGES; ``` Replacing `koeldb` and `koeluser` with whatever the database and usernames are. I don't remember finding out exactly what fixed this issue but I think all I did was install php-gd package, double check that the permissions were right for the Koel directory, and reset the database.
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#696
No description provided.