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

Error: Trying to access array offset on value of type bool at /lib/private/Files/Storage/Wrapper/Encryption.php#441 #27692

Open
talesam opened this issue Jun 27, 2021 · 21 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: encryption (server-side) needs review Needs review to determine if still applicable

Comments

@talesam
Copy link

talesam commented Jun 27, 2021

Apache dockered system, with server-side encryption. Every time a file is uploaded it causes this title error.

Nextcloud 21.0.2 - docker (apache version 21)

Staff, server-side encryption enabled, I send a file to nextcloud and keep giving this error:

{"reqId":"nAU9EEOe7Yk3F4w9OKFH","level":3,"time":"2021-06-27T03:13:34+00:00","remoteAddr":"198.98.60.69","user":"admin","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/admin/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840","message":{"Exception":"Error","Message":"Trying to access array offset on value of type bool at /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php#441","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php","line":441,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[8,"Trying to access array offset on value of type bool","/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",441,{"0":"And 10 more entries, set log level to debug to see all entries","path":"uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840.ocTransferId1651349529.part","mode":"r","encryptionEnabled":true,"shouldEncrypt":false,"encryptionModule":null}]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":302,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->","args":["uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840.ocTransferId1651349529.part","r"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php","line":753,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840.ocTransferId1651349529.part","r"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php","line":623,"function":"copyBetweenStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->","args":[{"cache":null,"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840.ocTransferId1651349529.part","uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840",true,true]},{"file":"/var/www/html/apps/files_trashbin/lib/Storage.php","line":240,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->","args":[{"cache":null,"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840.ocTransferId1651349529.part","uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","line":292,"function":"moveFromStorage","class":"OCA\\Files_Trashbin\\Storage","type":"->","args":[{"cache":null,"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840.ocTransferId1651349529.part","uploads/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":156,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/html/apps/dav/lib/Upload/UploadFolder.php","line":46,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["94371840",null]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["94371840",null]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["uploads/admin/web-file-upload-2bb04d3a2365a787a83d9e564ce62762-1624763522335/94371840",null,null]},{"file":"/var/www/html/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/html/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/html/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/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":167,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36","version":"21.0.2.1","id":"60d7ecdf0d073"}

Captura de tela de 2021-06-27 13-14-40

How does the error happen?

Just upload any file to nextcloud with encryption enabled.

My docker-compose.yml

version: '3.9'

services:
  nc_db:
    image: postgres:13-alpine
    container_name: nc_db
    restart: always
    volumes:
      - ./volumes/db:/var/lib/postgresql/data
    env_file:
      - db.env

  nc:
    image: nextcloud:21
    container_name: nc
    restart: always
    volumes:
      - ./volumes/nextcloud:/var/www/html
      - /home/tales/nfs/Nextcloud/data:/var/www/html/data
    environment:
      - PHP_MEMORY_LIMIT=2G
      - PHP_UPLOAD_LIMIT=5G
      - POSTGRES_HOST=nc_db
      - REDIS_HOST_PASSWORD=SENHA
    env_file:
      - db.env
    depends_on:
      - nc_db
      - rds

  rds:
    image: redis:alpine
    container_name: rds
    restart: unless-stopped
    command: redis-server --requirepass SENHA
    volumes:
      - ./volumes/redis:/data

networks:
  default:
    external:
      name: nginxproxymanager_default
@talesam talesam added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 27, 2021
@AndyXheli
Copy link

maybe the same as #21578

@talesam
Copy link
Author

talesam commented Jun 28, 2021

maybe the same as #21578

These are different errors, the other one has already been fixed, this is another error, it's when sending a file.

@AndyXheli
Copy link

AndyXheli commented Jul 6, 2021

Same issue on NC 21.0.3 & 22 deleting files from External Storage SMB with encryption

{"reqId":"fDWkAxpdvBjzH6N4h6Ad","level":3,"time":"2021-07-06T18:44:57+00:00","remoteAddr":"10.0.0.1","user":"admin","app":"PHP","method":"DELETE","url":"/remote.php/dav/files/axheli/SMB/Programs/Windows%2010","message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","userAgent":"Mozilla/5.0 (Windows) mirall/3.2.3stable-Win64 (build 20210624) (Nextcloud, windows-10.0.19043 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"22.0.0.11","exception":{"Exception":"Error","Message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":441,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":301,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":753,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":651,"function":"copyBetweenStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":747,"function":"copyFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":651,"function":"copyBetweenStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":747,"function":"copyFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":623,"function":"copyBetweenStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":576,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":239,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php","line":322,"function":"moveFromStorage","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php","line":107,"function":"move2trash","class":"OCA\\Files_Trashbin\\Trashbin","type":"::"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":102,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":202,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":125,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1171,"function":"rmdir","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":350,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":309,"function":"rmdir","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":179,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"60e4a5a2c9328"}

@talesam
Copy link
Author

talesam commented Jul 6, 2021

I think they're not paying attention to this error, or they don't care about encryption.

@jknockaert
Copy link
Contributor

@AndyXheli I am no longer using the encryption app (I disabled it) and I do no longer support any code I wrote for that app.

@AndyXheli
Copy link

Still an issue on NC 22.1.1 happens while using external storage SMB

@RedKage
Copy link

RedKage commented Sep 22, 2021

Still an issue on NC 22.1.1 happens while using external storage SMB

Yeah just noticed I have these error as well, only on an external storage, just a local folder with encryption disabled on this folder.

And I do have the patch from #21578 applied on my instance.
So it seems it's a different issue.

@ksuamel
Copy link

ksuamel commented Sep 29, 2021

The same thing is happening to me while using encryption with an Amazon S3 external storage on NextCloud version 22.1.1.

edit: I'm also running inside of docker

@thecodehen
Copy link

Still receiving these errors with Nextcloud 22.2.3, External Storage connected to the local filesystem. In my case, the error is only triggered with WebDAV access.

Level App Message
Fatal webdav Error: Call to a member function getId() on array
Error PHP Error: Trying to access array offset on value of type bool at /snap/nextcloud/28713/htdocs/lib/private/Files/Storage/Wrapper/Encryption.php#669
Error PHP Error: Trying to access array offset on value of type bool at /snap/nextcloud/28713/htdocs/lib/private/Files/Storage/Wrapper/Encryption.php#441

@solracsf solracsf changed the title Error: Trying to access array offset on value of type bool at /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php#441 Error: Trying to access array offset on value of type bool at /lib/private/Files/Storage/Wrapper/Encryption.php#441 Feb 15, 2022
@openmind-bergmann
Copy link

Using 23.0.3
This also shows a popup with "Error deleting file" when a user tries to delete a file from the browser. It actually deletes the file but the user need to refresh the folder on the web ui to see the file is gone.
The file which is accessed is an external storage mapped to local.

Stacktrace as json format (click me)

{
    "reqId": "xxxxxxx",
    "level": 4,
    "time": "2022-04-06T09:30:16+00:00",
    "remoteAddr": "xx.xx.xx.xx",
    "user": "admin",
    "app": "webdav",
    "method": "DELETE",
    "url": "/remote.php/dav/files/admin/Begleitbuch/Readme.md",
    "message": "Call to a member function getId() on array",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0",
    "version": "23.0.3.2",
    "exception": {
        "Exception": "Error",
        "Message": "Call to a member function getId() on array",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/html/lib/private/Files/Cache/Wrapper/CacheWrapper.php",
                "line": 184,
                "function": "remove",
                "class": "OC\\Files\\Cache\\Cache",
                "type": "->",
                "args": [
                    "Readme.md"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/Cache/Updater.php",
                "line": 159,
                "function": "remove",
                "class": "OC\\Files\\Cache\\Wrapper\\CacheWrapper",
                "type": "->",
                "args": [
                    "Readme.md"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/View.php",
                "line": 329,
                "function": "remove",
                "class": "OC\\Files\\Cache\\Updater",
                "type": "->",
                "args": [
                    "Readme.md"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/View.php",
                "line": 1183,
                "function": "removeUpdate",
                "class": "OC\\Files\\View",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Files_Trashbin\\Storage",
                        "cache": {
                            "__class__": "OC\\Files\\Cache\\Cache"
                        },
                        "scanner": {
                            "__class__": "OC\\Files\\Cache\\Scanner"
                        },
                        "watcher": null,
                        "propagator": {
                            "__class__": "OC\\Files\\Cache\\Propagator"
                        },
                        "updater": {
                            "__class__": "OC\\Files\\Cache\\Updater"
                        }
                    },
                    "Readme.md"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/View.php",
                "line": 728,
                "function": "basicOperation",
                "class": "OC\\Files\\View",
                "type": "->",
                "args": [
                    "unlink",
                    "/Begleitbuch/Readme.md",
                    [
                        "delete"
                    ]
                ]
            },
            {
                "file": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
                "line": 495,
                "function": "unlink",
                "class": "OC\\Files\\View",
                "type": "->",
                "args": [
                    "/Begleitbuch/Readme.md"
                ]
            },
            {
                "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php",
                "line": 179,
                "function": "delete",
                "class": "OCA\\DAV\\Connector\\Sabre\\File",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
                "line": 281,
                "function": "delete",
                "class": "Sabre\\DAV\\Tree",
                "type": "->",
                "args": [
                    "files/admin/Begleitbuch/Readme.md"
                ]
            },
            {
                "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
                "line": 89,
                "function": "httpDelete",
                "class": "Sabre\\DAV\\CorePlugin",
                "type": "->",
                "args": [
                    {
                        "__class__": "Sabre\\HTTP\\Request"
                    },
                    {
                        "__class__": "Sabre\\HTTP\\Response"
                    }
                ]
            },
            {
                "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 472,
                "function": "emit",
                "class": "Sabre\\DAV\\Server",
                "type": "->",
                "args": [
                    "method:DELETE",
                    [
                        {
                            "__class__": "Sabre\\HTTP\\Request"
                        },
                        {
                            "__class__": "Sabre\\HTTP\\Response"
                        }
                    ]
                ]
            },
            {
                "file": "/var/www/html/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/html/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 321,
                "function": "start",
                "class": "Sabre\\DAV\\Server",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/apps/dav/lib/Server.php",
                "line": 339,
                "function": "exec",
                "class": "Sabre\\DAV\\Server",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
                "line": 35,
                "function": "exec",
                "class": "OCA\\DAV\\Server",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/remote.php",
                "line": 166,
                "args": [
                    "/var/www/html/apps/dav/appinfo/v2/remote.php"
                ],
                "function": "require_once"
            }
        ],
        "File": "/var/www/html/lib/private/Files/Cache/Cache.php",
        "Line": 543,
        "CustomMessage": "--"
    },
    "id": "xxxxxx"
}
{
    "reqId": "xxxxx",
    "level": 3,
    "time": "2022-04-06T09:30:16+00:00",
    "remoteAddr": "xx.xx.xx.xx",
    "user": "admin",
    "app": "PHP",
    "method": "DELETE",
    "url": "/remote.php/dav/files/admin/Begleitbuch/Readme.md",
    "message": "Trying to access array offset on value of type bool at /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php#441",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0",
    "version": "23.0.3.2",
    "exception": {
        "Exception": "Error",
        "Message": "Trying to access array offset on value of type bool at /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php#441",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
                "line": 441,
                "function": "onError",
                "class": "OC\\Log\\ErrorHandler",
                "type": "::",
                "args": [
                    2,
                    "Trying to access array offset on value of type bool",
                    "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
                    441
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
                "line": 301,
                "function": "fopen",
                "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
                "type": "->",
                "args": [
                    "Readme.md",
                    "r"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
                "line": 794,
                "function": "fopen",
                "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                "type": "->",
                "args": [
                    "Readme.md",
                    "r"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
                "line": 651,
                "function": "copyBetweenStorage",
                "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Files_Trashbin\\Storage",
                        "cache": {
                            "__class__": "OC\\Files\\Cache\\Cache"
                        },
                        "scanner": {
                            "__class__": "OC\\Files\\Cache\\Scanner"
                        },
                        "watcher": null,
                        "propagator": {
                            "__class__": "OC\\Files\\Cache\\Propagator"
                        },
                        "updater": {
                            "__class__": "OC\\Files\\Cache\\Updater"
                        }
                    },
                    "Readme.md",
                    "files_trashbin/files/Readme.md.d1649237416",
                    true,
                    true
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
                "line": 595,
                "function": "moveFromStorage",
                "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Files_Trashbin\\Storage",
                        "cache": {
                            "__class__": "OC\\Files\\Cache\\Cache"
                        },
                        "scanner": {
                            "__class__": "OC\\Files\\Cache\\Scanner"
                        },
                        "watcher": null,
                        "propagator": {
                            "__class__": "OC\\Files\\Cache\\Propagator"
                        },
                        "updater": {
                            "__class__": "OC\\Files\\Cache\\Updater"
                        }
                    },
                    "Readme.md",
                    "files_trashbin/files/Readme.md.d1649237416"
                ]
            },
            {
                "file": "/var/www/html/apps/files_trashbin/lib/Storage.php",
                "line": 239,
                "function": "moveFromStorage",
                "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Files_Trashbin\\Storage",
                        "cache": {
                            "__class__": "OC\\Files\\Cache\\Cache"
                        },
                        "scanner": {
                            "__class__": "OC\\Files\\Cache\\Scanner"
                        },
                        "watcher": null,
                        "propagator": {
                            "__class__": "OC\\Files\\Cache\\Propagator"
                        },
                        "updater": {
                            "__class__": "OC\\Files\\Cache\\Updater"
                        }
                    },
                    "Readme.md",
                    "files_trashbin/files/Readme.md.d1649237416"
                ]
            },
            {
                "file": "/var/www/html/apps/files_trashbin/lib/Trashbin.php",
                "line": 322,
                "function": "moveFromStorage",
                "class": "OCA\\Files_Trashbin\\Storage",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Files_Trashbin\\Storage",
                        "cache": {
                            "__class__": "OC\\Files\\Cache\\Cache"
                        },
                        "scanner": {
                            "__class__": "OC\\Files\\Cache\\Scanner"
                        },
                        "watcher": null,
                        "propagator": {
                            "__class__": "OC\\Files\\Cache\\Propagator"
                        },
                        "updater": {
                            "__class__": "OC\\Files\\Cache\\Updater"
                        }
                    },
                    "Readme.md",
                    "files_trashbin/files/Readme.md.d1649237416"
                ]
            },
            {
                "file": "/var/www/html/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php",
                "line": 107,
                "function": "move2trash",
                "class": "OCA\\Files_Trashbin\\Trashbin",
                "type": "::",
                "args": [
                    "Begleitbuch/Readme.md"
                ]
            },
            {
                "file": "/var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php",
                "line": 102,
                "function": "moveToTrash",
                "class": "OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Files_Trashbin\\Storage",
                        "cache": {
                            "__class__": "OC\\Files\\Cache\\Cache"
                        },
                        "scanner": {
                            "__class__": "OC\\Files\\Cache\\Scanner"
                        },
                        "watcher": null,
                        "propagator": {
                            "__class__": "OC\\Files\\Cache\\Propagator"
                        },
                        "updater": {
                            "__class__": "OC\\Files\\Cache\\Updater"
                        }
                    },
                    "Readme.md"
                ]
            },
            {
                "file": "/var/www/html/apps/files_trashbin/lib/Storage.php",
                "line": 202,
                "function": "moveToTrash",
                "class": "OCA\\Files_Trashbin\\Trash\\TrashManager",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Files_Trashbin\\Storage",
                        "cache": {
                            "__class__": "OC\\Files\\Cache\\Cache"
                        },
                        "scanner": {
                            "__class__": "OC\\Files\\Cache\\Scanner"
                        },
                        "watcher": null,
                        "propagator": {
                            "__class__": "OC\\Files\\Cache\\Propagator"
                        },
                        "updater": {
                            "__class__": "OC\\Files\\Cache\\Updater"
                        }
                    },
                    "Readme.md"
                ]
            },
            {
                "file": "/var/www/html/apps/files_trashbin/lib/Storage.php",
                "line": 102,
                "function": "doDelete",
                "class": "OCA\\Files_Trashbin\\Storage",
                "type": "->",
                "args": [
                    "Readme.md",
                    "unlink"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/View.php",
                "line": 1171,
                "function": "unlink",
                "class": "OCA\\Files_Trashbin\\Storage",
                "type": "->",
                "args": [
                    "Readme.md"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Files/View.php",
                "line": 728,
                "function": "basicOperation",
                "class": "OC\\Files\\View",
                "type": "->",
                "args": [
                    "unlink",
                    "/Begleitbuch/Readme.md",
                    [
                        "delete"
                    ]
                ]
            },
            {
                "file": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
                "line": 495,
                "function": "unlink",
                "class": "OC\\Files\\View",
                "type": "->",
                "args": [
                    "/Begleitbuch/Readme.md"
                ]
            },
            {
                "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php",
                "line": 179,
                "function": "delete",
                "class": "OCA\\DAV\\Connector\\Sabre\\File",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
                "line": 281,
                "function": "delete",
                "class": "Sabre\\DAV\\Tree",
                "type": "->",
                "args": [
                    "files/admin/Begleitbuch/Readme.md"
                ]
            },
            {
                "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
                "line": 89,
                "function": "httpDelete",
                "class": "Sabre\\DAV\\CorePlugin",
                "type": "->",
                "args": [
                    {
                        "__class__": "Sabre\\HTTP\\Request"
                    },
                    {
                        "__class__": "Sabre\\HTTP\\Response"
                    }
                ]
            },
            {
                "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 472,
                "function": "emit",
                "class": "Sabre\\DAV\\Server",
                "type": "->",
                "args": [
                    "method:DELETE",
                    [
                        {
                            "__class__": "Sabre\\HTTP\\Request"
                        },
                        {
                            "__class__": "Sabre\\HTTP\\Response"
                        }
                    ]
                ]
            },
            {
                "file": "/var/www/html/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/html/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 321,
                "function": "start",
                "class": "Sabre\\DAV\\Server",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/apps/dav/lib/Server.php",
                "line": 339,
                "function": "exec",
                "class": "Sabre\\DAV\\Server",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
                "line": 35,
                "function": "exec",
                "class": "OCA\\DAV\\Server",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/remote.php",
                "line": 166,
                "args": [
                    "/var/www/html/apps/dav/appinfo/v2/remote.php"
                ],
                "function": "require_once"
            }
        ],
        "File": "/var/www/html/lib/private/Log/ErrorHandler.php",
        "Line": 92,
        "CustomMessage": "--"
    },
    "id": "xxxxxxxx"
}

@kirscheGIT
Copy link

kirscheGIT commented Apr 24, 2022

Using 23.0.3 This also shows a popup with "Error deleting file" when a user tries to delete a file from the browser. It actually deletes the file but the user need to refresh the folder on the web ui to see the file is gone. The file which is accessed is an external storage mapped to local.

Stacktrace as json format (click me)

Same for me. Happens only on SMB folders when deleting files. Exact same behavior on 23.0.4

Encryption is disabled btw.

@AndyXheli
Copy link

AndyXheli commented Nov 11, 2022

Still an issue on NC 25.0.1

{"reqId":"jISnEF6fUJg15s8HgcwS","level":3,"time":"2022-11-11T18:02:51+00:00","remoteAddr":"10.0.10.157","user":"admin","app":"PHP","method":"DELETE","url":"/remote.php/dav/files/axheli/C2%20Storage/New%20document.docx","message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","version":"25.0.1.1","exception":{"Exception":"Error","Message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":441,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":301,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":817,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":656,"function":"copyBetweenStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":595,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":239,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php","line":330,"function":"moveFromStorage","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php","line":107,"function":"move2trash","class":"OCA\\Files_Trashbin\\Trashbin","type":"::"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":102,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":202,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":102,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1181,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":727,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":522,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":179,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":171,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"636e8e9054170"}

@AndyXheli
Copy link

@icewind1991 Can you please get some attentions on this ?

Looks like when having encryption enabled on NC 25 and i created a doc via external smb share it dose not work just get error and the doc looks corrupt

{"reqId":"nIFkqbnBfv5k2gllD5XS","level":3,"time":"2022-12-01T16:17:42+00:00","remoteAddr":"10.0.10.157","user":"axheli","app":"PHP","method":"DELETE","url":"/remote.php/dav/files/axheli/Scans/t.md","message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","version":"25.0.2.1","exception":{"Exception":"Error","Message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":441,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":301,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":817,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":656,"function":"copyBetweenStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":595,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":239,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php","line":330,"function":"moveFromStorage","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php","line":107,"function":"move2trash","class":"OCA\\Files_Trashbin\\Trashbin","type":"::"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":102,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":202,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":102,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1181,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":727,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":522,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":179,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":171,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"6388d3bdec775"}
{"reqId":"zWQlhgbo5HxaEzl6DJrH","level":3,"time":"2022-12-01T16:17:42+00:00","remoteAddr":"10.0.10.157","user":"axheli","app":"PHP","method":"DELETE","url":"/remote.php/dav/files/axheli/Scans/New%20document.docx","message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","version":"25.0.2.1","exception":{"Exception":"Error","Message":"Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#441","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":441,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":301,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":817,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":656,"function":"copyBetweenStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":595,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":239,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php","line":330,"function":"moveFromStorage","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php","line":107,"function":"move2trash","class":"OCA\\Files_Trashbin\\Trashbin","type":"::"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":102,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":202,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":102,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1181,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":727,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":522,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":179,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":171,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"6388d3bdec86e"}

@szaimen

This comment was marked as resolved.

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Jan 9, 2023
@szaimen szaimen closed this as completed Mar 6, 2023
@talesam

This comment was marked as off-topic.

@WaaromZoMoeilijk
Copy link
Member

WaaromZoMoeilijk commented Mar 15, 2023

Same here on SFTP/Webdav, let me know if additional logging / testing is needed. Would like to help solve this asap!

It seems I'm able to copy/move files from anywhere and they get properly encrypted on both Webdav and SFTP (File content encrypted upon opening not via NC) but when trying to recursively move or copy a folder (either by dragging or selecting move/copy) it results in unable to copy / move FOLDER.

Please advise.

ps, it seems file/folder names are still intact only the content is encrypted, could anyone confirm this is supposed be? I recall it does, just want to be sure.

Screenshot from 2023-03-15 09-18-47

@joshtrichards

This comment was marked as resolved.

@joshtrichards
Copy link
Member

I believe this is fixed (at least in >=NC26) via #34724. Is anyone on this thread that has moved to at least NC26 still experiencing this behavior?

@Millesimus
Copy link

@joshtrichards I've been following this issue because I had the same problem and can confirm that this no longer happens with WebDAV (NC27.0.2).

@Cyanogenbot
Copy link

@joshtrichards I'm on nc27 and am still having this error occur!
afbeelding

[PHP] Fout: Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#453

@joshtrichards
Copy link
Member

joshtrichards commented Jan 23, 2024

Not sure the underlying cause, but did a little digging today. Leaving a few notes here for next time:

$info = $this->getCache()->get($path);
// only get encryption module if we found one in the header
// or if file should be encrypted according to the file cache
if (!empty($encryptionModuleId)) {
$encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId);
$shouldEncrypt = true;
} elseif (empty($encryptionModuleId) && $info['encrypted'] === true) {

$info above (line 453) can end up being set to false rather than being an array due to the get() returning false if the file/folder can't be found in the cache. And there's currently no check for that state before trying to access the $info array to see if the file's encrypted flag (which will only be set if the cache entry exists) is set to true.

Questions to follow-up on:

  • Why are they not found in the cache?
  • Are we perhaps checking the header and setting the $encryptionModuleId before we confirm the file exists? [my initial look showed this as a possibility, but this is a complicated area of code so I'm not ready so say that's what's happening here]

Triggering this code path should only be possible in environments where there are no headers on the encrypted files (old installations only I believe)... though if we're setting $encryptionModuleId in some cases at the wrong time (i.e. before checking file existence) then we might also be triggering this code path under unplanned circumstances.

@joshtrichards joshtrichards added the needs review Needs review to determine if still applicable label Sep 5, 2024
@joshtrichards joshtrichards changed the title Error: Trying to access array offset on value of type bool at /lib/private/Files/Storage/Wrapper/Encryption.php#441 Error: Trying to access array offset on value of type bool at /lib/private/Files/Storage/Wrapper/Encryption.php#441 Sep 13, 2024
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 25-feedback bug feature: encryption (server-side) needs review Needs review to determine if still applicable
Projects
None yet
Development

No branches or pull requests