nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.31k stars 4.06k forks source link

Maintenance mode should disable data directory check #18946

Open manofthepeace opened 4 years ago

manofthepeace commented 4 years ago

Steps to reproduce

  1. Put ncdata on a external drive
  2. Put Nextcloud in maintenance mode
  3. Check the web UI (You should see the message saying NC is in maintenance mode)
  4. Unplug the disk
  5. Check the web UI (error about the ncdata not accessible)

Expected behaviour

I am doing maintenance on the data disk, I would like my users to see that there is maintenance, not an error that is cryptic to them. Maintenance page check should take precendence over the ncdata check. I would expect that error, and wish to have that error is there was problem with the ncdata and nc not being in maintenance mode

Actual behaviour

Ui shows a cryptic error message instead of the maintenance

Server configuration

Operating system: Debian buster

Web server: apache 2.24

Database: mariadb 10

PHP version: 7.2

Nextcloud version: 17.0.2

Updated from an older Nextcloud/ownCloud or fresh install: Updated since NC 14

Where did you install Nextcloud from: Official release

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.3.0 - activity: 2.10.1 - calendar: 1.7.1 - cloud_federation_api: 1.0.0 - comments: 1.7.0 - contacts: 3.1.6 - dav: 1.13.0 - federatedfilesharing: 1.7.0 - federation: 1.7.0 - files: 1.12.0 - files_pdfviewer: 1.6.0 - files_rightclick: 0.15.1 - files_sharing: 1.9.0 - files_trashbin: 1.7.0 - files_versions: 1.10.0 - files_videoplayer: 1.6.0 - firstrunwizard: 2.6.0 - gallery: 18.4.0 - logreader: 2.2.0 - lookup_server_connector: 1.5.0 - news: 14.0.2 - nextcloud_announcements: 1.6.0 - notes: 3.1.0 - notifications: 2.5.0 - oauth2: 1.5.0 - password_policy: 1.7.0 - previewgenerator: 2.2.0 - privacy: 1.1.0 - provisioning_api: 1.7.0 - recommendations: 0.5.0 - serverinfo: 1.7.0 - sharebymail: 1.7.0 - support: 1.0.1 - survey_client: 1.5.0 - systemtags: 1.7.0 - tasks: 0.11.3 - text: 1.1.1 - theming: 1.8.0 - twofactor_backupcodes: 1.6.0 - twofactor_totp: 4.1.1 - updatenotification: 1.7.0 - viewer: 1.2.0 - workflowengine: 1.7.0 Disabled: - admin_audit - encryption - files_external - files_texteditor - previewgenerator.orig - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": { ***REMOVED SENSITIVE VALUE*** }, "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "17.0.2.1", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "memcache.local": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0, "password": "***REMOVED SENSITIVE VALUE***" }, "tempdirectory": "\/media\/usbdrive\/ncdata\/tmp", "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "preview_max_x": "2048", "preview_max_y": "2048", "jpeg_quality": "60", "overwriteprotocol": "https", "maintenance": false, "loglevel": "2", "log_type": "file", "htaccess.RewriteBase": "\/", "logfile": "\/media\/usbdrive\/ncdata\/nextcloud.log", "mail_sendmailmode": "smtp", "mail_smtpsecure": "tls", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***" } } ```

Are you using external storage, if yes which one: Usb Drive

Are you using encryption: no

Are you using an external user-backend, if yes which one: N/A

Client configuration

Browser: any

Operating system: any

kescherCode commented 4 years ago

I think that would require the maintenance state to be put into multiple locations. Currently, this is in your config.php, which is located in your data folder.

kesselb commented 4 years ago

which is located in your data folder.

No. datadirectory is a configuration value hence if config.php would be in the datadirectory that would be a unsolvable dependency ;)

manofthepeace commented 4 years ago

@kesselb is right. the "installation" directory is not the same as the data directory. My nextcloud installation is on a local disk in /var/www/nextcloud, where the config.php is. In that config.php, there is the path to the data dir, which is on a external removable drive.

kescherCode commented 4 years ago

@kesslb @manofthepeace Oh, I see. I misunderstood that.

szaimen commented 3 years ago

Is this Issue still valid? If not, please close this issue. Thanks! :)

ghost commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

manofthepeace commented 3 years ago

Sorry for the delay. Yes the issue is still valid.

szaimen commented 3 years ago

Also on NC21.0.2?

manofthepeace commented 3 years ago

I am currently on NC20.X. Will try on 21.0.2 and report back.

manofthepeace commented 3 years ago

Tested on 21.0.2. The ncdata check still takes precedence on the maintenance message.;

Error

    Your data directory is invalid

    Ensure there is a file called ".ocdata" in the root of the data directory.
szaimen commented 3 years ago

cc @nextcloud/designers

joshtrichards commented 2 weeks ago

If someone wants this change badly enough (or a "good first issue") all that needs to happen (I believe)... is probably an additional check for $config->getSystemValueBool('maintenance', false) right about here:

https://github.com/nextcloud/server/blob/e2983111e61cbf5ab521b246b31c1916dd29fa87/lib/private/legacy/OC_Util.php#L380-L383