Open Martin555 opened 1 year ago
Well, it is also specified that:
Any change to
config.php
will then require either restarting PHP, manually clearing the cache, or invalidating this particular script.
This includes enabling maintenance mode. As well as updating apps trough the web interface, etc.
why not address the issue with opcache.blacklist_filename and add the path to config.php?
The docs are a bit ambiguous, but I'm not sure setting opcache.validate_timestamps = 0
is advised in the Server Tuning section. More just... overly casually mentioned. :-)
I agree though some clarification in the docs is probably in order - particularly maybe about implications for occ maintenance:mode
perhaps (PRs welcome - click on "Edit on GitHub" when viewing the docs or head over to https://github.com/nextcloud/documentation).
Anyhow we can't invalidate the opcache from the CLI directly AFAIK. I guess if we had to, we'd have to create some sort of out-of-bound way to have the CLI tell the web app to clear the cache.
If you set opcache.validate_timestamps = 1
and then set opcache.revalidate_freq = X
where X
is something sane like 2
or 60
then wait X
seconds after initiating the maintenance command you'll be golden (and still get the performance benefits).
@jww-sh That's an interesting idea, but I'm not sure the performance implications of never caching a file we refer to quite a lot would be. Someone would need to test that out. That, and keep in mind that just setting opcache.revalidate_freq = 2
(the default in PHP incidentally) would likely achieve near the same result for most people today without much downside.
Right, this also affects occ config:set
. And the cache cannot be invalidated since CLI and web UI are different PHP instances which have no access to each others OPcache. The CLI by default has no OPcache at all.
⚠️ This issue respects the following points: ⚠️
Bug description
When the maintenance mode gets activated, Nextcloud does not invalidate the OPcache of php. Hence, if the option
opcache.validate_timestamps
is set to 0, as advised by the official Server tuning manual, the web interface will continue to to be served, instead of the maintenance page.Steps to reproduce
opcache.validate_timestamps
to 0 via the php configurationExpected behavior
As the software does with changes to the configuration or other php files, enabling the maintenance mode should also invalidate the respective cached code, so the maintenance page is served to the user, the next time he loads a web interface page.
Installation method
Community Docker image
Nextcloud Server version
25
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.0
Web server
Nginx
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Updated from a minor version (ex. 22.2.3 to 22.2.4)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
No response
Additional info
No response