nextcloud / updater

:arrows_counterclockwise: The updater app to keep your Nextcloud up-to-date
GNU Affero General Public License v3.0
47 stars 32 forks source link

[Bug]: Update from Nextcloud 24.0.6 to 24.0.9 not working #467

Open nemihome opened 1 year ago

nemihome commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

Update from Nextcloud 24.0.6 to 24.0.9 not working

Steps to reproduce

  1. Update via Web Updater or /occ upgrade

Expected behavior

Update running through or descriptive error message

Installation method

None

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

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

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{
    "system": {
        "overwritehost": "URL1:8082",
        "overwritewebroot": "\/nextcloud",
        "overwrite.cli.url": "https:\/\/URL1:8082\/nextcloud",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "URL1",
            "1": "URL1:8082",
            "3": "URL2:8082",
            "4": "URL2.de"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.6.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "enable_previews": true,
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore ",
        "0": "--convert-to pdf --outdir ",
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\MSOfficeDOC",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\StarOffice"
        ],
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db"
        ],
        "overwriteprotocol": "https",
        "preview_max_x": 1000,
        "preview_max_y": 1000,
        "preview_max_scale_factor": 1,
        "logtimezone": "Europe\/Berlin",
        "log_type": "file",
        "logfile": "\/var\/nextcloud\/nextcloud.log",
        "loglevel": 0,
        "logdateformat": "F d, Y H:i:s",
        "cipher": "AES-256-CFB",
        "has_internet_connection": true,
        "check_for_working_webdav": true,
        "check_for_working_wellknown_setup": true,
        "check_for_working_htaccess": true,
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "twofactor_enforced": "true",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 0
        },
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "theme": "",
        "updater.release.channel": "stable",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_smtpport": "587",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "DE",
        "app_install_overwrite": [
            "twofactor_email",
            "uploaddetails",
            "rainloop",
            "ocdownloader",
            "ransomware_detection",
            "twofactor_rcdevsopenotp",
            "bruteforcesettings",
            "documentserver_community",
            "files_fulltextsearch_tesseract",
            "bookmarks",
            "richdocuments",
            "fulltextsearch",
            "fulltextsearch_elasticsearch",
            "files_fulltextsearch",
            "metadata",
            "onlyoffice"
        ],
        "mail_smtpsecure": "tls"
    }

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - bookmarks: 11.0.4
  - bruteforcesettings: 2.4.0
  - calendar: 3.5.4
  - circles: 24.0.1
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - documentserver_community: 0.1.12
  - extract: 1.3.5
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_fulltextsearch: 24.0.1
  - files_fulltextsearch_tesseract: 24.0.0
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - fulltextsearch: 24.0.0
  - fulltextsearch_elasticsearch: 24.0.1
  - gpxpod: 4.3.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - maps: 0.2.2
  - metadata: 0.17.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.1
  - oauth2: 1.12.0
  - ocdownloader: 1.9.1
  - onlyoffice: 7.5.8
  - password_policy: 1.14.0
  - photos: 1.6.0
  - previewgenerator: 5.1.1
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - rainloop: 7.2.6
  - recommendations: 1.3.0
  - richdocuments: 6.3.3
  - richdocumentscode: 22.5.802
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_email: 2.7.1
  - twofactor_totp: 6.4.1
  - updatenotification: 1.14.0
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - uploaddetails: 0.1.3
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Update from Nextcloud 24.0.6 to 24.0.9 not working:

Update vorbereiten

Log-Level auf "debug" gesetzt
Wartungsmodus eingeschaltet
Reparaturschritt: Repair MySQL collation
Reparaturinformation: All tables already have the correct collation -> nothing to do
Reparaturschritt: Repair SQLite autoincrement
Reparaturschritt: Copy data from accounts table when migrating from ownCloud
Reparaturschritt: Drop account terms table when migrating from ownCloud
Das Datenbankschema wird aktualisiert
Datenbank aktualisiert
Es ist ein Fehler aufgetreten.

After that Nextcloud is in maintenance mode. I can switch that off and run exactly into the same result. There is no log file from the update byself.

With manual upgrade via /occ upgrade the messages are:

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Updating database schema
Updated database
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Resetting log level

Result after that when calling nextloud page:
Ihr Datenverzeichnis ist ungültig.

Stellen Sie sicher, dass eine Datei ".ocdata" im Wurzelverzeichnis des Datenverzeichnisses existiert.

This is wrong. The .ocdata is working the authorizations are exactly the same than before upgrade. I can also copy the backup before installation of the update and no errors are shown. The path in the config.php file is correct.

