richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Class OC\Files\Storage\Home lacks method getMountPoint, causing WebDAV TypeError in Nextcloud Office

Open bzzbaishy opened this issue 7 months ago • 4 comments

Class OC\Files\Storage\Home lacks method getMountPoint, causing WebDAV TypeError in Nextcloud Office

Description

When enabling the Nextcloud Office (richdocuments) app on Nextcloud 31.0.6.2, WebDAV requests trigger a TypeError. The error occurs because the class OC\Files\Storage\Home does not have the method getMountPoint, but somewhere in the code this method is being called via call_user_func_array. This causes the WebDAV service and richdocuments features to fail.

Steps to reproduce

  1. Install Nextcloud 31.0.6.2 in a Docker container.
  2. Enable the Nextcloud Office (richdocuments) app version 8.7.0.
  3. Perform any WebDAV request (e.g., access files via WebDAV or use richdocuments to open/edit files).
  4. Check the logs to see repeated errors like:

Expected behavior

The system should not call a non-existent method getMountPoint on OC\Files\Storage\Home, and the WebDAV and richdocuments services should work without errors.

Additional information

  • Tried a temporary patch in /lib/private/Files/Storage/Wrapper/Wrapper.php to check if the method is callable before calling, but it only avoids the crash and does not solve the root cause.
  • The error seems related to how Nextcloud Office interacts with the storage wrapper.
  • Would appreciate if the Nextcloud Office team can look into this and provide a fix.

Nextcloud version

31.0.6.2

Nextcloud Office app version

8.7.0

Logs

Attached is the relevant log snippet showing the error message:

bzzbaishy avatar Jun 12 '25 10:06 bzzbaishy

{
    "reqId": "qPGnhGT2Hjo7CYQdP7TQ",
    "level": 3,
    "time": "2025-06-12T10:09:09+00:00",
    "remoteAddr": "192.168.1.201",
    "user": "admin",
    "app": "webdav",
    "method": "PROPFIND",
    "url": "/remote.php/dav/files/admin/",
    "message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\"",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36",
    "version": "31.0.6.2",
    "exception": {
        "Exception": "TypeError",
        "Message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\"",
        "Code": 0,
        "Trace": [
            {
                "file": "/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php",
                "line": 257,
                "function": "call_user_func_array"
            },
            {
                "function": "__call",
                "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                "type": "->"
            },
            {
                "file": "/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php",
                "line": 257,
                "function": "call_user_func_array"
            },
            {
                "file": "/config/www/nextcloud/apps/richdocuments/lib/Storage/SecureViewWrapper.php",
                "line": 95,
                "function": "__call",
                "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                "type": "->"
            },
            {
                "file": "/config/www/nextcloud/apps/richdocuments/lib/Storage/SecureViewWrapper.php",
                "line": 81,
                "function": "shouldSecure",
                "class": "OCA\\Richdocuments\\Storage\\SecureViewWrapper",
                "type": "->"
            },
            {
                "file": "/config/www/nextcloud/apps/richdocuments/lib/Storage/SecureViewWrapper.php",
                "line": 48,
                "function": "checkFileAccess",
                "class": "OCA\\Richdocuments\\Storage\\SecureViewWrapper",
                "type": "->"
            },
            {
                "file": "/app/www/public/lib/private/Files/View.php",
                "line": 1211,
                "function": "file_get_contents",
                "class": "OCA\\Richdocuments\\Storage\\SecureViewWrapper",
                "type": "->"
            },
            {
                "file": "/app/www/public/lib/private/Files/View.php",
                "line": 555,
                "function": "basicOperation",
                "class": "OC\\Files\\View",
                "type": "->"
            },
            {
                "file": "/app/www/public/lib/private/Files/Node/File.php",
                "line": 33,
                "function": "file_get_contents",
                "class": "OC\\Files\\View",
                "type": "->"
            },
            {
                "file": "/config/www/nextcloud/apps/text/lib/DAV/WorkspacePlugin.php",
                "line": 99,
                "function": "getContent",
                "class": "OC\\Files\\Node\\File",
                "type": "->"
            },
            {
                "file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/PropFind.php",
                "line": 95,
                "function": "OCA\\Text\\DAV\\{closure}",
                "class": "OCA\\Text\\DAV\\WorkspacePlugin",
                "type": "->",
                "args": ["*** sensitive parameters replaced ***"]
            },
            {
                "file": "/config/www/nextcloud/apps/text/lib/DAV/WorkspacePlugin.php",
                "line": 89,
                "function": "handle",
                "class": "Sabre\\DAV\\PropFind",
                "type": "->"
            },
            {
                "file": "/app/www/public/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
                "line": 89,
                "function": "propFind",
                "class": "OCA\\Text\\DAV\\WorkspacePlugin",
                "type": "->"
            },
            {
                "file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 1052,
                "function": "emit",
                "class": "Sabre\\DAV\\Server",
                "type": "->"
            }
        ],
        "File": "/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "Line": 257,
        "message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\"",
        "exception": {}
    },
    "CustomMessage": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\""
}

