nextcloud / nextcloud/notes

"Failed to overwrite share target for notes" logged when creating guest account (without storage/quota?)

Open
#1,333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature: sharing need to reproduce
Dominant language
JavaScript
Stars
738
Forks
162
Avg merge
6h 2m
Merged PRs (30d)
35

Description

Please make a clear and concise description of what the bug is.

Steps to reproduce

  1. Create a folder
  2. Enter an email into the share dropdown
  3. Use the guests app option to create them an account
  4. Save the share
Expected behaviour

Actual behaviour
{
  "reqId": "HkqeCFThhPjdHs8TQuDm",
  "level": 3,
  "time": "2024-07-30T12:44:39+00:00",
  "remoteAddr": "…",
  "user": "…",
  "app": "notes",
  "method": "POST",
  "url": "/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json",
  "message": "Failed to overwrite share target for notes",
  "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0",
  "version": "29.0.4.1",
  "exception": {
    "Exception": "OCP\\Files\\NotPermittedException",
    "Message": "Could not create folder \"/…/files/Notes\"",
    "Code": 0,
    "Trace": [
      {
        "function": "newFolder",
        "class": "OC\\Files\\Node\\Folder",
        "type": "->",
        "args": [
          "Notes"
        ]
      },
      {
        "file": "…/lib/private/Files/Node/LazyFolder.php",
        "line": 84,
        "function": "call_user_func_array",
        "args": [
          [
            [
              "OC\\Files\\Node\\Folder"
            ],
            "newFolder"
          ],
          [
            "Notes"
          ]
        ]
      },
      {
        "file": "…/lib/private/Files/Node/LazyFolder.php",
        "line": 456,
        "function": "__call",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->",
        "args": [
          "newFolder",
          [
            "Notes"
          ]
        ]
      },
      {
        "file": "…/apps/notes/lib/Service/NoteUtil.php",
        "line": 196,
        "function": "newFolder",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->",
        "args": [
          "Notes"
        ]
      },
      {
        "file": "…/apps/notes/lib/AppInfo/BeforeShareCreatedListener.php",
        "line": 52,
        "function": "getOrCreateNotesFolder",
        "class": "OCA\\Notes\\Service\\NoteUtil",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "…/apps/notes/lib/AppInfo/BeforeShareCreatedListener.php",
        "line": 32,
        "function": "overwriteShareTarget",
        "class": "OCA\\Notes\\AppInfo\\BeforeShareCreatedListener",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "…/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 86,
        "function": "handle",
        "class": "OCA\\Notes\\AppInfo\\BeforeShareCreatedListener",
        "type": "->",
        "args": [
          [
            "OCP\\Share\\Events\\BeforeShareCreatedEvent"
          ]
        ]
      },
      {
        "file": "…/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 230,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->",
        "args": [
          [
            "OCP\\Share\\Events\\BeforeShareCreatedEvent"
          ],
          "OCP\\Share\\Events\\BeforeShareCreatedEvent",
          [
            "Symfony\\Component\\EventDispatcher\\EventDispatcher"
          ]
        ]
      },
      {
        "file": "…/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 59,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            [
              "Closure"
            ],
            [
              "Closure"
            ],
            [
              "Closure"
            ],
            [
              "Closure"
            ],
            [
              "Closure"
            ]
          ],
          "OCP\\Share\\Events\\BeforeShareCreatedEvent",
          [
            "OCP\\Share\\Events\\BeforeShareCreatedEvent"
          ]
        ]
      },
      {
        "file": "…/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 86,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCP\\Share\\Events\\BeforeShareCreatedEvent"
          ],
          "OCP\\Share\\Events\\BeforeShareCreatedEvent"
        ]
      },
      {
        "file": "…/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 98,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          "OCP\\Share\\Events\\BeforeShareCreatedEvent",
          [
            "OCP\\Share\\Events\\BeforeShareCreatedEvent"
          ]
        ]
      },
      {
        "file": "…/lib/private/Share20/Manager.php",
        "line": 741,
        "function": "dispatchTyped",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->",
        "args": [
          [
            "OCP\\Share\\Events\\BeforeShareCreatedEvent"
          ]
        ]
      },
      {
        "file": "…/apps/files_sharing/lib/Controller/ShareAPIController.php",
        "line": 805,
        "function": "createShare",
        "class": "OC\\Share20\\Manager",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "…/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 232,
        "function": "createShare",
        "class": "OCA\\Files_Sharing\\Controller\\ShareAPIController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "…/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 138,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Files_Sharing\\Controller\\ShareAPIController"
          ],
          "createShare"
        ]
      },
      {
        "file": "…/lib/private/AppFramework/App.php",
        "line": 184,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Files_Sharing\\Controller\\ShareAPIController"
          ],
          "createShare"
        ]
      },
      {
        "file": "…/lib/private/Route/Router.php",
        "line": 338,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Files_Sharing\\Controller\\ShareAPIController",
          "createShare",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "ocs.files_sharing.shareapi.createshare"
          ]
        ]
      },
      {
        "file": "…/ocs/v1.php",
        "line": 66,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/ocsapp/apps/files_sharing/api/v1/shares"
        ]
      },
      {
        "file": "…/ocs/v2.php",
        "line": 23,
        "args": [
          "…/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "…/lib/private/Files/Node/Folder.php",
    "Line": 162,
    "message": "Failed to overwrite share target for notes",
    "exception": {},
    "CustomMessage": "Failed to overwrite share target for notes"
  }
}
Screenshots

Bildschirmfoto vom 2024-07-30 14-45-16

Server

Please complete the following information.

  • Notes app version: 4.10.1
  • Nextcloud version: 29.0.4
  • OS: Ubuntu 22 LTS
  • Web server: Apache2
  • PHP version: 8.1.2
  • Database: MariaDB

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

Start with apps/notes/lib/AppInfo/BeforeShareCreatedListener.php and apps/notes/lib/Service/NoteUtil.php, following getOrCreateNotesFolder during guest-account share creation. Reproduce the share flow for an account without storage or quota and verify that creating the share succeeds without the reported exception or log message.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.