You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't log in due to out of memory error despite setting MEMORY_LIMIT #18
I got the docker-compose.yaml running, and database initialised. After adding MEMORY_LIMIT: 5000 to the environment: section of the koel container, koel:sync worked without exiting blindly.
However, when attempting to log in the page just refreshes. Looking at the server log, a request to /api/data failed with a 500 error.
Using developer tools, the error message was:
This would seem to indicate that the MEMORY_LIMIT only applies to the php executable and not php-fpm where the main koel process is running.
I suppose the entrypoint could add the memory limit to the fpm config as well to fix this.
Thanks for maintaining this docker-compose project!
Hi,
Thanks a lot for that report :). I also have had problems with login. After 3-5 tries it usually succeeded, which would be explained by it being a memory allocation problem. I could never get any log, I'm glad to see you could get an error json.
Just for information ,this image does not use php-fpm but apache and modphp. I'll take a look on it but don't know when I'll have time. Now that I have a trail, I can try something to fix it :)
No problem. I found that the problem only occurred after adding a lot of files with sync -- given it was a call to /api/data this makes sense though I'm still surprised such a request needs so much memory, probably one for optimisation in koel.
Login still fails after 10 attempts, probably because in my case I have a lot of files, I suspect your case was marginal.
I might get time to PR a fix tonight or this weekend, I suppose it will be a case of whoever gets time first
It seems the issue can also be masked with the same behaviour. I got
For the same request, but I guess that was a result of rebuilding my container. I suspect the secrets have changed (specifically JWT_SECRET) or something.....
So wiped the database and tried again, this time with a patch performed by koel-entrypoint to set the apache modphp memory limit. Now I get permission denied on laravel.log.
I'llkeep investigating.
Interestingly, on the first koel:init it says the JWT secret already exists. Any idea why?
Thanks for the investigations !
Yes, if the JWT_SECRET changes, the token becomes invalid and it locks you out.
Yeah, the laravel.log permission is really annoying too. I wonder if the entrypoint should do something about it.
It's surprising, the JWT secret is not supposed to already exist. There is a lot of caching going on with Laravel though, try php artisan cache:clear. It has fixed some issues for me in the past :).
koel does not read directly from env variables, it reads once and caches somewhere.
Hi!
In 2edf076 I've added a php.ini file with a higher memory limit (512MB). From my tests this week, it looks like I no longer encounter the memory issues and I can login straight away. Previously it took 5 or 6 refreshes to log in.
Could you pull the latest image and give it a try? 😊
About the error when scanning, I don't know what to say, I don't think I can help you 😕. I've just tried now rebuilding from the Dockerfile and with my test media (some .ogg, some .mp3, some .flac files) scanning works, even when it complains.
I guess I can only suggest to open an issue at https://github.com/koel/koel.
About the invalid token, it looks like something is wrong somewhere indeed. I would have advised to run cache:clear too... Indeed without errors it's hard to have a clue on what's going on.
Turns out I was running an older image after all -- see #59 (comment) -- sorry for the hassle.
It scans now, though it got stuck on a probably-invalid ID3 tag:
I'll investigate and/or raise a koel issue for that.
Thanks for the effort of making the docker koel image, by the way.
I had no issue with a token when attempting to log in with the latest image; however it get a 500 "Server error" JSON response again. Perhaps my collection is too large at 16,000 songs. I'll try increasing the memory limit further later. It's a bit odd how so much memory is required and it apparently scales with size of media library, maybe koel is loading everything at once or something.
OK I tried 2048M by editing php.ini and swapping the line image: hyzual/koel for build: . and now I can log in!
I think I might raise an issue in the koel repository or check out the code. There's no way a page should use that much memory even if the media repository is large.
Activity
Hyzual commentedon May 14, 2020
Hi,
Thanks a lot for that report :). I also have had problems with login. After 3-5 tries it usually succeeded, which would be explained by it being a memory allocation problem. I could never get any log, I'm glad to see you could get an error json.
Just for information ,this image does not use php-fpm but apache and modphp. I'll take a look on it but don't know when I'll have time. Now that I have a trail, I can try something to fix it :)
naggie commentedon May 15, 2020
No problem. I found that the problem only occurred after adding a lot of files with sync -- given it was a call to
/api/datathis makes sense though I'm still surprised such a request needs so much memory, probably one for optimisation in koel.Login still fails after 10 attempts, probably because in my case I have a lot of files, I suspect your case was marginal.
I might get time to PR a fix tonight or this weekend, I suppose it will be a case of whoever gets time first
Thanks!
naggie commentedon May 16, 2020
It seems the issue can also be masked with the same behaviour. I got

For the same request, but I guess that was a result of rebuilding my container. I suspect the secrets have changed (specifically
JWT_SECRET) or something.....So wiped the database and tried again, this time with a patch performed by
koel-entrypointto set the apache modphp memory limit. Now I get permission denied on laravel.log.I'llkeep investigating.
Interestingly, on the first
koel:initit says the JWT secret already exists. Any idea why?Hyzual commentedon May 16, 2020
Thanks for the investigations !
Yes, if the
JWT_SECRETchanges, the token becomes invalid and it locks you out.Yeah, the laravel.log permission is really annoying too. I wonder if the entrypoint should do something about it.
It's surprising, the JWT secret is not supposed to already exist. There is a lot of caching going on with Laravel though, try
php artisan cache:clear. It has fixed some issues for me in the past :).koel does not read directly from env variables, it reads once and caches somewhere.
Hyzual commentedon Dec 11, 2020
Hi!
In 2edf076 I've added a php.ini file with a higher memory limit (512MB). From my tests this week, it looks like I no longer encounter the memory issues and I can login straight away. Previously it took 5 or 6 refreshes to log in.
Could you pull the latest image and give it a try? 😊
naggie commentedon Dec 11, 2020
Oh that's great. I will certainly give it a go soon, thanks for the change.
naggie commentedon Mar 11, 2021
I can get as far as koel::init, but when I run sync, the command exits with status 255:
It's a shame there's no error output to give a hint at what's wrong. There's no laravel.log either.
I got the same invalid token error when trying to log in (the page just refreshes -- needed to check the console.)
php artisan cache:cleardidn't help. Note this is straight out of the box -- I removed my volumes and images etc.Hyzual commentedon Mar 16, 2021
About the error when scanning, I don't know what to say, I don't think I can help you 😕. I've just tried now rebuilding from the Dockerfile and with my test media (some
.ogg, some.mp3, some.flacfiles) scanning works, even when it complains.I guess I can only suggest to open an issue at https://github.com/koel/koel.
About the invalid token, it looks like something is wrong somewhere indeed. I would have advised to run
cache:cleartoo... Indeed without errors it's hard to have a clue on what's going on.naggie commentedon Mar 17, 2021
Turns out I was running an older image after all -- see #59 (comment) -- sorry for the hassle.
It scans now, though it got stuck on a probably-invalid ID3 tag:

I'll investigate and/or raise a koel issue for that.
Thanks for the effort of making the docker koel image, by the way.
I had no issue with a token when attempting to log in with the latest image; however it get a 500 "Server error" JSON response again. Perhaps my collection is too large at 16,000 songs. I'll try increasing the memory limit further later. It's a bit odd how so much memory is required and it apparently scales with size of media library, maybe koel is loading everything at once or something.
naggie commentedon Mar 17, 2021
OK I tried
2048Mby editingphp.iniand swapping the lineimage: hyzual/koelforbuild: .and now I can log in!I think I might raise an issue in the koel repository or check out the code. There's no way a page should use that much memory even if the media repository is large.