Decrypt files did not work

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 27.1.3
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.52
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • 8.1.2-1ubuntu2.20
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • 13 March 2025
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

We have Nextcloud mounted on an S3 object as the storage, all the files right now are encrypted, we assume this happens after the server automatically restarts after the kernel update, suddenly all files are encrypted and the encryption setting are enabled even though before this restart the encryption settings are default/disabled because we never activate the feature.

We have following this workaround on GitHub - nextcloud/encryption-recovery-tools: This project contains tools to recover files that have been encrypted with the Nextcloud End-to-End Encryption or Nextcloud Server-Side Encryption. using the recover tools, but the results always failed.

Steps to replicate it (hint: details matter!):

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "103.153.61.64",
            "fc.serbamuliagroup.co.id",
            "sm-collabora.serbamuliagroup.co.id:8443",
            "103.152.36.34"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.1.3.2",
        "overwrite.cli.url": "https:\/\/fc.serbamuliagroup.co.id",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "dbindex": 0
        },
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Asia\/Jakarta",
        "default_phone_region": "ID",
        "installed": true,
        "skeletondirectory": "\/var\/www\/nextcloud\/default-files",
        "log_type": "file",
        "log_type_audit": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "logfile_audit": "\/var\/log\/nextcloud\/audit.log",
        "logfilemode": 416,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "richdocuments": {
            "enabled": true,
            "token_ttl": 3600,
            "wopi_url": "https:\/\/sm-collabora.serbamuliagroup.co.id:8443\/",
            "disable_certificate_verification": false
        },
        "app_install_overwrite": [
            "wopi"
        ],
        "encryption.enabled": false,
        "encryption.masterKey": true
    },
    "apps": {
        "activity": {
            "enabled": "yes",
            "installed_version": "2.19.0",
            "types": "filesystem"
        },
        "backgroundjob": {
            "lastjob": "19974"
        },
        "bruteForce": {
            "whitelist_1": "122.50.5.66\/29",
            "whitelist_2": "103.114.110.147\/29",
            "whitelist_3": "101.255.140.194\/32",
            "whitelist_4": "103.152.36.34\/29"
        },
        "bruteforcesettings": {
            "enabled": "yes",
            "installed_version": "2.7.0",
            "types": ""
        },
        "circles": {
            "enabled": "yes",
            "installed_version": "27.0.1",
            "loopback_tmp_scheme": "https",
            "maintenance_run": "0",
            "maintenance_update": "{\"3\":1716951184,\"2\":1716951184,\"1\":1716951184}",
            "migration_22": "1",
            "migration_run": "0",
            "types": "filesystem,dav"
        },
        "cloud_federation_api": {
            "enabled": "yes",
            "installed_version": "1.10.0",
            "types": "filesystem"
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "logging"
        },
        "contactsinteraction": {
            "enabled": "yes",
            "installed_version": "1.8.0",
            "types": "dav"
        },
        "core": {
            "cronErrors": "[{\"error\":\"Your data directory is invalid.\",\"hint\":\"Ensure there is a file called \\\".ocdata\\\" in the root of the data directory.\"},{\"error\":\"Cannot create \\\"data\\\" directory.\",\"hint\":\"This can usually be fixed by giving the web server write access to the root directory. See https:\\\/\\\/docs.nextcloud.com\\\/server\\\/27\\\/go.php?to=admin-dir_permissions\"}]",
            "default_encryption_module": "OC_DEFAULT_MODULE",
            "emailTestSuccessful": "1",
            "encryption_enabled": "yes",
            "installedat": "1709112425.0222",
            "lastcron": "1742446152",
            "lastupdateResult": "{\"version\":\"27.1.11.3\",\"versionstring\":\"Nextcloud 27.1.11\",\"url\":\"https:\\\/\\\/download.nextcloud.com\\\/server\\\/releases\\\/nextcloud-27.1.11.zip\",\"web\":\"https:\\\/\\\/docs.nextcloud.com\\\/server\\\/27\\\/admin_manual\\\/maintenance\\\/upgrade.html\",\"changes\":\"https:\\\/\\\/updates.nextcloud.com\\\/changelog_server\\\/?version=27.1.11\",\"autoupdater\":\"1\",\"eol\":\"1\"}",
            "lastupdatedat": "1742364698",
            "moveavatarsdone": "yes",
            "oc.integritycheck.checker": "[]",
            "previewsCleanedUp": "1",
            "public_files": "files_sharing\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "shareapi_enable_link_password_by_default": "yes",
            "vendor": "nextcloud"
        },
        "dashboard": {
            "enabled": "yes",
            "installed_version": "7.7.0",
            "types": ""
        },
        "dav": {
            "buildCalendarReminderIndex": "yes",
            "buildCalendarSearchIndex": "yes",
            "enabled": "yes",
            "installed_version": "1.27.0",
            "regeneratedBirthdayCalendarsForYearFix": "yes",
            "types": "filesystem"
        },
        "encryption": {
            "enabled": "yes",
            "encryptHomeStorage": "0",
            "installed_version": "2.15.0",
            "masterKeyId": "master_0a82c737",
            "publicShareKeyId": "pubShare_0a82c737",
            "recoveryKeyId": "recoveryKey_0a82c737",
            "types": "filesystem"
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": ""
        },
        "federation": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "authentication"
        },
        "files": {
            "default_quota": "10 GB",
            "enabled": "yes",
            "installed_version": "1.22.0",
            "types": "filesystem",
            "watermark_allGroups": "no",
            "watermark_allGroupsList": "",
            "watermark_allTags": "no",
            "watermark_allTagsList": "",
            "watermark_enabled": "no",
            "watermark_linkAll": "no",
            "watermark_linkRead": "no",
            "watermark_linkSecure": "no",
            "watermark_linkTags": "no",
            "watermark_linkTagsList": "",
            "watermark_shareAll": "no",
            "watermark_shareRead": "no",
            "watermark_text": ""
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "2.8.0",
            "types": ""
        },
        "files_reminders": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": ""
        },
        "files_rightclick": {
            "enabled": "yes",
            "installed_version": "1.6.0",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "filesystem"
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "filesystem,dav"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.20.0",
            "types": "filesystem,dav"
        },
        "firstrunwizard": {
            "enabled": "yes",
            "installed_version": "2.16.0",
            "types": "logging"
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "2.12.0",
            "types": "logging"
        },
        "lookup_server_connector": {
            "enabled": "yes",
            "installed_version": "1.15.0",
            "types": "authentication"
        },
        "nextcloud_announcements": {
            "enabled": "yes",
            "installed_version": "1.16.0",
            "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200",
            "types": "logging"
        },
        "notifications": {
            "enabled": "yes",
            "installed_version": "2.15.0",
            "types": "logging"
        },
        "oauth2": {
            "enabled": "yes",
            "installed_version": "1.15.1",
            "types": "authentication"
        },
        "password_policy": {
            "enabled": "yes",
            "enforceNumericCharacters": "1",
            "enforceSpecialCharacters": "1",
            "enforceUpperLowerCase": "1",
            "installed_version": "1.17.0",
            "minLength": "12",
            "types": "authentication"
        },
        "photos": {
            "enabled": "yes",
            "installed_version": "2.3.0",
            "lastPlaceMappedUser": "admin",
            "lastPlaceMappingDone": "true",
            "types": "dav,authentication"
        },
        "previewgenerator": {
            "enabled": "yes",
            "installed_version": "5.5.0",
            "types": "filesystem"
        },
        "privacy": {
            "enabled": "yes",
            "fullDiskEncryptionEnabled": "1",
            "installed_version": "1.11.0",
            "readableLocation": "id",
            "types": ""
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "prevent_group_restriction"
        },
        "recommendations": {
            "enabled": "yes",
            "installed_version": "1.6.0",
            "types": ""
        },
        "related_resources": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": ""
        },
        "richdocuments": {
            "disable_certificate_verification": "yes",
            "edit_groups": "admin",
            "enabled": "yes",
            "external_apps": "",
            "installed_version": "8.2.15",
            "public_wopi_url": "https:\/\/sm-collabora.serbamuliagroup.co.id",
            "types": "prevent_group_restriction",
            "use_groups": "admin",
            "wopi_allowlist": "103.153.61.162",
            "wopi_url": "https:\/\/sm-collabora.serbamuliagroup.co.id:8443"
        },
        "richdocumentscode": {
            "enabled": "no",
            "installed_version": "24.4.1103",
            "types": ""
        },
        "serverinfo": {
            "cached_count_filecache": "880904",
            "cached_count_storages": "134",
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": ""
        },
        "settings": {
            "enabled": "yes",
            "installed_version": "1.9.0",
            "types": ""
        },
        "sharebymail": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "filesystem"
        },
        "support": {
            "SwitchUpdaterServerHasRun": "yes",
            "enabled": "yes",
            "installed_version": "1.10.0",
            "types": "session"
        },
        "survey_client": {
            "enabled": "yes",
            "installed_version": "1.15.0",
            "types": ""
        },
        "systemtags": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "logging"
        },
        "text": {
            "enabled": "yes",
            "installed_version": "3.8.0",
            "types": "dav"
        },
        "theming": {
            "backgroundMime": "image\/png",
            "cachebuster": "28",
            "enabled": "yes",
            "faviconMime": "image\/vnd.microsoft.icon",
            "installed_version": "2.2.0",
            "logoMime": "image\/png",
            "logoheaderMime": "image\/png",
            "name": "Serba Mulia Group",
            "slogan": "***REMOVED SENSITIVE VALUE***",
            "types": "logging",
            "url": "***REMOVED SENSITIVE VALUE***"
        },
        "twofactor_backupcodes": {
            "enabled": "yes",
            "installed_version": "1.16.0",
            "types": ""
        },
        "updatenotification": {
            "core": "27.1.9.1",
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "",
            "update_check_errors": "0"
        },
        "user_status": {
            "enabled": "yes",
            "installed_version": "1.7.0",
            "types": ""
        },
        "viewer": {
            "enabled": "yes",
            "installed_version": "2.1.0",
            "types": ""
        },
        "weather_status": {
            "enabled": "yes",
            "installed_version": "1.7.0",
            "types": ""
        },
        "wopi": {
            "disable_certificate_verification": "",
            "doc_format": "",
            "edit_groups": "admin",
            "enabled": "no",
            "installed_version": "3.5.11",
            "public_wopi_url": "https:\/\/sm-collabora.serbamuliagroup.co.id:8443",
            "types": "filesystem,dav,prevent_group_restriction",
            "wopi_url": ""
        },
        "workflowengine": {
            "enabled": "yes",
            "installed_version": "2.9.0",
            "logfile": "\/var\/log\/nextcloud.log",
            "types": "filesystem"
        }
    }
}

