Skip to content

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

Description

@GuyPaddock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions