linuxserver / docker-bookstack

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

Illuminate\Http\Exceptions\PostTooLargeException when posting a form #64

Closed fwerner13 closed 3 years ago

fwerner13 commented 4 years ago

On a fresh install using the provided docker-compose.yml, whenever I post a form (create a new shelf, try to change the default admin password) I get an Illuminate\Http\Exceptions\PostTooLargeException.

Perhaps this is caused by

https://github.com/linuxserver/docker-bookstack/pull/63/commits/8af8464d49025f14990a892a4a7ed1432e75ebc0#diff-47ffcee93649ec8520ea742cfddc9b9bR66


Expected Behavior

I should be able to post forms.

Current Behavior

When I post any form, the error Illuminate\Http\Exceptions\PostTooLargeException appears.

Steps to Reproduce

  1. Fresh install using the provided docker-compose.yml
  2. Log in as admin
  3. Try to create a shelf

Environment

OS:
CPU architecture: x86_64/arm32/arm64
How docker service was installed:

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

version: "2"
services:
  bookstack:
    image: linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - DB_HOST=bookstack_db
      - DB_USER=bookstack
      - DB_PASS=mypassword
      - DB_DATABASE=bookstackapp
    volumes:
      - /var/www/bookstack/config:/config
    ports:
      - 80:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
  bookstack_db:
    image: linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=mypassword
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=mypassword
    volumes:
      - /var/www/bookstack/config:/config
    restart: unless-stopped

Docker logs

The docker logs show nothing, but the nginx logs do:

2020/09/18 15:37:04 [error] 357#357: *19 FastCGI sent in stderr: "PHP message: PHP Warning:  POST Content-Length of 1072 bytes exceeds the limit of 100 bytes in Unknown on line 0" while reading response header from upstream, client: 5.180.62.10, server: _, request: "POST /settings/users/1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "78.46.181.222", referrer: "http://78.46.181.222/settings/users/1"

I'm don't know that much about php.ini configuration, but googling for post_max_size the size was always specified as 100M while the recent change used 100MB - don't know if that could be the problem maybe.

github-actions[bot] commented 4 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

ironicbadger commented 4 years ago

Cannot recreate using the provided docker-compose I'm afraid.

image

ssddanbrown commented 4 years ago

Heard another report in the BookStack discord of this error being thrown with the linuxserver image.

Just tested this myself, using the current v0.30.0-ls105 image, without any proxy in a fresh setup and could not reproduce. Saving a fairly large page and uploading images worked without issue.

ssddanbrown commented 4 years ago

Never mind the above, the issue does occur after restarting the containers. On restart the values from the php-local.ini are read in, which were written in the previous container start-up, which then cause this error since the unexpected MB in the written php-local.ini causes application-level middleware to check the post body against a size of 100 bytes instead of 100 MB.

I see there's a pending pull request to solve this: https://github.com/linuxserver/docker-bookstack/pull/65

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.