Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Internal Server Error - hash_hkdf(): Argument #2 ($key) cannot be empty #36851

Closed
6 of 9 tasks
denics opened this issue Feb 24, 2023 · 1 comment
Closed
6 of 9 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@denics
Copy link

denics commented Feb 24, 2023

⚠️ This issue respects the following points: ⚠️

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

Bug description

Since I have upgraded to nextcloud 25 I get this error in my raspberry :

==> /var/data/nextcloud.log <==
{"reqId":"xxx","level":3,"time":"2023-02-24T11:42:46+00:00","remoteAddr":"xxx","user":"xxx","app":"index","method":"GET","url":"/","message":"hash_hkdf(): Argument #2 ($key) cannot be empty","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.4.1","exception":{"Exception":"ValueError","Message":"hash_hkdf(): Argument #2 ($key) cannot be empty","Code":0,"Trace":[{"file":"/var/opt/nextcloud/lib/private/Security/Crypto.php","line":160,"function":"hash_hkdf"},{"file":"/var/opt/nextcloud/lib/private/Security/Crypto.php","line":134,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":530,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":510,"function":"decryptValue","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->","args":["*** sensitive parameters replaced ***"]},{"function":"OCA\\Files_External\\Service\\{closure}","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":508,"function":"array_map"},{"function":"createKeyValueMap","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":486,"function":"array_map"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":421,"function":"getConfigForMounts","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":116,"function":"getMountsFromQuery","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/UserGlobalStoragesService.php","line":194,"function":"getMountsForUser","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php","line":120,"function":"getAllStoragesForUser","class":"OCA\\Files_External\\Service\\UserGlobalStoragesService","type":"->"},{"file":"/var/opt/nextcloud/lib/private/Files/Config/MountProviderCollection.php","line":124,"function":"getMountsForUser","class":"OCA\\Files_External\\Config\\ConfigAdapter","type":"->"},{"file":"/var/opt/nextcloud/lib/private/Files/SetupManager.php","line":226,"function":"addMountForUser","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/var/opt/nextcloud/lib/private/Files/SetupManager.php","line":318,"function":"OC\\Files\\{closure}","class":"OC\\Files\\SetupManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/lib/private/Files/SetupManager.php","line":227,"function":"setupForUserWith","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/opt/nextcloud/lib/private/legacy/OC_Util.php","line":111,"function":"setupForUser","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/opt/nextcloud/lib/base.php","line":1086,"function":"setupFS","class":"OC_Util","type":"::"},{"file":"/var/opt/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/opt/nextcloud/lib/private/Security/Crypto.php","Line":160,"CustomMessage":"--"}}

Steps to reproduce

  1. login

Expected behavior

no error as I have a secret in my configuration.php

Installation method

Community NextcloudPi appliance

Operating system

Other

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 from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "FR",
        "dbtype": "mysql",
        "version": "25.0.4.1",
        "overwrite.cli.url": "https:\/\/gcloud.denix.name\/",
        "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": "\/tmp\/",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_sendmailmode": "smtp",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "htaccess.RewriteBase": "\/",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "loglevel": "2",
        "log_type": "file",
        "maintenance": false,
        "theme": "",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - admin_audit: 1.15.0
  - calendar: 4.2.4
  - cloud_federation_api: 1.8.0
  - contacts: 5.1.0
  - contactsinteraction: 1.6.0
  - cospend: 1.5.8
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - files: 1.20.1
  - files_antivirus: 4.0.2
  - files_external: 1.17.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - lookup_server_connector: 1.13.0
  - maps: 0.2.4
  - notes: 4.6.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recognize: 3.5.0
  - related_resources: 1.0.4
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - tasks: 0.14.5
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - twofactor_totp: 7.0.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - workflowengine: 2.7.0
Disabled:
  - bruteforcesettings: 2.4.0
  - circles: 22.1.1
  - comments: 1.6.0
  - dashboard: 7.1.0
  - encryption: 2.4.0
  - federation: 1.6.0
  - files_pdfviewer: 2.1.0
  - files_versions: 1.9.0
  - firstrunwizard: 2.5.0
  - logreader: 2.1.0
  - nextcloud_announcements: 1.5.0
  - nextcloudpi
  - previewgenerator: 3.1.1
  - recommendations: 1.0.0
  - support: 1.0.0
  - survey_client: 1.4.0
  - suspicious_login
  - systemtags: 1.6.0
  - text: 1.1.1
  - user_ldap
  - weather_status: 1.1.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"xxx","level":3,"time":"2023-02-24T11:42:46+00:00","remoteAddr":"xxx","user":"xxx","app":"index","method":"GET","url":"/","message":"hash_hkdf(): Argument #2 ($key) cannot be empty","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.4.1","exception":{"Exception":"ValueError","Message":"hash_hkdf(): Argument #2 ($key) cannot be empty","Code":0,"Trace":[{"file":"/var/opt/nextcloud/lib/private/Security/Crypto.php","line":160,"function":"hash_hkdf"},{"file":"/var/opt/nextcloud/lib/private/Security/Crypto.php","line":134,"function":"decryptWithoutSecret","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":530,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":510,"function":"decryptValue","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->","args":["*** sensitive parameters replaced ***"]},{"function":"OCA\\Files_External\\Service\\{closure}","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":508,"function":"array_map"},{"function":"createKeyValueMap","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":486,"function":"array_map"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":421,"function":"getConfigForMounts","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/DBConfigService.php","line":116,"function":"getMountsFromQuery","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Service/UserGlobalStoragesService.php","line":194,"function":"getMountsForUser","class":"OCA\\Files_External\\Service\\DBConfigService","type":"->"},{"file":"/var/opt/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php","line":120,"function":"getAllStoragesForUser","class":"OCA\\Files_External\\Service\\UserGlobalStoragesService","type":"->"},{"file":"/var/opt/nextcloud/lib/private/Files/Config/MountProviderCollection.php","line":124,"function":"getMountsForUser","class":"OCA\\Files_External\\Config\\ConfigAdapter","type":"->"},{"file":"/var/opt/nextcloud/lib/private/Files/SetupManager.php","line":226,"function":"addMountForUser","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/var/opt/nextcloud/lib/private/Files/SetupManager.php","line":318,"function":"OC\\Files\\{closure}","class":"OC\\Files\\SetupManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/opt/nextcloud/lib/private/Files/SetupManager.php","line":227,"function":"setupForUserWith","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/opt/nextcloud/lib/private/legacy/OC_Util.php","line":111,"function":"setupForUser","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/var/opt/nextcloud/lib/base.php","line":1086,"function":"setupFS","class":"OC_Util","type":"::"},{"file":"/var/opt/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/opt/nextcloud/lib/private/Security/Crypto.php","Line":160,"CustomMessage":"--"}}

Additional info

No response

@denics denics added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 24, 2023
@solracsf
Copy link
Member

Duplicate of #34012

@solracsf solracsf marked this as a duplicate of #34012 Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

2 participants