linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
797 stars 109 forks source link

The server does not allow uploads of this size. Please try a smaller file size #78

Closed Robert-Ernst closed 3 years ago

Robert-Ernst commented 3 years ago

I was busy for the last 2 hours trying to find the root cause - no success.

My error message when I am uploading is: "The server does not allow uploads of this size. Please try a smaller file size."

php-local.ini

memory_limit = 512M
post_max_size = 100M
upload_max_filesize = 100M

I checked everything, the syntax, different values. No effect at all. It seems like the config file isn't read. But the files were created from the application and it's mounted correctly. I also checked the nginx config, in which I haven't changed anything nginx.conf client_max_body_size 0; The value is set to 0, which means unlimited.

Custom HTML Head Content <script> window.uploadLimit = 1500; </script>

My upload limit is still 1 MB.


Expected Behavior

Respect the configuration file settings to allow bigger upload attachment sizes

Current Behavior

Can't upload attachments bigger than 1MB

Steps to Reproduce

Environment

OS: Ubuntu 16.04 CPU architecture: x86_64 How docker service was installed: Like docker's documentation shows

Command used to create docker container (run/create/compose/screenshot)

docker-compose up -d

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
App Key found - setting variable for seds
Running config - db_user set
/var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 62: warning: command substitution: ignored null byte in input
Nothing to migrate.
github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

Robert-Ernst commented 3 years ago

See also: https://github.com/linuxserver/docker-bookstack/issues/51

Roxedus commented 3 years ago

I can somewhat replicate this. Meaning, I encounter the limit on the first run of the container, once the container is restarted once, the default in of 100M in this image is used. No significant file gets touched on that restart.

Robert-Ernst commented 3 years ago

I tried everything regarding the container. Restart, rebuild, up, down, sideways 🙃 I see no difference. For me it seems like that the php.ini doesn't get used. Is there any default where the 1MB originates from? What would be the error message in Bookstack if nginx would be the limiting factor?

Roxedus commented 3 years ago

I imagine the 1MB comes from the default in Nginx, which we bump to 100M here, this bump is the default I was mentioning in the last comment. This change does stick, which makes me believe you modified the Nginx files too much.

The error I got in my testing was the one in your issue.

Robert-Ernst commented 3 years ago

I found the solution.

I use Nginx behind Nginx. So I had to update my non-dockered nginx. For those in the future, these are the necessary steps:

  1. sudo nano /etc/nginx/nginx.conf
  2. Add or edit:
        proxy_read_timeout 600;
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        client_max_body_size 0;
  3. sudo service nginx reload
incryptoid commented 3 years ago

@Robert-Ernst is it works?

Robert-Ernst commented 3 years ago

It werks