Skip to content

Cannot Sign the Document When document placed at Shared Folder #5497

@kahidna

Description

@kahidna

Describe the bug

the bug is signer cannot sign the document, and its only happend when document placed at a shared folder

To reproduce

The error only appears when the document is placed in a shared folder.
Say a Staff member named Foo shared a directory owned by Foo with a Staff member named Bar.
And then Bar uploads a PDF document to that directory. Next, the Bar guy creates a document sign request to other staff, say A, B, C, and D. The request is successfully created. But when Staff A, B, C, and D try to sign the document. It returns an error message 502 with this JSON captured from the file nextcloud.log

{
   "reqId":"R1RwYrGJp2vojvz3FIgg",
   "level":3,
   "time":"2025-10-02T14:45:09+07:00",
   "remoteAddr":"IP_REDACTED",
   "user":"alfin",
   "app":"libresign",
   "method":"POST",
   "url":"/ocs/v2.php/apps/libresign/api/v1/sign/uuid/1df2d19d-a90a-4aa4-826a-10844f790fcb",
   "message":"OC\\Files\\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/View.php on line 502",
   "userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0",
   "version":"31.0.6.2",
   "exception":{
      "Exception":"TypeError",
      "Message":"OC\\Files\\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/View.php on line 502",
      "Code":0,
      "Trace":[
         {
            "file":"/var/www/nextcloud/lib/private/Files/View.php",
            "line":502,
            "function":"basicOperation",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/Filesystem.php",
            "line":516,
            "function":"file_exists",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php",
            "line":161,
            "function":"file_exists",
            "class":"OC\\Files\\Filesystem",
            "type":"::"
         },
         {
            "file":"/var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
            "line":174,
            "function":"store",
            "class":"OCA\\Files_Versions\\Storage",
            "type":"::"
         },
         {
            "file":"/var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php",
            "line":80,
            "function":"write_hook",
            "class":"OCA\\Files_Versions\\Listener\\FileEventsListener",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php",
            "line":68,
            "function":"handle",
            "class":"OCA\\Files_Versions\\Listener\\FileEventsListener",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
            "line":220,
            "function":"__invoke",
            "class":"OC\\EventDispatcher\\ServiceEventListener",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
            "line":56,
            "function":"callListeners",
            "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
            "line":67,
            "function":"dispatch",
            "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
            "line":79,
            "function":"dispatch",
            "class":"OC\\EventDispatcher\\EventDispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/Node/HookConnector.php",
            "line":74,
            "function":"dispatchTyped",
            "class":"OC\\EventDispatcher\\EventDispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/legacy/OC_Hook.php",
            "line":85,
            "function":"write",
            "class":"OC\\Files\\Node\\HookConnector",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/View.php",
            "line":1322,
            "function":"emit",
            "class":"OC_Hook",
            "type":"::"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/View.php",
            "line":1194,
            "function":"runHooks",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/View.php",
            "line":654,
            "function":"basicOperation",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/Node/File.php",
            "line":52,
            "function":"file_put_contents",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/libresign/lib/Handler/SignEngine/Pkcs12Handler.php",
            "line":403,
            "function":"putContent",
            "class":"OC\\Files\\Node\\File",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/libresign/lib/Service/SignFileService.php",
            "line":336,
            "function":"sign",
            "class":"OCA\\Libresign\\Handler\\SignEngine\\Pkcs12Handler",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/libresign/lib/Controller/SignFileController.php",
            "line":133,
            "function":"sign",
            "class":"OCA\\Libresign\\Service\\SignFileService",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/libresign/lib/Controller/SignFileController.php",
            "line":95,
            "function":"sign",
            "class":"OCA\\Libresign\\Controller\\SignFileController",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
            "line":200,
            "function":"signUsingUuid",
            "class":"OCA\\Libresign\\Controller\\SignFileController",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
            "line":114,
            "function":"executeController",
            "class":"OC\\AppFramework\\Http\\Dispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/AppFramework/App.php",
            "line":161,
            "function":"dispatch",
            "class":"OC\\AppFramework\\Http\\Dispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Route/Router.php",
            "line":307,
            "function":"main",
            "class":"OC\\AppFramework\\App",
            "type":"::"
         },
         {
            "file":"/var/www/nextcloud/ocs/v1.php",
            "line":49,
            "function":"match",
            "class":"OC\\Route\\Router",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/ocs/v2.php",
            "line":7,
            "args":[
               "/var/www/nextcloud/ocs/v1.php"
            ],
            "function":"require_once"
         }
      ],
      "File":"/var/www/nextcloud/lib/private/Files/View.php",
      "Line":1178,
      "message":"OC\\Files\\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/View.php on line 502",
      "exception":{
         
      },
      "CustomMessage":"OC\\Files\\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/View.php on line 502"
   }
}

Expected behavior

expected behavior the signer can sign the document with no problem

Screenshots

Image Image Image

Environment information

  • OS: Debian 9.13
  • Apache: 2.4.62
  • PHP: 8.3.16
  • Nextcloud: 31.0.6
  • MySQL: 5.7.44
  • LibreSign: 11.2.4
  • Docker: 19.03.5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    0. Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions