nextcloud / nextcloud/server

[Bug]: Encryption errors on v27

Open
#40,513 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 27-feedback bug feature: encryption (server-side) feature: versions needs review
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

hello, I recently installed nextcloud 27.0.1 and everything was working fine, but after enabling encryption and trying to move a large number of folders, some of them have pending status and when opening the files I get the error HBEGIN:oc_encryption_module:OC_DEFAULT_MODULE: cipher:AES-256-CTR:sign…

Steps to reproduce

1 . Enable Encryption
2 . Let user1 share 2 folders, place some dummy content in folder1 with multiple layers of directories. (folder1/test/test2/file.txt)
3 . Let user2 move the folder inside folder1 to folder2 (Using web GUI)
4 . Process get stuck and Encryption errors in Logging

Expected behavior

Using occ file versions corrects the files, but the problem continues to occur with new copy attempts. In previous posts, the root cause was not explained nor how to correct it, only how to recover the files.

Installation method

Community Docker image

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

PostgreSQL

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

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",
            "ip",
            "-webwork",
            "ip",
            "webwork.domain.com.br",
            "webwork-onlyoffice.domain.com.br"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "27.0.1.2",
        "overwrite.cli.url": "https:\/\/webwork.domain.com.br",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "upgrade.disable-web": true,
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": "2",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "mail_smtpmode": "smtp",
        "remember_login_cookie_lifetime": "1800",
        "log_rotate_size": "0",
        "trashbin_retention_obligation": "auto, 60",
        "versions_retention_obligation": "auto, 180",
        "activity_expire_days": "120",
        "simpleSignUpLink.shown": false,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0.5,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "default_phone_region": "br",
        "logtimezone": "America\/",
        "htaccess.RewriteBase": "\/",
        "share_folder": "\/Shared",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "preview_concurrency_new": "8",
        "preview_concurrency_all": "16",
        "maintenance": false,
        "onlyoffice": {
            "jwt_secret": "VHRtYM92WhV5twcpSakVTPwKfmch",
            "jwt_header": "AuthorizationJwt"
        },
        "allow_local_remote_servers": "true",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}
List of activated Apps
Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0
  - calendar: 4.4.3
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.3.2
  - contactsinteraction: 1.8.0
  - dashboard: 7.7.0
  - dav: 1.27.0
  - drawio: 2.1.2
  - encryption: 2.15.0
  - extract: 1.3.6
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_antivirus: 5.2.1
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notifications: 2.15.0
  - oauth2: 1.15.1
  - onlyoffice: 8.1.0
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - snappymail: 2.28.4
  - 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_ldap: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - workflowengine: 2.9.0
