[GH-ISSUE #393] Bug: if condition for Last.fm & YouTube #283

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

Originally created by @BernardGoldberger on GitHub (Aug 3, 2016).
Original GitHub issue: https://github.com/koel/koel/issues/393

Windows, Master, Opera and Firefox.

Every 1 out of 5 or 6 times I load Koel it seems that the if (YouTube::enabled() and if (Lastfm::used() are either returning false or are just simply not loading.
image

I have no errors in the console or the log file, I'm not sure if this is a new bug as it might have been happening with Last.fm but I just didn't notice. I should point out that even when Last.fm says that its not integrated it will still get content info and display it but obviously that is not the case for YouTube.

I tried finding some kind of pattern but was unsuccessful, I tried a try catch and log but got nothing.

If there any tests I could to track this down, let me know.

Originally created by @BernardGoldberger on GitHub (Aug 3, 2016). Original GitHub issue: https://github.com/koel/koel/issues/393 Windows, Master, Opera and Firefox. Every 1 out of 5 or 6 times I load Koel it seems that the `if (YouTube::enabled()` and `if (Lastfm::used()` are either returning `false` or are just simply not loading. ![image](https://cloud.githubusercontent.com/assets/10334679/17372022/17487c68-5970-11e6-8afe-d0119e9deab8.png) I have no errors in the console or the log file, I'm not sure if this is a new bug as it might have been happening with Last.fm but I just didn't notice. I should point out that even when Last.fm says that its not integrated it **will still get content info and display it** but obviously that is not the case for YouTube. I tried finding some kind of pattern but was unsuccessful, I tried a `try catch` and `log` but got nothing. If there any tests I could to track this down, let me know.
kerem closed this issue 2026-02-26 02:32:40 +03:00
Author
Owner

@phanan commented on GitHub (Aug 7, 2016):

This is weird. I can't reproduce this.

<!-- gh-comment-id:238075092 --> @phanan commented on GitHub (Aug 7, 2016): This is weird. I can't reproduce this.
Author
Owner

@BernardGoldberger commented on GitHub (Aug 7, 2016):

Might be an issue specific to Windows.

<!-- gh-comment-id:238089612 --> @BernardGoldberger commented on GitHub (Aug 7, 2016): Might be an issue specific to Windows.
Author
Owner

@phanan commented on GitHub (Aug 8, 2016):

Thanks for the provided info. I confirm that this happens on your server, but still, I don't think this is a Koel bug per se. If you look at the code (I'm sure you did), YouTube::enabled() simply calls return (bool) env('YOUTUBE_API_KEY');. Maybe this has something to do with how PHP is installed/configured on your server, or (less likely) a bug with Laravel or phpdotenv. Can you try running a simple phpdotenv include (not Koel-related) and see if the bug is there?

<!-- gh-comment-id:238136489 --> @phanan commented on GitHub (Aug 8, 2016): Thanks for the provided info. I confirm that this happens on your server, but still, I don't think this is a Koel bug per se. If you look at the code (I'm sure you did), `YouTube::enabled()` simply calls `return (bool) env('YOUTUBE_API_KEY');`. Maybe this has something to do with how PHP is installed/configured on your server, or (less likely) a bug with Laravel or [phpdotenv](https://github.com/vlucas/phpdotenv). Can you try running a simple phpdotenv include (not Koel-related) and see if the bug is there?
Author
Owner

@BernardGoldberger commented on GitHub (Aug 9, 2016):

I ran some tests outside of Koel and had no issues.

The only thing I did notice is that there is no issue when I have Koel running through Nginx. It seems that the combination of Koel and Apache Proxy'd through CloudFlare is what's causing the issue.

I guess there is no point in keeping this open as its very unlikely I will be able to drill down and figure out what it is.

<!-- gh-comment-id:238636114 --> @BernardGoldberger commented on GitHub (Aug 9, 2016): I ran some tests outside of Koel and had no issues. The only thing I did notice is that there is no issue when I have Koel running through Nginx. It seems that the combination of Koel and Apache Proxy'd through CloudFlare is what's causing the issue. I guess there is no point in keeping this open as its very unlikely I will be able to drill down and figure out what it is.
Author
Owner

@phanan commented on GitHub (Aug 10, 2016):

Sounds like a Cloudflare cache issue to me.

On Wednesday, August 10, 2016, bdgold notifications@github.com wrote:

I ran some tests outside of Koel and had no issues.

The only thing I did notice is that there is no issue when I have Koel
running through Nginx. It seems that the combination of Koel and Apache
Proxy'd through CloudFlare is what's causing the issue.

I guess there is no point in keeping this open as its very unlikely I will
be able to drill down and figure out what it is.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/phanan/koel/issues/393#issuecomment-238636114, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHrt0gEFI866-G7Ra-TuptCuycpEjJu_ks5qeL9ggaJpZM4Jbz8P
.

<!-- gh-comment-id:238735259 --> @phanan commented on GitHub (Aug 10, 2016): Sounds like a Cloudflare cache issue to me. On Wednesday, August 10, 2016, bdgold notifications@github.com wrote: > I ran some tests outside of Koel and had no issues. > > The only thing I did notice is that there is no issue when I have Koel > running through Nginx. It seems that the combination of Koel and Apache > Proxy'd through CloudFlare is what's causing the issue. > > I guess there is no point in keeping this open as its very unlikely I will > be able to drill down and figure out what it is. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > https://github.com/phanan/koel/issues/393#issuecomment-238636114, or mute > the thread > https://github.com/notifications/unsubscribe-auth/AHrt0gEFI866-G7Ra-TuptCuycpEjJu_ks5qeL9ggaJpZM4Jbz8P > .
Author
Owner

@BernardGoldberger commented on GitHub (Aug 10, 2016):

I did turn off caching but still I would have issues, I do agree that it seems to be a cloudflare issue when I'm running Koel on Apache.

I did find this article and decided to go ahead and turn off Rocket Loader with a page rule and it does seem like its not happening as often.
image

When using cloudflare there are so many things in play that it becomes a real challenge to pin-point where an an issue is originating from.

Rocket Loader seems to have been a contributing factor.

Until others complain about this, I don't think we need worrying.

<!-- gh-comment-id:238742084 --> @BernardGoldberger commented on GitHub (Aug 10, 2016): I did turn off caching but still I would have issues, I do agree that it seems to be a cloudflare issue when I'm running Koel on Apache. I did find [this article](https://blog.cloudflare.com/cloudflare-tips-troubleshooting-common-proble/) and decided to go ahead and turn off `Rocket Loader` with a page rule and it does seem like its not happening as often. ![image](https://cloud.githubusercontent.com/assets/10334679/17539005/6c8ebab8-5e78-11e6-8f3e-1c148629b833.png) When using cloudflare there are so many things in play that it becomes a real challenge to pin-point where an an issue is originating from. `Rocket Loader` seems to have been a contributing factor. Until others complain about this, I don't think we need worrying.
Author
Owner

@akirakyle commented on GitHub (Aug 14, 2016):

Hi, I seem to be having an issue somewhat similar to this, however after upgrading I have yet to see the youtube tab appear. YouTube does seem to be receiving the API requests as it is reporting a new request everytime I play a song, also I have confirmed YouTube::enabled() is returning true.
I am running Apache on Arch linux, and have confirmed that this persists across firefox on both windows and mac, and chrome and safari on mac. I'm not really sure how to go about troubleshooting this as I don't really have any webdev experience.

<!-- gh-comment-id:239648339 --> @akirakyle commented on GitHub (Aug 14, 2016): Hi, I seem to be having an issue somewhat similar to this, however after upgrading I have yet to see the youtube tab appear. YouTube does seem to be receiving the API requests as it is reporting a new request everytime I play a song, also I have confirmed `YouTube::enabled()` is returning `true`. I am running Apache on Arch linux, and have confirmed that this persists across firefox on both windows and mac, and chrome and safari on mac. I'm not really sure how to go about troubleshooting this as I don't really have any webdev experience.
Author
Owner

@BernardGoldberger commented on GitHub (Aug 14, 2016):

after upgrading I have yet to see the youtube tab appear.

After upgrading what? Koel or something else?

<!-- gh-comment-id:239702889 --> @BernardGoldberger commented on GitHub (Aug 14, 2016): > after upgrading I have yet to see the youtube tab appear. After upgrading what? Koel or something else?
Author
Owner

@akirakyle commented on GitHub (Aug 17, 2016):

After upgrading Koel from v3.1.1 to v3.2.0

<!-- gh-comment-id:240303527 --> @akirakyle commented on GitHub (Aug 17, 2016): After upgrading Koel from v3.1.1 to v3.2.0
Author
Owner

@phanan commented on GitHub (Aug 17, 2016):

@akirakyle Have you tried rm -rf node_modules && npm install?

<!-- gh-comment-id:240304343 --> @phanan commented on GitHub (Aug 17, 2016): @akirakyle Have you tried `rm -rf node_modules && npm install`?
Author
Owner

@akirakyle commented on GitHub (Aug 21, 2016):

I managed to fix it, I had previously run rm -rf node_modules && npm install as per the upgrade guide, but I failed to notice the the warning npm gave:
npm WARN lifecycle koel@~postinstall: cannot run in wd %s %s (wd=%s) koel@ cross-env NODE_ENV=production && gulp --production /usr/share/webapps/koel
So this time running rm -rf node_modules && npm install --unsafe-perm seems to have worked.

<!-- gh-comment-id:241280161 --> @akirakyle commented on GitHub (Aug 21, 2016): I managed to fix it, I had previously run `rm -rf node_modules && npm install` as per the upgrade guide, but I failed to notice the the warning npm gave: `npm WARN lifecycle koel@~postinstall: cannot run in wd %s %s (wd=%s) koel@ cross-env NODE_ENV=production && gulp --production /usr/share/webapps/koel` So this time running `rm -rf node_modules && npm install --unsafe-perm` seems to have worked.
Author
Owner

@jujes commented on GitHub (Dec 6, 2016):

Hi, some possibility to expand youtube feature and save videos into playlists?
thanks in advance,

<!-- gh-comment-id:265296011 --> @jujes commented on GitHub (Dec 6, 2016): Hi, some possibility to expand youtube feature and save videos into playlists? thanks in advance,
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#283
No description provided.