Skip to content

NotFoundException while opening shared file from group folder #4336

Open
@LinuxSpielKind

Description

Describe the bug
When giving a single user a share to a folder or file that is residing in a group folder, this file can not be opened in Nextcloud Office. It either shows the loading view forever, or opens an empty file. Error Protocols show a NotFoundException in DocumentController.php in private function getFileForUser(int $fileId, ?string $path = null)

Might be related to #3088

To Reproduce
Steps to reproduce the behavior:

  1. Go to any group folder
  2. Grant a share to any user
  3. Try to open shared file as user granted to
  4. Get stuck at "Loading Screen"
    Expected behavior
    The shared document should be opened within Nextcloud Ofiice.

Screenshots
Image

Client details:

  • OS: Windows
  • Browser Chrome, Firefox
  • Version 131.0.6778.140, 133.0.3
  • Device: desktop

Server details

Operating system: Ubuntu 24.04-LTS:

Web server: Apache2

Database: PostgreSQL 16.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20240309) 13.2.1

PHP version: 8.3.13

Nextcloud version:

Version of the richdocuments app

Version of Collabora Online

Configuration of the richdocuments app

{
    "apps": {
        "richdocuments": {
            "types": "prevent_group_restriction",
            "installed_version": "8.5.3",
            "enabled": "yes",
            "public_wopi_url": "https:\/\/nextcloud.intern.kaffeebraun.com",
            "disable_certificate_verification": "yes",
            "wopi_url": "https:\/\/nextcloud.intern.kaffeebraun.com\/",
            "wopi_callback_url": "",
            "wopi_allowlist": "Connection lost\n192.168.2.0\/24,192.168.20.0\/24,192.168.3.0\/24,127.0.0.1\/8,172.16.0.0\/12,fd00::\/8,::1,nextcloud.intern.kaffeebraun.com,93.241.77.37,192.168.20.8,127.0.0.1\/8,192.168.0.0\/16,172.16.0.0\/12,10.0.0.0\/8,fd00::\/8,::1,0.0.0.0\/0,192.168.20.234"
        }
    }
}
Logs

Nextcloud log (data/nextcloud.log)

{
  "reqId": "ELm2htPKefz6kw2aLzsS",
  "level": 3,
  "time": "2024-12-13T10:49:27+00:00",
  "remoteAddr": "192.168.x.y",
  "user": "dummy",
  "app": "richdocuments",
  "method": "POST",
  "url": "/apps/richdocuments/token",
  "message": "Failed to generate token for file",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
  "version": "30.0.2.2",
  "exception": {
    "Exception": "OCP\\Files\\NotFoundException",
    "Message": "",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/custom_apps/richdocuments/lib/Controller/DocumentController.php",
        "line": 389,
        "function": "getFileForUser",
        "class": "OCA\\Richdocuments\\Controller\\DocumentController",
        "type": "->",
        "args": [
          1477331,
          null
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 208,
        "function": "token",
        "class": "OCA\\Richdocuments\\Controller\\DocumentController",
        "type": "->",
        "args": [
          1477331,
          null,
          null,
          null
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 114,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Richdocuments\\Controller\\DocumentController"
          },
          "token"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Richdocuments\\Controller\\DocumentController"
          },
          "token"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Richdocuments\\Controller\\DocumentController",
          "token",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          {
            "_route": "richdocuments.document.token"
          }
        ]
      },
      {
        "file": "/var/www/html/lib/base.php",
        "line": 1001,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/richdocuments/token"
        ]
      },
      {
        "file": "/var/www/html/index.php",
        "line": 24,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/html/custom_apps/richdocuments/lib/Controller/DocumentController.php",
    "Line": 439,
    "message": "Failed to generate token for file",
    "exception": [],
    "CustomMessage": "Failed to generate token for file"
  },
  "id": "675c1c82a22a5"
}

Browser log

Error #500

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions