mirror of
https://github.com/koel/koel.git
synced 2026-04-26 09:15:59 +03:00
[GH-ISSUE #1759] File more than 50Mb size gets failed to upload #968
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#968
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ChaitanyaPTank on GitHub (Apr 6, 2024).
Original GitHub issue: https://github.com/koel/koel/issues/1759
Describe the bug
Upload fails for file size more than 50MB.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Media should get uploaded successfully.
Screenshots


Environment
Additional context
Logs...
@ChaitanyaPTank commented on GitHub (Apr 6, 2024):
I searched for the issue and most says this is about php.ini file or Apache server config but running
php -ini | grep upload_maxindicates that max allowed size is 800MB@phanan commented on GitHub (Apr 11, 2024):
This is 99.99% somehing your config, which I can't help you debug, unfortunately. With PHP it's both
upload_max_filesizeandpost_max_size, for example. Or you might be using a different config.@ChaitanyaPTank commented on GitHub (Apr 11, 2024):
Thank you for your response.
I am running koel using docker-compose, can you please point to the config file I should change ? I am not familiar with PHP, however I tried changing
php.ini,php.ini-developmentandphp.ini-productioninside docker container and restarted withdocker-compose restarthowever it is not working.Edit: running
php --iniin container gives below output...@phanan commented on GitHub (Apr 11, 2024):
Try putting phpinfo() in your index.php file, which should print a big
table of all information you need, including the ini file in use. Then
check the settings for the values I said above.
On Thu, Apr 11, 2024 at 15:22 ChaitanyaPTank @.***>
wrote:
@ChaitanyaPTank commented on GitHub (Apr 12, 2024):
I did and it shows below...


@ChaitanyaPTank commented on GitHub (Apr 12, 2024):
So, it appears that
.htaccesswas overriding these properties henceLocal Valueis50M.Currently I solved it by changing value in
.htaccessfile and restarted usingdocker-compose restart. Which means once container is destroyed, those changes will be gone.Do we have any better way for this ? Can we handle it using an environment variable ?
I will be glad to work on it and raise PR once approach is decided.
Thanks.
@phanan commented on GitHub (Apr 12, 2024):
Good catch! Yeah, I think making it configurable with a sensible default would be the best solution. Something like:
Would love to receive a PR, of course!
@ChaitanyaPTank commented on GitHub (Apr 14, 2024):
Thank you for the code snippets, I just tried to clone the master branch and run the server but unable to get it running.
I have looked through the Developer Documentation, but it just says to run
npm run dev. Can you please give me list of the things I will need to install ? Here is what I have done up-to now...php composer.phar installnpm run dev(it gave error about some missing extension which I installed with apt)http://localhost:8000/api/pingit gives below error@phanan commented on GitHub (Apr 14, 2024):
Have you configured a database?
Am So., 14. Apr. 2024 um 17:46 Uhr schrieb ChaitanyaPTank <
@.***>:
@ChaitanyaPTank commented on GitHub (Apr 14, 2024):
Ok will check on how to configure db in project.
On Sun, 14 Apr, 2024, 9:31 pm Phan An, @.***> wrote:
@phanan commented on GitHub (Apr 14, 2024):
For development you can use SQLite. Actually for this feature you'd only
need an in-memory one and let the tests handle everything.
Am So., 14. Apr. 2024 um 18:05 Uhr schrieb ChaitanyaPTank <
@.***>:
@ChaitanyaPTank commented on GitHub (Apr 14, 2024):
I have never worked with PHP and have familiarity with JavaScript, hence I have not idea how things work here. I will try to get server running.
@ChaitanyaPTank commented on GitHub (Apr 14, 2024):
If I use
DB_CONNECTION=sqlitethen it gives below error,Edit: I have also not worked with SQL much.
@ChaitanyaPTank commented on GitHub (Apr 14, 2024):
Finally got server running after using
sqlite-persistantas a db and runningphp artisan migrate. However what will be the initial user to login ?@ChaitanyaPTank commented on GitHub (Apr 14, 2024):
I tried to do
ini_setbut the changes were not shown inphpinfo()I think it can not be setup from php code as per this answer.If that's true, can we do it in
.htaccesssomehow by retrieving the environment variable and set value ?@phanan commented on GitHub (Apr 14, 2024):
Oh true, I forgot about the fact that some ini config can't be set via
ini_set.
Am So., 14. Apr. 2024 um 21:23 Uhr schrieb ChaitanyaPTank <
@.***>:
@phanan commented on GitHub (Apr 15, 2024):
Maybe a better way is to make .htacess opt-in (ie. make it
.htaccess.example and copy it into .htaccess during installation, the way
.env is atm). Then we can git track only the .example file.
On Sun, Apr 14, 2024 at 22:34 An Phan @.***> wrote:
@ChaitanyaPTank commented on GitHub (Apr 15, 2024):
I am not sure how it's done or to say where it's configured to use .env.example file during build/installation. Here is what I have understood...
upload_max_sizeandpost_size_maxrules having value of{ENV:MAX_UPLOAD_SIZE}One thought I am having is that if people write invalid rules in .htaccess.example then will it show error in the same terminal ? Because without familiarity with PHP or apache, it will be little difficult to find what's wrong in the config. In summary I think people can easily shoot their foot in this approach (please correct me if I have misunderstood).
@phanan commented on GitHub (Apr 15, 2024):
.htaccess errors won't show in the terminal, but I wouldn't be concerned
about it. If someone modifies the config, they're expected to know what
they're doing.
Am Mo., 15. Apr. 2024 um 12:00 Uhr schrieb ChaitanyaPTank <
@.***>:
@ChaitanyaPTank commented on GitHub (Apr 15, 2024):
Makes sense,
So How to implement it ? as I said above ?
@phanan commented on GitHub (Apr 15, 2024):
Look at composer.json, "post-install-cmd" section.
Am Mo., 15. Apr. 2024 um 14:12 Uhr schrieb ChaitanyaPTank <
@.***>:
@ChaitanyaPTank commented on GitHub (Apr 23, 2024):
I have
.htaccess.examplebesides.env.exampleand put"@php -r \"copy('.htaccess.example', './public/.htaccess');\""command incomposer.jsonAnything else todo ?
@phanan commented on GitHub (Apr 23, 2024):
If you see the file gets copied during installation (or simply composer
install) then you've done it right :) Is there a PR somewhere?
Am Di., 23. Apr. 2024 um 09:24 Uhr schrieb ChaitanyaPTank <
@.***>:
@ChaitanyaPTank commented on GitHub (Apr 23, 2024):
No I have not raised PR because I have not tested it locally. What I am wondering is, will this approach work for docker deployment ?
@phanan commented on GitHub (Apr 23, 2024):
Yes, it does. This command should be triggered during composer install,
which is a step in deployment.
Am Di., 23. Apr. 2024 um 10:52 Uhr schrieb ChaitanyaPTank <
@.***>:
@ChaitanyaPTank commented on GitHub (Apr 23, 2024):
Yes, I have tested and it updates file.
@ChaitanyaPTank commented on GitHub (Apr 23, 2024):
Hi @phanan I have raised PR, please have a look.
@ChaitanyaPTank commented on GitHub (May 8, 2024):
Solved by #1762