Race Condition Causes 502 Error in Nextcloud AIO Eurooffice
A race condition within Nextcloud AIO Eurooffice 9.3.7 is preventing the HTTP server from starting, resulting in a 502 bad gateway error.
A recent nightly backup and restart triggered a failure in Nextcloud AIO Eurooffice, manifesting as a 502 bad gateway error and preventing the HTTP server on port 8000 from starting. The issue appears to stem from a race condition during the initial write to the PostgreSQL data folder, which resides within a read-only image layer using overlayfs.
The problem arises when another process, such as the PostgreSQL pool process, attempts to access the file during the overlayfs copy-up operation, leading to an interrupted system call and preventing the server from initializing. While the supervisor reported the service as ‘RUNNING’ and the healthcheck passed, a manual restart of the docservice container resolved the problem.
The user suggests that a healthcheck incorporating a verification of port 8000 could have detected the issue earlier and proposes that the root cause might be related to an openZFS bug, requiring further investigation.