Issue when text in form input is too large, draft will not save - The POST method is not supported for this route #2279

Closed
opened 2026-02-05 03:32:37 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @declankay on GitHub (Jun 6, 2021).

When saving text in the WYSIWYG, I get this error:
The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, DELETE.
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException

Above this, I get the following two PHP errors:
"Notice: Unknown: file created in the system's temporary directory in Unknown on line 0"
and
"Warning: Cannot modify header information - headers already sent in Unknown on line 0"

The error does not occur if the text in the form is reduced, which indicates the error stems from the size of the draft being too large.

However, I am unsure how best to fix this.

Steps to reproduce the behavior:

  1. Enter text into a new draft page.
  2. Click save page button.
  3. Error appears

Expected behavior
The page should save and the long version of the text in the draft should submit.

error

Your Configuration (please complete the following information):

  • Exact BookStack Version BookStack v21.05.1
  • PHP Version: 7.4
  • Hosting Method: Apache
Originally created by @declankay on GitHub (Jun 6, 2021). When saving text in the WYSIWYG, I get this error: The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, DELETE. Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException Above this, I get the following two PHP errors: "Notice: Unknown: file created in the system's temporary directory in Unknown on line 0" and "Warning: Cannot modify header information - headers already sent in Unknown on line 0" The error does not occur if the text in the form is reduced, which indicates the error stems from the size of the draft being too large. However, I am unsure how best to fix this. Steps to reproduce the behavior: 1. Enter text into a new draft page. 2. Click save page button. 3. Error appears **Expected behavior** The page should save and the long version of the text in the draft should submit. <img width="1428" alt="error" src="https://user-images.githubusercontent.com/29783913/120932821-50cc9400-c6ef-11eb-8d17-1ecac4dcfecc.png"> **Your Configuration (please complete the following information):** - Exact BookStack Version BookStack v21.05.1 - PHP Version: 7.4 - Hosting Method: Apache
Author
Owner

@ssddanbrown commented on GitHub (Jun 6, 2021):

Hi @declankay ,

  • Can you confirm the operating system you're installing this on?
  • Are you able to share, if existing, what installation steps you've followed to get BookStack running?
  • Does this only occur on drafts or on existing pages as well?
@ssddanbrown commented on GitHub (Jun 6, 2021): Hi @declankay , - Can you confirm the operating system you're installing this on? - Are you able to share, if existing, what installation steps you've followed to get BookStack running? - Does this only occur on drafts or on existing pages as well?
Author
Owner

@declankay commented on GitHub (Jun 6, 2021):

Hi @ssddanbrown,

Sure, it was installed on Windows.

I followed the steps for a manual installation:
https://www.bookstackapp.com/docs/admin/installation/.

The issue exists on all pages:
a) a new page that has just been created
b) an existing page has more content added to it.

It seems like once the content reaches a maximum limit, the application can’t process all the data and the issue appears.

@declankay commented on GitHub (Jun 6, 2021): Hi @ssddanbrown, Sure, it was installed on Windows. I followed the steps for a manual installation: https://www.bookstackapp.com/docs/admin/installation/. The issue exists on all pages: a) a new page that has just been created b) an existing page has more content added to it. It seems like once the content reaches a maximum limit, the application can’t process all the data and the issue appears.
Author
Owner

@ssddanbrown commented on GitHub (Jun 6, 2021):

@declankay Thanks,

  • Are you able to confirm the browser URL path (Just the part after the domain) you see upon save in both the URL bar and shown in the error?
  • I see you're using cloudflare on your instance, Does this issue occur when you're not using cloudflare in-between? (If easy to check)
  • Are any additional Apache modules being used like mod_security?
@ssddanbrown commented on GitHub (Jun 6, 2021): @declankay Thanks, - Are you able to confirm the browser URL path (Just the part after the domain) you see upon save in both the URL bar and shown in the error? - I see you're using cloudflare on your instance, Does this issue occur when you're not using cloudflare in-between? (If easy to check) - Are any additional Apache modules being used like mod_security?
Author
Owner

@declankay commented on GitHub (Jun 6, 2021):

@ssddanbrown

The URL path is books/name-of-the-book/draft/3.

I’d rather not put any book-specific data in this public domain. However, I can privately provide details of the installation, if preferred?

I do not have Cloudflare on my local version and the local version does not have the issue. The only way for me to check the live site (which uses Cloudflare) would be to change it to a domain which does not use Cloudflare.

Mod_security is enabled as part of the package provided by the hosting company.

@declankay commented on GitHub (Jun 6, 2021): @ssddanbrown The URL path is books/name-of-the-book/draft/3. I’d rather not put any book-specific data in this public domain. However, I can privately provide details of the installation, if preferred? I do not have Cloudflare on my local version and the local version does not have the issue. The only way for me to check the live site (which uses Cloudflare) would be to change it to a domain which does not use Cloudflare. Mod_security is enabled as part of the package provided by the hosting company.
Author
Owner

@ssddanbrown commented on GitHub (Jun 6, 2021):

That's alright, don't need any more indepth details of your instance.

Bookstack page content can cause security layers to be tripped, think I've seen issues with people using mod_security before. Any way you can temporarily disable it to see?

Similar on the cloudlfare side, if there's any security features enabled for the cloudlfare setup it might be worth temporarily disabling them to see if the issue remains.

@ssddanbrown commented on GitHub (Jun 6, 2021): That's alright, don't need any more indepth details of your instance. Bookstack page content can cause security layers to be tripped, think I've seen issues with people using mod_security before. Any way you can temporarily disable it to see? Similar on the cloudlfare side, if there's any security features enabled for the cloudlfare setup it might be worth temporarily disabling them to see if the issue remains.
Author
Owner

@declankay commented on GitHub (Jun 8, 2021):

@ssddanbrown

I cannot check the modsecurity issue, as unfortunately I do not have root access.

However, I did change the domain for the wiki over to a domain that does not use Cloudflare. I can confirm that the issue is still the same as before.

One thing that I did not think of doing before was to check the console. When I am typing the content into the draft WYSIWYG, and I reach the limit of the characters I mentioned before, I get this error in the console:

"Uncaught (in promise) Utils::waitUntil: max iteration count reached
kwift.CHROME.min.js"

Hope this helps identify the issue.

@declankay commented on GitHub (Jun 8, 2021): @ssddanbrown I cannot check the modsecurity issue, as unfortunately I do not have root access. However, I did change the domain for the wiki over to a domain that does not use Cloudflare. I can confirm that the issue is still the same as before. One thing that I did not think of doing before was to check the console. When I am typing the content into the draft WYSIWYG, and I reach the limit of the characters I mentioned before, I get this error in the console: "Uncaught (in promise) Utils::waitUntil: max iteration count reached kwift.CHROME.min.js" Hope this helps identify the issue.
Author
Owner

@ssddanbrown commented on GitHub (Jun 8, 2021):

Do you get the console or BookStack error when you're saving content when using a fresh plugin-free browser (Especially one without dashlane if using)? (Or incognito window if you have no plugins enabled there)

@ssddanbrown commented on GitHub (Jun 8, 2021): Do you get the console or BookStack error when you're saving content when using a fresh plugin-free browser (Especially one without dashlane if using)? (Or incognito window if you have no plugins enabled there)
Author
Owner

@declankay commented on GitHub (Jun 8, 2021):

The Bookstack error appears in both versions of the browser.

The console error only occurs in the regular browser, however does not appear in a private browser i.e. without plugins. I did some reading and believe the console error is a Dashlane-related error message.

That said, the error sounds like a limit has been reached and then the error occurs, which ties in with the error occurring once the draft has a certain amount of content in the input that is submitted.

@declankay commented on GitHub (Jun 8, 2021): The Bookstack error appears in both versions of the browser. The console error only occurs in the regular browser, however does not appear in a private browser i.e. without plugins. I did some reading and believe the console error is a Dashlane-related error message. That said, the error sounds like a limit has been reached and then the error occurs, which ties in with the error occurring once the draft has a certain amount of content in the input that is submitted.
Author
Owner

@ssddanbrown commented on GitHub (Jun 8, 2021):

I've just tested against your instance with a couple of requests. This occurs on any endpoint, not just the page save. When the request body gets to a certain size it's being effectively ignored but the request is still going through, just without any body data.

Judging by the Unknown: file created in the system's temporary directory in Unknown on line 0 error, I think the request body is attempting to be cached within a temp file but that is failing, leading to an empty request body.

If your hosting provider allows you to view any PHP error logs, it'll be worth looking there to find any additional info. If you have any control on your hosting, It may be worth double checking that the upload_tmp_dir php.ini option is set to something valid. Otherwise, you might need to raise the issue up with your hosting provide if it's a managed offering.

@ssddanbrown commented on GitHub (Jun 8, 2021): I've just tested against your instance with a couple of requests. This occurs on any endpoint, not just the page save. When the request body gets to a certain size it's being effectively ignored but the request is still going through, just without any body data. Judging by the `Unknown: file created in the system's temporary directory in Unknown on line 0` error, I think the request body is attempting to be cached within a temp file but that is failing, leading to an empty request body. If your hosting provider allows you to view any PHP error logs, it'll be worth looking there to find any additional info. If you have any control on your hosting, It may be worth double checking that the `upload_tmp_dir` php.ini option is set to something valid. Otherwise, you might need to raise the issue up with your hosting provide if it's a managed offering.
Author
Owner

@declankay commented on GitHub (Jun 9, 2021):

Changing the upload_tmp_dir in the PHP ini file seems to have done the trick, as it was previously pointing at the WAMP default (which did not exist on the server).

The issue is now resolved, so thanks! You will have a GitHub Sponsor payment coming your way soon.

For the benefit of people who may have this issue in the future - it works with Cloudflare and mod_security enabled.

@declankay commented on GitHub (Jun 9, 2021): Changing the upload_tmp_dir in the PHP ini file seems to have done the trick, as it was previously pointing at the WAMP default (which did not exist on the server). The issue is now resolved, so thanks! You will have a GitHub Sponsor payment coming your way soon. For the benefit of people who may have this issue in the future - it works with Cloudflare and mod_security enabled.
Author
Owner

@ssddanbrown commented on GitHub (Jun 10, 2021):

@declankay Awesome, Glad to hear that solved things for you. Will therefore close this off.

@ssddanbrown commented on GitHub (Jun 10, 2021): @declankay Awesome, Glad to hear that solved things for you. Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2279