Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate flock() Failures when Running on Kubernetes 1.25.5 with Config Mounted by SMB CSI 1.10.0 #24

Open
GuyPaddock opened this issue Apr 6, 2023 · 1 comment

Comments

@GuyPaddock
Copy link
Contributor

GuyPaddock commented Apr 6, 2023

When running this kit on AKS after upgrading K8s from 1.23.9 to 1.25.5 and upgrading the SMB CSI driver from 1.9.0 to 1.10.0, flock() with Nextcloud config files behaves differently than it previously did.

If there are multiple replicas of Nextcloud running and multiple concurrent requests come in, several of the requests will return the following error back to the client:

Uncaught Error: Call to a member function getLogger() on null in /var/www/html/index.php:71

This is a red herring. The underlying error that caused the logger to be invoked was:

Exception: Could not acquire a shared lock on the config file /var/www/html/config/apcu.config.php in /var/www/html/lib/private/Config.php:216

Similar behavior is witnessed if Nextcloud Cron attempts to start at the same time as another request is starting.

File locking on config files was added for 12.0.12 of Owncloud back in September 2014, was removed from Nextcloud for 25.0.0beta7 on September 9, 2022, and then later re-added to the 25.0.0beta7 release on September 19, 2022. This AKS resource kit is still running Nextcloud 23, so this does not explain the change in behavior.

@GuyPaddock
Copy link
Contributor Author

A mitigation for this issue has been added in v10.2.1 of this kit. For now, a patch is being applied that removes file locking for Nextcloud configuration files. This should be safe as long as admins are following the best practice recommended by this kit of mounting the Nextcloud configuration files read-only except during install and upgrade operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant