[GH-ISSUE #766] Koel server working, but seemingly spontaneous trouble logging in #550

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

Originally created by @hexydes on GitHub (Jul 16, 2018).
Original GitHub issue: https://github.com/koel/koel/issues/766

Hey, after some initial troubles, I was able to get Koel installed and working...mostly. After it initially started working, I added a bunch of music and synced it via SSH. Everything worked fine for about 12 hours, but I went to load the site up on my phone, and it wouldn't log in. I would enter the email and password, it looks like it "works" (no error about the wrong email/password), and then just refreshes the page back at the login. It seems similar to https://github.com/phanan/koel/issues/616 possibly. I shrugged my shoulders, figured something happened on the server, and thought I'd check it out in a few hours.

Then, without doing anything on the server, it started working again. Fine, whatever, chalk it up as an anomaly. It went on working for the rest of the next day (as far as I know, though I wasn't checking it constantly). However 24 hours later, it's back to not letting me log in again. It still seems to be working on my phone (that was left logged in), but I can't log in anywhere else. I tried a different browser on my phone, Chrome and Safari on my Mac, and none of them will log in.

I can dig up more environment details a little later if necessary, and will update if it starts working again spontaneously. If there are any error logs I can dig through, let me know and I'll check those as well. Thanks in advance!

Originally created by @hexydes on GitHub (Jul 16, 2018). Original GitHub issue: https://github.com/koel/koel/issues/766 Hey, after some initial troubles, I was able to get Koel installed and working...mostly. After it initially started working, I added a bunch of music and synced it via SSH. Everything worked fine for about 12 hours, but I went to load the site up on my phone, and it wouldn't log in. I would enter the email and password, it looks like it "works" (no error about the wrong email/password), and then just refreshes the page back at the login. It seems similar to https://github.com/phanan/koel/issues/616 possibly. I shrugged my shoulders, figured something happened on the server, and thought I'd check it out in a few hours. Then, without doing anything on the server, it started working again. Fine, whatever, chalk it up as an anomaly. It went on working for the rest of the next day (as far as I know, though I wasn't checking it constantly). However 24 hours later, it's back to not letting me log in again. It still seems to be working on my phone (that was left logged in), but I can't log in anywhere else. I tried a different browser on my phone, Chrome and Safari on my Mac, and none of them will log in. I can dig up more environment details a little later if necessary, and will update if it starts working again spontaneously. If there are any error logs I can dig through, let me know and I'll check those as well. Thanks in advance!
kerem closed this issue 2026-02-26 02:33:31 +03:00
Author
Owner

@hexydes commented on GitHub (Jul 16, 2018):

UPDATE
In checking the browser console, I receive:

GET https://mydomainhere.com/api/data 500 (Internal Server Error)

Thoughts on what that might be pointing to? Again, I didn't do anything on the server from when it WAS working to it NOT working, which makes me think something might be failing on the server end (Koel or not). I just tried restarting the server (Nginx) but no luck.

UPDATE 2
I tracked it down to this issue, via the error message "file_put_contents" and "failed to open stream: No such file or directory" that was coming up when watching the Network stream from the console. Issuing the command:

php artisan cache:clear

allowed me to successfully log in. I'm a bit concerned that it will just fail again in the future, and obviously I have a way to get around the problem, but I feel like I've treated the symptom, not the cause.

<!-- gh-comment-id:405334719 --> @hexydes commented on GitHub (Jul 16, 2018): **UPDATE** In checking the browser console, I receive: > GET https://mydomainhere.com/api/data 500 (Internal Server Error) Thoughts on what that might be pointing to? Again, I didn't do anything on the server from when it WAS working to it NOT working, which makes me think something might be failing on the server end (Koel or not). I just tried restarting the server (Nginx) but no luck. **UPDATE 2** I tracked it down to [this issue](https://stackoverflow.com/questions/32126122/file-put-contents-failed-to-open-stream-no-such-file-or-directory-laravel), via the error message "file_put_contents" and "failed to open stream: No such file or directory" that was coming up when watching the Network stream from the console. Issuing the command: > php artisan cache:clear allowed me to successfully log in. I'm a bit concerned that it will just fail again in the future, and obviously I have a way to get around the problem, but I feel like I've treated the symptom, not the cause.
Author
Owner

@gamerlv commented on GitHub (Jul 17, 2018):

I'm not entirely sure what is going on in your case I can give you some pointers where to look.

Firstly, file_put_contents() errors sound like some kind of permission issue. Does the webserver user (Usually www-data or apache) have full read and write rights to the cache folder and subfolders?

If that is the case you'll need to look into the log files for more info. Koel should keep a log file in either storage/logs/laravel.log or storage/app/koel.log not sure which, been a while.

Lastly a good place to look when you see http 500 error is the webserver error log. These sometime contain valuable clues. The default nginx error log is located at /var/log/nginx/error.log, the exact location depends on your server configuration.

<!-- gh-comment-id:405421086 --> @gamerlv commented on GitHub (Jul 17, 2018): I'm not entirely sure what is going on in your case I can give you some pointers where to look. Firstly, `file_put_contents()` errors sound like some kind of permission issue. Does the webserver user (Usually www-data or apache) have full read and write rights to the cache folder __and__ subfolders? If that is the case you'll need to look into the log files for more info. Koel should keep a log file in either `storage/logs/laravel.log` or `storage/app/koel.log` not sure which, been a while. Lastly a good place to look when you see http 500 error is the webserver error log. These sometime contain valuable clues. The default nginx error log is located at `/var/log/nginx/error.log`, the exact location depends on your server configuration.
Author
Owner

@hexydes commented on GitHub (Jul 17, 2018):

Thanks for the ideas @gamerlv ! I am using www-data as the user doing "Koel stuff" with Nginx. I'm not 100% sure if www-data has access to both read and write the cache folder/tree, I had a really bumpy install. That's something to check for sure (though it's weird that it just appears to lock up every 24 hours or so...maybe it's doing something with the cache periodically?).

I'll take a poke through the Koel/Nginx logs when I get a few minutes to see if there's anything interesting going on there.

Thanks!

<!-- gh-comment-id:405421770 --> @hexydes commented on GitHub (Jul 17, 2018): Thanks for the ideas @gamerlv ! I am using www-data as the user doing "Koel stuff" with Nginx. I'm not 100% sure if www-data has access to both read and write the cache folder/tree, I had a really bumpy install. That's something to check for sure (though it's weird that it just appears to lock up every 24 hours or so...maybe it's doing something with the cache periodically?). I'll take a poke through the Koel/Nginx logs when I get a few minutes to see if there's anything interesting going on there. Thanks!
Author
Owner

@hexydes commented on GitHub (Jul 30, 2018):

More updates on this, I haven't done anything new on the server, other than add some music. It seems like things work fine for about a week, and then suddenly, I'm just logged out. I'll SSH back into the server, issue a cache:clear command, and boom, everything is working fine. This isn't after adding music or anything, just sort of spontaneously just stops working (last time I added a track was at least 4 days ago, it worked fine that whole time until just now). Not sure what's going on, on the server end, to cause this to happen every so often. :(

<!-- gh-comment-id:408963812 --> @hexydes commented on GitHub (Jul 30, 2018): More updates on this, I haven't done anything new on the server, other than add some music. It seems like things work fine for about a week, and then suddenly, I'm just logged out. I'll SSH back into the server, issue a cache:clear command, and boom, everything is working fine. This isn't after adding music or anything, just sort of spontaneously just stops working (last time I added a track was at least 4 days ago, it worked fine that whole time until just now). Not sure what's going on, on the server end, to cause this to happen every so often. :(
Author
Owner

@xordspar0 commented on GitHub (Sep 10, 2018):

@hexydes Is this still happening? Did you get a chance to look at your logs? Could you post the errors recorded there?

<!-- gh-comment-id:420091833 --> @xordspar0 commented on GitHub (Sep 10, 2018): @hexydes Is this still happening? Did you get a chance to look at your logs? Could you post the errors recorded there?
Author
Owner

@hexydes commented on GitHub (Sep 11, 2018):

Hi @xordspar0 I have not had a chance to look at the logs, but I've also not run into the problem again for at least a month. I haven't made any changes on the server, but I also haven't added any additional music. Maybe soon I'll try adding a few more files, and see if that messes anything up.

<!-- gh-comment-id:420288606 --> @hexydes commented on GitHub (Sep 11, 2018): Hi @xordspar0 I have not had a chance to look at the logs, but I've also not run into the problem again for at least a month. I haven't made any changes on the server, but I also haven't added any additional music. Maybe soon I'll try adding a few more files, and see if that messes anything up.
Author
Owner

@psistorm commented on GitHub (Dec 14, 2018):

I'm having the same issue. I'm using the Docker image from binhex/arch-koel. I found out I needed to hit "Reload without cache" in the browser multiple times and finally it worked at some point. It also worked when typing in php artisan cache:clear like suggested above without hitting reload. Any suggestions where to look at?

<!-- gh-comment-id:447273016 --> @psistorm commented on GitHub (Dec 14, 2018): I'm having the same issue. I'm using the Docker image from binhex/arch-koel. I found out I needed to hit "Reload without cache" in the browser multiple times and finally it worked at some point. It also worked when typing in `php artisan cache:clear` like suggested above without hitting reload. Any suggestions where to look at?
Author
Owner

@Hyzual commented on GitHub (Feb 13, 2019):

I'm having the same issue, I get a 500 error repeatedly on /data while trying to log in.
The laravel cache show the following error (with 50 lines of stack trace)

[2019-02-13 08:01:05] production.ERROR: Tymon\JWTAuth\Exceptions\TokenInvalidException: Token Signature could not be verified. in /var/www/html/vendor/tymon/jwt-auth/src/Providers/JWT/NamshiAdapter.php:71

<!-- gh-comment-id:463099972 --> @Hyzual commented on GitHub (Feb 13, 2019): I'm having the same issue, I get a 500 error repeatedly on /data while trying to log in. The laravel cache show the following error (with 50 lines of stack trace) `[2019-02-13 08:01:05] production.ERROR: Tymon\JWTAuth\Exceptions\TokenInvalidException: Token Signature could not be verified. in /var/www/html/vendor/tymon/jwt-auth/src/Providers/JWT/NamshiAdapter.php:71`
Author
Owner

@tachikomachann commented on GitHub (Nov 27, 2020):

I'm having the same issue, I get a 500 error repeatedly on /data while trying to log in.
The laravel cache show the following error (with 50 lines of stack trace)

[2019-02-13 08:01:05] production.ERROR: Tymon\JWTAuth\Exceptions\TokenInvalidException: Token Signature could not be verified. in /var/www/html/vendor/tymon/jwt-auth/src/Providers/JWT/NamshiAdapter.php:71

I have the same problem. And after I set 'JWT_SECRET', problem solved.

<!-- gh-comment-id:734906719 --> @tachikomachann commented on GitHub (Nov 27, 2020): > > > I'm having the same issue, I get a 500 error repeatedly on /data while trying to log in. > The laravel cache show the following error (with 50 lines of stack trace) > > `[2019-02-13 08:01:05] production.ERROR: Tymon\JWTAuth\Exceptions\TokenInvalidException: Token Signature could not be verified. in /var/www/html/vendor/tymon/jwt-auth/src/Providers/JWT/NamshiAdapter.php:71` I have the same problem. And after I set 'JWT_SECRET', problem solved.
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#550
No description provided.