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

[Bug]: Maintenance:mode changes are not respected #38872

Closed
5 of 8 tasks
mjmccarn opened this issue Jun 18, 2023 · 7 comments · May be fixed by nextcloud/documentation#10645
Closed
5 of 8 tasks

[Bug]: Maintenance:mode changes are not respected #38872

mjmccarn opened this issue Jun 18, 2023 · 7 comments · May be fixed by nextcloud/documentation#10645
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug feature: caching Related to our caching system: scssCacher, jsCombiner...

Comments

@mjmccarn
Copy link

⚠️ This issue respects the following points: ⚠️

Bug description

occ maintenance:mode --on should force users to see the maintenance mode message

occ maintenance:mode --off should disable the maintenance mode message

In each case, occ status or grep maintenance config.php indicates that the status of the maintenance setting was changed as requested.

On my server, I need to execute systemctl restart php8.1-fpm before these changes take effect.

Steps to reproduce

  1. Upgrade to NC27
  2. Set maintenance mode on
  3. Access the web interface
  4. The system remains fully accessible unless I run systemctl restart php8.1-fpm

Expected behavior

  • If Maintenance mode is enabled, users should see a maintenance mode message
  • If Maintenance mode is disabled, users should be able to access the server

Installation method

Community Manual installation with Archive

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 22 to 23)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.1.7",
            "vcloud.aicr.org",
            "aicr.dyndns.org",
            "192.168.1.89"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded-for-headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/vcloud.aicr.org",
        "dbtype": "pgsql",
        "version": "27.0.0.8",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "theme": "",
        "maintenance": false,
        "forcessl": true,
        "forceSSLforSubdomains": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "logtimezone": "Europe\/London",
        "log_authfailip": true,
        "log_rotate_size": 104857600,
        "cache_path": "",
        "knowledgebaseenabled": true,
        "enable_avatars": true,
        "allow_user_to_change_display_name": true,
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\SVG",
            "OC\\Preview\\Photoshop"
        ],
        "asset-pipeline.enabled": true,
        "apps_paths": [
            {
                "path": "\/var\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            },
            {
                "path": "\/var\/www\/nextcloud\/apps-local",
                "url": "\/apps-local",
                "writable": false
            }
        ],
        "xframe_restriction": true,
        "mail_smtpport": "25",
        "updatechecker": false,
        "activity_expire_days": 3652,
        "enable_certificate_management": true,
        "trashbin_retention_obligation": "auto",
        "singleuser": false,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "0",
            "timeout": "0.0"
        },
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "mysql.utf8mb4": true,
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "passman",
            "files_mindmap"
        ],
        "mail_sendmailmode": "smtp",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "MFA"
        ],
        "twofactor_enforced_excluded_groups": []
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - announcementcenter: 6.6.1
  - bruteforcesettings: 2.7.0
  - circles: 27.0.0
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contactsinteraction: 1.8.0
  - dav: 1.27.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_external: 1.19.0
  - files_mindmap: 0.0.28
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - impersonate: 1.14.0
  - integration_openai: 1.0.10
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notifications: 2.15.0
  - oauth2: 1.15.0
  - passman: 2.4.5
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - support: 1.10.0
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_email: 2.7.3
  - twofactor_totp: 9.0.0
  - updatenotification: 1.17.0
  - viewer: 2.1.0
  - workflowengine: 2.9.0
Disabled:
  - dashboard: 7.7.0 (installed 7.0.0)
  - encryption: 2.15.0
  - files_retention: 1.15.0 (installed 1.15.0)
  - groupfolders: 14.0.2 (installed 14.0.2)
  - imap_auth_aicr: 0.1.3 (installed 0.1.3)
  - passwords: 2023.5.30 (installed 2023.5.30)
  - recommendations: 1.6.0 (installed 1.3.0)
  - registration: 2.1.0 (installed 2.1.0)
  - sharelisting: 1.1.1 (installed 1.1.1)
  - suspicious_login: 5.0.0
  - user_external: 3.1.0 (installed 3.1.0)
  - user_ldap: 1.17.0
  - user_status: 1.7.0 (installed 1.4.0)
  - weather_status: 1.7.0 (installed 1.4.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

I am seeing the same behavior on two servers.

Both servers use apache2 / PHP 8.1 / redis & postgresql

@mjmccarn mjmccarn added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 18, 2023
@joshtrichards
Copy link
Member

joshtrichards commented Jun 18, 2023

Check your FPM php.ini and make sure that:

That, or restart your PHP FPM as you've discovered. Optimizations have trade-offs. Just have to decide which ones you prefer. :)

@joshtrichards
Copy link
Member

Suspected duplicate of #37557

joshtrichards added a commit to joshtrichards/nc-documentation that referenced this issue Jun 18, 2023
@solracsf solracsf changed the title [Bug]: NC 27 maintenance:mode changes are not respected [Bug]: Maintenance:mode changes are not respected Jun 21, 2023
@nextcloud-command

This comment was marked as resolved.

@nextcloud-command nextcloud-command added the stale Ticket or PR with no recent activity label Jul 22, 2023
@mjmccarn
Copy link
Author

Is it possible to clear or disable the opcache if the server detects that maintenance mode is active?

I am OK restarting php81-fpm to get out of maintenance mode, but going into or being in maintenance mode should be a mandatory condition that is not subject to other configuration settings.

@nextcloud-command nextcloud-command removed stale Ticket or PR with no recent activity needs info labels Jul 30, 2023
@joshtrichards joshtrichards added the feature: caching Related to our caching system: scssCacher, jsCombiner... label Aug 27, 2023
@jessebot
Copy link

jessebot commented Sep 4, 2023

Is it possible to clear or disable the opcache if the server detects that maintenance mode is active?

I am OK restarting php81-fpm to get out of maintenance mode, but going into or being in maintenance mode should be a mandatory condition that is not subject to other configuration settings.

I'd also be interested in triggering a redis update when the server is in maintenance mode, as I'm using redis for caching and have a similar issue.

@joshtrichards
Copy link
Member

@mjmccarn Not in the way that would be helpful at present unfortunately. Consider that the PHP opcache isn't shared between the CLI and web-app server (mod_php/fpm) processes. So even though we actually do try to invalidate the opcache in our code, it's irrelevant since invalidating the CLI opcache doesn't change anything for the running web app... #37557 (comment) (and elsewhere).

P.S. I'm going to close this issue and consolidate further tracking/discussion to: #37557 and #39079 in the interest of not spreading these discussions out everywhere. I encourage you to subscribe to those issues to track progress and anyone else that sees this issue to give those referenced issues a subscribe and/or 👍 if impacted.

@jessebot Can you elaborate? The PHP opcache and the data/memcaches (such as Redis) don't have much to do with each other. If you're having a similar issue, it's due to the PHP opcache too (and your installation's PHP opcache settings such as opcache.validate_timestamps and opcache.revalidate_freq), but likely not your memcache (redis).

@joshtrichards
Copy link
Member

Duplicate of #37557

@joshtrichards joshtrichards marked this as a duplicate of #37557 Sep 10, 2023
@joshtrichards joshtrichards closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug feature: caching Related to our caching system: scssCacher, jsCombiner...
Projects
None yet
5 participants