server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: OpenSSL 3 - multikeyencryption failed

Open dl3it opened this issue 4 years ago • 7 comments

⚠️ This issue respects the following points: ⚠️

  • [X] This is a bug, not a question or a configuration/webserver/proxy issue.
  • [X] This issue is not already reported on Github (I've searched it).
  • [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • [X] I agree to follow Nextcloud's Code of Conduct.

Bug description

nc 24.0.0, ubuntu 22.04, php8.1

when uploading a file, an error occurs:

"Verschlüsselung nicht bereit: multikeyencryption failed error:0480006C:PEM routines::no start line"

During installation check, no further errors are reported.

Steps to reproduce

  1. upgrade to nextcloud 24.0.0
  2. upgrade to ubuntu 22.04 3.

Expected behavior

files should upload as before

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

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

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

  • [X] 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.110.14",
            "cloud.dl3it.de",
            "cloud.fritz.box"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "http:\/\/192.168.110.14",
        "dbtype": "mysql",
        "version": "24.0.0.12",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "maintenance": false,
        "theme": "",
        "loglevel": 5,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mysql.utf8mb4": true,
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "mail_sendmailmode": "smtp",
        "default_phone_region": "DE",
        "updater.release.channel": "beta"
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - calendar: 3.3.0
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.1.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - encryption: 2.12.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.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
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notes: 4.3.1
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - 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
  - 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
  - bruteforcesettings: 2.3.0
  - files_external
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"Nw5IcDO22xtsQOl0MQM7","level":4,"time":"2022-05-15T16:47:59+00:00","remoteAddr":"2a02:8071:2bc0:f0f9:82f:e212:d17e:373b","user":"dl3it","app":"webdav","method":"PUT","url":"/remote.php/webdav/m900.key","message":"Verschlüsselung nicht bereit: multikeyencryption failed error:0480006C:PEM routines::no start line","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"24.0.0.12","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"Verschlüsselung nicht bereit: multikeyencryption failed error:0480006C:PEM routines::no start line","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":308,"function":"convertToSabreException","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[{"__class__":"OCA\\Encryption\\Exceptions\\MultiKeyEncryptException"}]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":164,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["m900.key",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["m900.key",null,null]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":83,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":722,"Previous":{"Exception":"OCA\\Encryption\\Exceptions\\MultiKeyEncryptException","Message":"multikeyencryption failed error:0480006C:PEM routines::no start line","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/encryption/lib/Crypto/Encryption.php","line":291,"function":"multiKeyEncrypt","class":"OCA\\Encryption\\Crypto\\Crypt","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Stream/Encryption.php","line":454,"function":"end","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["/dl3it/files/m900.key.ocTransferId1654088379.part","0end"]},{"function":"stream_close","class":"OC\\Files\\Stream\\Encryption","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":1070,"function":"fclose","args":[null]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":647,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->","args":["files/m900.key.ocTransferId1654088379.part",null,null]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":237,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["files/m900.key.ocTransferId1654088379.part",null]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":164,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["m900.key",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["m900.key",null,null]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":83,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/encryption/lib/Crypto/Crypt.php","Line":728,"Hint":"multikeyencryption failed error:0480006C:PEM routines::no start line"},"CustomMessage":"--"},"id":"6281305e5036a"}

Additional info

No response

dl3it avatar May 15 '22 16:05 dl3it

I have the same error on my instance. Webdav also does not work.

zevlee avatar Jun 12 '22 10:06 zevlee

I have the same issue, and the same config. I have a hunch it's specifically an issue with PHP8.1 and Server Encryption

srappan avatar Jun 14 '22 13:06 srappan

It does not appear to be specific to PHP 8.1. I tested 7.4 and 8.0 and got the same error.

zevlee avatar Jun 15 '22 08:06 zevlee

Same here, when i dissable server side encryption it works sudo -u www-data php occ encryption:disable. I want server side encryption tho.

gookie-dev avatar Jun 17 '22 09:06 gookie-dev

I have the same issue. Fresh install.

Ubuntu 22.04 php 8.0.20 apache 2.4.52 Connecting to NC 24.0.1 via Windows app (Win 11)

Aside from the error reported by OP, I also get a few of these:

OCA\Encryption\Exceptions\MultiKeyEncryptException: multikeyencryption failed error:0308010C:digital envelope routines::unsupported

lu-krin avatar Jun 17 '22 19:06 lu-krin

The problem also exists in v23.0.6. Just checked.

zevlee avatar Jun 21 '22 07:06 zevlee

Duplicate of https://github.com/nextcloud/server/issues/32003

solracsf avatar Jun 29 '22 13:06 solracsf