Disabled:
  - circles: 27.0.1 (installed 27.0.1)
  - files_external: 1.19.0
  - firstrunwizard: 2.16.0 (installed 2.16.0)
  - suspicious_login: 5.0.0
  - twofactor_totp: 9.0.0
  - weather_status: 1.7.0 (installed 1.7.0)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
{"reqId":"am1mk0Pie2GjWcpxLh1L","level":3,"time":"2023-09-17T16:05:03-03:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\Files_Versions\\BackgroundJob\\ExpireVersions, arguments: )","userAgent":"--","version":"27.0.1.2","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/compos/files/ADMINISTRATIVO/DP - CORROMPIDO 2/PRESTADORES DE SERVI\u00c7OS - Contratos, or\u00e7amentos e NFe/BENEF\u00cdCIOS/5. COMBUSTIVEL, TRANSPORTE E REFEI\u00c7\u00c3O/RECIBO VR E VT COMPOS E USINA.xlsx","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":135,"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":595,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"function":"OCA\\Files_Versions\\{closure}","class":"OCA\\Files_Versions\\Storage","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":610,"function":"array_filter"},{"file":"/var/www/nextcloud/apps/files_versions/lib/BackgroundJob/ExpireVersions.php","line":69,"function":"expireOlderThanMaxForUser","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":632,"function":"OCA\\Files_Versions\\BackgroundJob\\{closure}","class":"OCA\\Files_Versions\\BackgroundJob\\ExpireVersions","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/files_versions/lib/BackgroundJob/ExpireVersions.php","line":70,"function":"callForSeenUsers","class":"OC\\User\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":86,"function":"run","class":"OCA\\Files_Versions\\BackgroundJob\\ExpireVersions","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":103,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":93,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Root.php","Line":206,"message":"Error while running background job (class: OCA\\Files_Versions\\BackgroundJob\\ExpireVersions, arguments: )","exception":{},"CustomMessage":"Error while running background job (class: OCA\\Files_Versions\\BackgroundJob\\ExpireVersions, arguments: )"}}
{"reqId":"UvHsRWQLhRscVKNMETGK","level":2,"time":"2023-09-17T16:09:49-03:00","remoteAddr":"187.18.2.70","user":"0614BEF5-AE68-4E3E-BC03-AFD7B739D10F","app":"support","method":"GET","url":"/apps/snappymail/","message":"Total user count was negative (users: 31, disabled: 47)","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36","version":"27.0.1.2","data":{"app":"support"}}
{"reqId":"3AuZYDclEyHoIAerBM4L","level":2,"time":"2023-09-17T16:12:21-03:00","remoteAddr":"","user":"--","app":"support","method":"","url":"--","message":"Total user count was negative (users: 31, disabled: 47)","userAgent":"--","version":"27.0.1.2","data":{"app":"support"}}
{"reqId":"5g2MHcz8lDpiygTRwuCt","level":2,"time":"2023-09-17T16:20:03-03:00","remoteAddr":"","user":"--","app":"support","method":"","url":"--","message":"Total user count was negative (users: 31, disabled: 47)","userAgent":"--","version":"27.0.1.2","data":{"app":"support"}}
{"reqId":"ONYKPnQcT3Ox8oj4nmpB","level":2,"time":"2023-09-17T16:32:20-03:00","remoteAddr":"","user":"--","app":"support","method":"","url":"--","message":"Total user count was negative (users: 31, disabled: 47)","userAgent":"--","version":"27.0.1.2","data":{"app":"support"}}
{"reqId":"Sjf8XuOiTzzrh80rS3LI","level":3,"time":"2023-09-17T16:40:03-03:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\Files_Versions\\BackgroundJob\\ExpireVersions, arguments: )","userAgent":"--","version":"27.0.1.2","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/compos/files/ADMINISTRATIVO/DP - CORROMPIDO 2/PRESTADORES DE SERVI\u00c7OS - Contratos, or\u00e7amentos e NFe/BENEF\u00cdCIOS/5. COMBUSTIVEL, TRANSPORTE E REFEI\u00c7\u00c3O/RECIBO VR E VT COMPOS E USINA.xlsx","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":135,"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":595,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"function":"OCA\\Files_Versions\\{closure}","class":"OCA\\Files_Versions\\Storage","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":610,"function":"array_filter"},{"file":"/var/www/nextcloud/apps/files_versions/lib/BackgroundJob/ExpireVersions.php","line":69,"function":"expireOlderThanMaxForUser","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":632,"function":"OCA\\Files_Versions\\BackgroundJob\\{closure}","class":"OCA\\Files_Versions\\BackgroundJob\\ExpireVersions","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/files_versions/lib/BackgroundJob/ExpireVersions.php","line":70,"function":"callF@@@
Additional info

This is a new installation of version 27 using an Ubuntu 20 script

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the folder move with Encryption enabled, then trace the logs through apps/files_versions/lib/Storage.php, apps/files_versions/lib/BackgroundJob/ExpireVersions.php, and lib/private/Files/Node/Folder.php. Done means the move completes without pending files or encryption errors and the versions background job no longer reports the shown NotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.