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

[Bug]: Fatal encryption A public master key is available but the private key could not be found. This should never happen. #41704

Open Majestic7979 opened 11 months ago

Majestic7979 commented 11 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

I am seeing this in the logs. Not sure what is causing it!? I have the encryption enabled in my settings. I am running the Docker container. Debian 12 host. 13th gen Intel i5 in case it's relevant due to AES extensions.

Steps to reproduce

Check the logs... Filter by Fatal. It's there.

Expected behavior

No error, since it says it should never happen.

Installation method

Community Docker image

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

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

None

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

Configuration report

{
    "system": {
        "default_phone_region": "GB",
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "opcache.memory_consumption": "512",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xxxxxx"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.1.3.2",
        "overwrite.cli.url": "xxxxxxx",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "maintenance": false,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "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***",
        "loglevel": 2,
        "app_install_overwrite": [
            "maps",
            "workflow_ocr"
        ],
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "enable_previews": true,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\PDF",
            "2": "OC\\Preview\\Image",
            "3": "OC\\Preview\\Photoshop",
            "4": "OC\\Preview\\TIFF",
            "5": "OC\\Preview\\SVG",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\MKV",
            "8": "OC\\Preview\\MP4",
            "9": "OC\\Preview\\AVI",
            "10": "OC\\Preview\\ARW"
        },
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.vod.nvenc": true,
        "memories.vod.nvenc.temporal_aq": true,
        "memories.gis_type": 1,
        "memories.vod.external": true
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0
  - calendar: 4.5.3
  - camerarawpreviews: 0.8.2
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.4.2
  - 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_external: 1.19.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
  - forms: 3.3.1
  - groupfolders: 15.3.1
  - integration_youtube: 0.1.5
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - mail: 3.4.4
  - maps: 1.1.1
  - memories: 6.1.0
  - metadata: 0.19.0
  - nextcloud_announcements: 1.16.0
  - notes: 4.8.1
  - notifications: 2.15.0
  - oauth2: 1.15.1
  - password_policy: 1.17.0
  - photos: 2.3.0
  - previewgenerator: 5.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recognize: 5.0.3
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - richdocuments: 8.2.3
  - richdocumentscode: 23.5.503
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - spreed: 17.1.3
  - support: 1.10.0
  - survey_client: 1.15.0
  - suspicious_login: 5.0.0
  - systemtags: 1.17.0
  - tasks: 0.15.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_totp: 9.0.0
  - updatenotification: 1.17.0
  - user_ldap: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflow_ocr: 1.27.5
  - workflowengine: 2.9.0
Disabled:

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Nope, there's a lot of sensitive data there like confidential filenames. Ask me for specifics to look into the log file.

Additional info

Nothing else to add.

Majestic7979 commented 11 months ago
image
joshtrichards commented 11 months ago

Please provide the full stack trace and/or immediately prior transaction that seems to trigger this message. Otherwise we're flying blind here...

Obviously redact filenames/users/domains as deemed appropriate.

Also, when did these start popping up in your logs precisely?

asheroto commented 11 months ago

This happens on a brand new server....

nephilim75 commented 10 months ago

I am facing the same issue. It came up, once the encryption module has been activated in app store and afterwards within the security settings. I have a fresh installed environment, no further users then the admin account. No files uploaded yet. Created for test purposes.

Same here: official docker container loaded from here, base version - apache

grafik

[encryption] Fatal: A public master key is available but the private key could not be found. This should never happen.

GET /ocs/v2.php/apps/notifications/api/v2/notifications
from 172.24.0.1 by admin at 2023-12-09T16:42:50+00:00

{"reqId":"Ap9txnJ9zahwX6FAzxqY","level":4,"time":"2023-12-09T16:42:50+00:00","remoteAddr":"172.24.0.1","user":"admin","app":"encryption","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"A public master key is available but the private key could not be found. This should never happen.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0","version":"27.1.4.1","data":{"app":"encryption"},"id":"6574a71ff3f6c"}

2023-12-09.md

Anything else you need to investigate further?

Kind regards //neph

nextcloud-command commented 9 months 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.

asheroto commented 9 months ago

Are you still needing a stack trace since it's a new server and others are experiencing the same issue?