Kirby is checking the lock status of a page every 10 seconds. This is fine. When I change something on the page and the page gets ālockedā, everything still is fine. Every 10 seconds the lock status of the page gets requested and is 200 OK.
This is where it gets tricky:
After a while, changes still pending, the requests for the lock are running into timeoutsā¦
And after some time āJson response could not be parsed: Gateway timeoutā appears.
Shortly after this, I canāt access the page in the kirby panel (after a refresh) for a while (max 1 minute) (due to the lock file still there). The site just keeps loading.
Also during these timeouts, Kirby opens a new connection on nginx for each failed lock request while this is supposed to be 1 connection (since Iām the only one accessing it).
We use php 8 and Kirby 3.9. NGINX says 499 client closed request for the /lock requests. PHP-FPM gives me 500 internal server error after a minute (nginx 15:30 499, php-fpm 15:31 500)
Iām certain this has nothing to do with our nginx and php configuration but with how Kirby handles these lock requests.
Any ideas? Any suggestions?
I can provide more screenshots and details if requested (since Iām a new user, I can only add 1 in this post)
This is not a new installation. This Kirby 3.9 got upgraded from Kirby 3.5.3
I try to provide more information. I have to make some changes to PHP Log Level. Also Iāll go check any firewall rules. But after some further testing this lock issue only occurs after working in the panel (make some changes, donāt save them, change tab without saving, come back etc.). While idling and not having any pending changes, Kirby can request lock hundred times without any issues.
Edit:
Just checked the rules. There is no firewall rule which could intervene here. We also use traefik as Ingress Controller and there is also no rule or circuit breaker which could intervene here.
Steps:
Made a change
Left it pending (not saving)
tabbed out
tabbed in
scrolled down
see console
After rechecking now, I got a rule in our traefik ingress which will kill requests taking longer than 45 seconds. The question now is, why does Kirby take so long for an answer? I canāt remove the rule⦠45 seconds are already a long timespan. It would flood all connections with Kirby lock requests.
Thanks for the additional information. It suggests that the call to flock() blocks because another thread/PHP worker tries to access the lock file at the same time. We havenāt seen this behavior of timed-out requests before, but I can try to help you debugging it.
What I find interesting is that it only happens once the user tabs out of the Panel. A few questions:
Are there multiple users in your Kirby installation?
When tabbing out, was the other tab unrelated to the Kirby installation?
Does it also occur in different browsers?
Does it also occur when using a fresh Starterkit installation on the same server setup?
There are multiple users in our Kirby installation but the timeout occures with every user. We have users where multiple persons can login and we have users only for specific persons.
When tabbing out, the tab is unrelated to Kirby.
It does occur in firefox, safari and chrome, as far as I tested it.