Apps

The output of occ app:list (if possible).

  • activity: 2.19.0
  • bruteforcesettings: 2.7.0
  • circles: 27.0.1
  • cloud_federation_api: 1.10.0
  • comments: 1.17.0
  • contactsinteraction: 1.8.0
  • dashboard: 7.7.0
  • dav: 1.27.0
  • encryption: 2.15.0
  • federatedfilesharing: 1.17.0
  • federation: 1.17.0
  • files: 1.22.0
  • files_pdfviewer: 2.8.0
  • files_reminders: 1.0.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
  • logreader: 2.12.0
  • lookup_server_connector: 1.15.0
  • nextcloud_announcements: 1.16.0
  • notifications: 2.15.0
  • oauth2: 1.15.1
  • password_policy: 1.17.0
  • photos: 2.3.0
  • previewgenerator: 5.5.0
  • privacy: 1.11.0
  • provisioning_api: 1.17.0
  • recommendations: 1.6.0
  • related_resources: 1.2.0
  • richdocuments: 8.2.15
  • 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
  • updatenotification: 1.17.0
  • user_status: 1.7.0
  • viewer: 2.1.0
  • weather_status: 1.7.0
  • workflowengine: 2.9.0
    Disabled:
  • admin_audit: 1.17.0
  • files_external: 1.19.0
  • suspicious_login: 5.0.0
  • twofactor_totp: 9.0.0
  • user_ldap: 1.17.0

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

There is no scenario where Nextcloud automatically enables server-side encryption.

Fail how? We can’t help without specific details.

Though if the files are accessible within Nextcloud and you’re only goal is to decrypt the files and to be able to then disable encryption, you can just follow the documented approach for decrypting as described in the Admin Manual here:


There is a failed when tried to decrypt. We also see some files are Done, but when try to download and open the file, it’s still can’t be opened.

I was referring to using the occ encryption:decrypt-all process in the linked documentation, not the external recovery tools.

we have tried the decrypt-all command, but the files are still encrypted when we opened them.

Have you tried encryption-recovery-tools?: [SOLVED] Decrypting encrypted files (using the default Server-side encryption) - #2 by wwe

We have tried this tool, no issues with the tools some files are error/failed and some are Done when we run it, but when we checked on the destination directory for the decrypted files, there are none of the Succeeded files, just empty directory unfortunately.