{"reqId":"gGCLTepy3gO6nST07YQv","level":1,"time":"January 17, 2023 14:40:45","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"/nextcloud/occ","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"24.0.6.1","data":[]}
{"reqId":"gGCLTepy3gO6nST07YQv","level":1,"time":"January 17, 2023 14:40:45","remoteAddr":"","user":"--","app":"updater","method":"","url":"/nextcloud/occ","message":"\\OC\\Repair::step: Repair step: Add token cleanup job","userAgent":"--","version":"24.0.6.1","data":{"app":"updater"}}
{"reqId":"gGCLTepy3gO6nST07YQv","level":1,"time":"January 17, 2023 14:40:45","remoteAddr":"","user":"--","app":"updater","method":"","url":"/nextcloud/occ","message":"\\OC\\Updater::startCheckCodeIntegrity: Starting code integrity check...","userAgent":"--","version":"24.0.6.1","data":{"app":"updater"}}
{"reqId":"gGCLTepy3gO6nST07YQv","level":1,"time":"January 17, 2023 14:40:51","remoteAddr":"","user":"--","app":"updater","method":"","url":"/nextcloud/occ","message":"\\OC\\Updater::finishedCheckCodeIntegrity: Finished code integrity check","userAgent":"--","version":"24.0.6.1","data":{"app":"updater"}}
{"reqId":"gGCLTepy3gO6nST07YQv","level":1,"time":"January 17, 2023 14:40:51","remoteAddr":"","user":"--","app":"updater","method":"","url":"/nextcloud/occ","message":"\\OC\\Updater::updateEnd: Update successful","userAgent":"--","version":"24.0.9.2","data":{"app":"updater"}}
{"reqId":"gGCLTepy3gO6nST07YQv","level":1,"time":"January 17, 2023 14:40:51","remoteAddr":"","user":"--","app":"updater","method":"","url":"/nextcloud/occ","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"24.0.9.2","data":{"app":"updater"}}
{"reqId":"gGCLTepy3gO6nST07YQv","level":1,"time":"January 17, 2023 14:40:51","remoteAddr":"","user":"--","app":"updater","method":"","url":"/nextcloud/occ","message":"\\OC\\Updater::resetLogLevel: Reset log level to Debug(0)","userAgent":"--","version":"24.0.9.2","data":{"app":"updater"}}

Additional info

No response

szaimen commented 1 year ago

Is your datadirectory on a separate drive?

nemihome commented 1 year ago

Data: /var/nextcloud/data and Web: /var/www/html/URL/nextcloud

szaimen commented 1 year ago

did you make sure that the drive is still corrreclty mounted?

nemihome commented 1 year ago

Yes, before update I can access everything but I think it's also strange that web updater is not running through. I think this error message is maybe only the last in the row.

nemihome commented 1 year ago

Well I think I found something. The datadir was not the problem. Nextcloud did overwrite user.ini on that server in the nextcloud folder (but this did not happen with this update it happened already at the last update). Not sure why 24.0.6 did work that way and update to 24.0.9 did not (maybe I have tried to get rid of the modified user.ini error). Therefore php basedir settings were overwritten before this update. On a higher folder level there were still basedir restrictions in place. Due to the fact that /tmp was not available because of the restictions on upper folder level the abovementioned effects occur. I removed the restrictions completely. The error messages from Nextcloud are not helful to identify such root causes. Basically the message should not point to data directory or in case of web installer to nowhere. If data directory would be the problem 24.0.6 would also not work but it did with exactly the same user.ini file. Problem can only be related to requirements within update process or changed requirements.

joshtrichards commented 7 months ago

Hi @nemihome

Therefore php basedir settings were overwritten before this update. On a higher folder level there were still basedir restrictions in place. Due to the fact that /tmp was not available because of the restictions on upper folder level the abovementioned effects occur. I removed the restrictions completely. The error messages from Nextcloud are not helful to identify such root causes. Basically the message should not point to data directory or in case of web installer to nowhere. If data directory would be the problem 24.0.6 would also not work but it did with exactly the same user.ini file. Problem can only be related to requirements within update process or changed requirements.

I'm not really following this. It sounds like you made local changes to your Nextcloud .user.ini because you have open_basedir restrictions in place. Is that correct? And since the one in the Nextcloud installation folder is managed by Nextcloud it was overwritten during the Updater run. This then led to later problems when the db/app upgrades ran as well as when you tried to access Nextcloud after the update (e.g. the .ocdata error)?

The .ocdata one makes sense: the open_basedir restrictions were in place. We just do a simple file_exists() check and with the restriction in place PHP tells us "doesn't exist" if it's not permitting us to access it.

I can't say what other specific error messages you might trigger in either the Updater or the upgrader because it'll depend on the specific restrictions you have in place I guess.

There may be some hints in your data/updater.log.