bzzbaishy avatar Jun 12 '25 10:06 bzzbaishy

Issue Summary

The Nextcloud Office (richdocuments) version 8.7.0 causes a WebDAV TypeError when used with Nextcloud 31.0.6 and 31.0.5. However, version 8.6.5 of Nextcloud Office works correctly with these Nextcloud versions.

Problem Description

When enabling Nextcloud Office (richdocuments) version 8.7.0 on Nextcloud versions 31.0.5 and 31.0.6, WebDAV requests trigger a TypeError. The error occurs because the class OC\Files\Storage\Home does not have the method getMountPoint, which is called somewhere in the code using call_user_func_array(). This causes the WebDAV service and richdocuments functionality to fail.

Note: The issue does not occur with Nextcloud Office version 8.6.5, which works fine with both Nextcloud 31.0.5 and Nextcloud 31.0.6.

Affected Versions:

  • Nextcloud Office Version: 8.7.0
  • Nextcloud Versions: 31.0.6, 31.0.5
  • WebDAV TypeError triggered when performing operations like accessing files or using richdocuments.

Expected Behavior

The system should not call the non-existent method getMountPoint on OC\Files\Storage\Home, and both WebDAV and Nextcloud Office services should function normally.

Steps to Reproduce

  1. Install Nextcloud 31.0.5 or Nextcloud 31.0.6 in a Docker container.
  2. Enable Nextcloud Office (richdocuments) version 8.7.0.
  3. Perform any WebDAV request (e.g., access files via WebDAV or open/edit files using richdocuments).
  4. Check the logs for repeated errors such as:
    • call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\Files\Storage\Home does not have a method "getMountPoint"

Logs

Please refer to the attached error logs for more detailed information about the issue.

Additional Information

A temporary patch was attempted by checking if the method is callable before invoking it in /lib/private/Files/Storage/Wrapper/Wrapper.php, but this only avoids the crash and does not resolve the root cause.

It appears that the error is related to how Nextcloud Office interacts with the storage wrapper.

We kindly request the Nextcloud Office team to investigate and provide a fix for this issue.

Nextcloud Version:

  • 31.0.5
  • 31.0.6

Nextcloud Office Version:

  • 8.7.0 (affected)
  • 8.6.5 (works fine)

bzzbaishy avatar Jun 12 '25 10:06 bzzbaishy

This issue also occurred on 8.7.1

bzzbaishy avatar Jun 13 '25 07:06 bzzbaishy

{
    "reqId": "kzmkZXkE8fmgTYh3VZ9W",
    "level": 3,
    "time": "2025-06-13T08:12:55+00:00",
    "remoteAddr": "192.168.1.201",
    "user": "admin",
    "app": "index",
    "method": "PUT",
    "url": "/apps/text/session/23/create",
    "message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\" in file '/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php' line 257",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36",
    "version": "31.0.6.2",
    "exception": {
        "Exception": "Exception",
        "Message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\" in file '/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php' line 257",
        "Code": 0,
        "Trace": [
            {
                "file": "/app/www/public/lib/private/AppFramework/App.php",
                "line": 161,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/app/www/public/lib/private/Route/Router.php",
                "line": 307,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::"
            },
            {
                "file": "/app/www/public/lib/base.php",
                "line": 1040,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->"
            },
            {
                "file": "/app/www/public/index.php",
                "line": 24,
                "function": "handleRequest",
                "class": "OC",
                "type": "::"
            }
        ],
        "File": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 146,
        "Previous": {
            "Exception": "TypeError",
            "Message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\"",
            "Code": 0,
            "Trace": [
                {
                    "file": "/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php",
                    "line": 257,
                    "function": "call_user_func_array"
                },
                {
                    "function": "__call",
                    "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                    "type": "->"
                },
                {
                    "file": "/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php",
                    "line": 257,
                    "function": "call_user_func_array"
                },
                {
                    "file": "/config/www/nextcloud/apps/richdocuments/lib/Storage/SecureViewWrapper.php",
                    "line": 96,
                    "function": "__call",
                    "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
                    "type": "->"
                },
                {
                    "file": "/config/www/nextcloud/apps/richdocuments/lib/Storage/SecureViewWrapper.php",
                    "line": 82,
                    "function": "shouldSecure",
                    "class": "OCA\\Richdocuments\\Storage\\SecureViewWrapper",
                    "type": "->"
                },
                {
                    "file": "/config/www/nextcloud/apps/richdocuments/lib/Storage/SecureViewWrapper.php",
                    "line": 49,
                    "function": "checkFileAccess",
                    "class": "OCA\\Richdocuments\\Storage\\SecureViewWrapper",
                    "type": "->"
                },
                {
                    "file": "/app/www/public/lib/private/Files/View.php",
                    "line": 1211,
                    "function": "file_get_contents",
                    "class": "OCA\\Richdocuments\\Storage\\SecureViewWrapper",
                    "type": "->"
                },
                {
                    "file": "/app/www/public/lib/private/Files/View.php",
                    "line": 555,
                    "function": "basicOperation",
                    "class": "OC\\Files\\View",
                    "type": "->"
                },
                {
                    "file": "/app/www/public/lib/private/Files/Node/File.php",
                    "line": 33,
                    "function": "file_get_contents",
                    "class": "OC\\Files\\View",
                    "type": "->"
                },
                {
                    "file": "/config/www/nextcloud/apps/text/lib/Service/ApiService.php",
                    "line": 297,
                    "function": "getContent",
                    "class": "OC\\Files\\Node\\File",
                    "type": "->"
                },
                {
                    "file": "/config/www/nextcloud/apps/text/lib/Service/ApiService.php",
                    "line": 135,
                    "function": "loadContent",
                    "class": "OCA\\Text\\Service\\ApiService",
                    "type": "->"
                },
                {
                    "file": "/config/www/nextcloud/apps/text/lib/Controller/SessionController.php",
                    "line": 46,
                    "function": "create",
                    "class": "OCA\\Text\\Service\\ApiService",
                    "type": "->",
                    "args": [
                        "*** sensitive parameters replaced ***"
                    ]
                },
                {
                    "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 200,
                    "function": "create",
                    "class": "OCA\\Text\\Controller\\SessionController",
                    "type": "->",
                    "args": [
                        "*** sensitive parameters replaced ***"
                    ]
                },
                {
                    "file": "/app/www/public/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 114,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/app/www/public/lib/private/AppFramework/App.php",
                    "line": 161,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/app/www/public/lib/private/Route/Router.php",
                    "line": 307,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::"
                },
                {
                    "file": "/app/www/public/lib/base.php",
                    "line": 1040,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->"
                },
                {
                    "file": "/app/www/public/index.php",
                    "line": 24,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::"
                }
            ],
            "File": "/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php",
            "Line": 257
        },
        "message": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\" in file '/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php' line 257",
        "exception": {},
        "CustomMessage": "call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OC\\Files\\Storage\\Home does not have a method \"getMountPoint\" in file '/app/www/public/lib/private/Files/Storage/Wrapper/Wrapper.php' line 257"
    }
}

bzzbaishy avatar Jun 13 '25 11:06 bzzbaishy