Api changes/save POST limitation issue and how to engage?

Hi,

got an issue where saving or changing a page does not work.

i think it is similar to issues from v3 and v4:

Description of Problem

Got a request in panel.
When doing a small change to a page:

  • Request is like that https://example.com/api/pages/:id/changes/save
  • Request Method POST
  • Status Code 400 Bad Request ( Apaches core HTML “Bad Request” page HTML response)

Situation

  • Managed Server from Strato :face_vomiting:
    • has PATCH request possible ! ( api.methodOverride' => false works here )
      • but actually /api/pages/:id/changes/save does not use PATCH at all (if i am right? see question in whole below…)
    • has no error logging (has but doesn’t work like “expected”)
    • has no way to change and test server-settings like SecArgumentsLimit
  • Kirby v5.3.0

Assumption

Because i need to do POST request on pages with more than 1000 JSON vars, the request fails on server side because of SecArgumentsLimit (default 1000) config → Reference Manual (v2.x) · owasp-modsecurity/ModSecurity Wiki · GitHub

Explanation

I actually tested saving / changing a page very often until found, that below 1000 JSON vars it works and above not.

Nothing with content length or post_max_size.
Nothing with the content itself, like bad looking code or something.

Solution for my Assumption

Get in contact with Strato and let confirm the behaviour.

Edit: Strato Telephone Support suggested to put the Guest-Spam-Filter on and off and try in incognito mode. But they explained me how to submit a ticket. Click on email address on Imprint site to get redirected to the contact-form :face_with_spiral_eyes:
So confirmation needs more time…

How to go on?

  1. What would be a preferred way to solve that with Kirby CMS?

  2. Maybe i set up my project with too much single needed vars and fields for one page?
    I got a block-builder with quite a few internal links and repeated fields like color-settings quite often, which blow up JSON quite fast. My failing pages got like > 15 blocks.
    txt files are around 20kb. Is that too much? (in terms of nested JSON… doesn’t makes sense, but hope you get a point.)

  3. Is there another way to change the save request to use max_input_vars? so that old-school PHP way: POST request with application/x-www-form-urlencoded or multipart/form-data

  4. does /api/pages/:id/changes/save use PATCH at all?


thanks in advance for any answers on that complex problem post…

I have the exact same problem with STRATO. They seem to have changed settings in the last couple of days or weeks? For me the problem occurs with a files field with too many files selected. Shortening the files field content makes saving possible again. I am happy to hear about the customer service’s response @A.Kelling!

Strato replied with the following passages after my inquiry via their “ticket system.”

Cited in german as its the original language:

Bitte beachten Sie, dass die Servereinstellungen in Ihrem Hosting-Paket fest vorgegeben sind und möglicherweise zu Einschränkungen führen können. Diese Einstellungen können leider nicht geändert werden.

So changing they cant.

Bedauerlicherweise können wir nicht genau nachvollziehen, wodurch der gemeldete Fehler verursacht wird, da wir für diesen Bereich keinen weiterführenden Support anbieten können.

Support they dont do.

Möglicherweise finden Sie weitere Hinweise zur Fehlerursache in den Error-Logs Ihres Kunden-Logins. Diese können Sie überprüfen, um weitere Informationen zu erhalten.

Error Logs actually not showing Server-errors like espected.

Thanks for posting their feedback! How nice of STRATO … :roll_eyes: I guess I need to move to a different service then.

@silvan on Strato it works again for me saving bigger posts.

Guess they had trouble and now reacted.
A similar recent case i found here: SP Page Builder Pro – HTTP 400 when saving pages / HTTP 403 during update (STRATO Hosting) - Forum | JoomShaper
Huge Page-builder wants to save a lot content with a lot JSON args.

Same for you?

Yes, works again! Magic, I guess …

Another client now complained that file uploads in the panel above 10 MB aren’t working anymore. I confirmed the behavior.

Do you experience the same? My guess would be the problems are related.

The /files request when pressing the upload button is instantly rejected with a 413 error.

Hmm, yes.

It’s tanother topic but related to strato.

I tried a 14mb file upload in panel which causes an error message answer:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource does not allow request data with POST requests, or the amount of data provided in
the request exceeds the capacity limit.
</body></html>

while post_max_size and upload_max_filesize are both 128M.

Seems Strato has some new servers and just setting things up

@silvan now it doesnt work again on my side. :man_facepalming:
400 on /api/pages/:id/changes/save with huge JSON payload

Same here. They sent out emails regarding the PHP vulnerability which state they hardened firewall mechanisms. Maybe that’s the reason, but I would hope things go back to normal soon.

hmmm… would guess they changed to new PHP Version in a hurry, restartet Servers, forgot about the recent change to raise the limit for SecArgumentsLimit and need to get informed again from customers to do that again…

and now saving it works again.

Yes, for me too!