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

4.0.1 breaks shares and fulltext-search on Nextcloud 16 - Call to a member function getUID() on null #440

Closed
mtippmann opened this issue May 22, 2019 · 7 comments

Comments

@mtippmann
Copy link

Since updating to Groupfolders 4.0.1 (from 4.0.0) shares are broken for me.

{
  "reqId": "kkBaMnKvGuF5QANOeDUO",
  "level": 3,
  "time": "2019-05-22T07:53:16+00:00",
  "remoteAddr": "91.137.5.26",
  "user": "--",
  "app": "index",
  "method": "GET",
  "url": "/s/sXnEdKJyFaLBBk2",
  "message": {
    "Exception": "Error",
    "Message": "Call to a member function getUID() on null",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php",
        "line": 126,
        "function": "getCurrentUID",
        "class": "OCA\\GroupFolders\\Mount\\MountProvider",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php",
        "line": 90,
        "function": "getMount",
        "class": "OCA\\GroupFolders\\Mount\\MountProvider",
        "type": "->",
        "args": [
          8,
          "/mt/files/Maschinenraum",
          31,
          -3,
          {
            "__class__": "OC\\Files\\Cache\\CacheEntry"
          },
          {
            "__class__": "OC\\Files\\Storage\\StorageFactory"
          },
          true,
          {
            "__class__": "OC\\User\\User"
          }
        ]
      },
      {
        "function": "OCA\\GroupFolders\\Mount\\{closure}",
        "class": "OCA\\GroupFolders\\Mount\\MountProvider",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php",
        "line": 88,
        "function": "array_map",
        "args": [
          {
            "__class__": "Closure"
          },
          [
            "*** sensitive parameter replaced ***",
            {
              "folder_id": 11,
              "mount_point": "weimarnetz",
              "permissions": 31,
              "quota": -3,
              "acl": true,
              "rootCacheEntry": {
                "__class__": "OC\\Files\\Cache\\CacheEntry"
              }
            }
          ]
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php",
        "line": 103,
        "function": "getMountsForUser",
        "class": "OCA\\GroupFolders\\Mount\\MountProvider",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\User\\User"
          },
          {
            "__class__": "OC\\Files\\Storage\\StorageFactory"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Filesystem.php",
        "line": 447,
        "function": "addMountForUser",
        "class": "OC\\Files\\Config\\MountProviderCollection",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\User\\User"
          },
          {
            "__class__": "OC\\Files\\Mount\\Manager"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/Root.php",
        "line": 375,
        "function": "initMountPoints",
        "class": "OC\\Files\\Filesystem",
        "type": "::",
        "args": [
          "mt"
        ]
      },
      {
        "function": "getUserFolder",
        "class": "OC\\Files\\Node\\Root",
        "type": "->",
        "args": [
          "mt"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyRoot.php",
        "line": 64,
        "function": "call_user_func_array",
        "args": [
          [
            {
              "__class__": "OC\\Files\\Node\\Root"
            },
            "getUserFolder"
          ],
          [
            "mt"
          ]
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyRoot.php",
        "line": 281,
        "function": "__call",
        "class": "OC\\Files\\Node\\LazyRoot",
        "type": "->",
        "args": [
          "getUserFolder",
          [
            "mt"
          ]
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Share20/Share.php",
        "line": 175,
        "function": "getUserFolder",
        "class": "OC\\Files\\Node\\LazyRoot",
        "type": "->",
        "args": [
          "mt"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareController.php",
        "line": 269,
        "function": "getNode",
        "class": "OC\\Share20\\Share",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareController.php",
        "line": 293,
        "function": "validateShare",
        "class": "OCA\\Files_Sharing\\Controller\\ShareController",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\Share20\\Share"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 166,
        "function": "showShare",
        "class": "OCA\\Files_Sharing\\Controller\\ShareController",
        "type": "->",
        "args": [
          ""
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 99,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Files_Sharing\\Controller\\ShareController"
          },
          "showShare"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 126,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Files_Sharing\\Controller\\ShareController"
          },
          "showShare"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",
        "line": 47,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Files_Sharing\\Controller\\ShareController",
          "showShare",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          {
            "token": "sXnEdKJyFaLBBk2",
            "_route": "files_sharing.sharecontroller.showShare"
          }
        ]
      },
      {
        "function": "__invoke",
        "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
        "type": "->",
        "args": [
          {
            "token": "sXnEdKJyFaLBBk2",
            "_route": "files_sharing.sharecontroller.showShare"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 297,
        "function": "call_user_func",
        "args": [
          {
            "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
          },
          {
            "token": "sXnEdKJyFaLBBk2",
            "_route": "files_sharing.sharecontroller.showShare"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 975,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/s/sXnEdKJyFaLBBk2"
        ]
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 42,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php",
    "Line": 113,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
  "version": "16.0.1.1"
}
@mtippmann
Copy link
Author

Reverting the Groupfolders addon to 4.0.0 fixes the problem. The share here is public if that matters. Nextcloud 16.0.1

@ShinjiLE
Copy link

ShinjiLE commented May 22, 2019

It also breaks fulltextsearch :
"An unhandled exception has been thrown:
Error: Call to a member function getUID() on null in /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php:113
Stack trace:
#0 /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php(126): OCA\GroupFolders\Mount\MountProvider->getCurrentUID()
#1 /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php(90): OCA\GroupFolders\Mount\MountProvider->getMount(1, '/Sebastian/file...', 31, 104857600, Object(OC\Files\Cache\CacheEntry), Object(OC\Files\Storage\StorageFactory), true, Object(OC\User\User))
#2 [internal function]: OCA\GroupFolders\Mount\MountProvider->OCA\GroupFolders\Mount{closure}(Array)
#3 /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php(88): array_map(Object(Closure), Array)
#4 /var/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php(103): OCA\GroupFolders\Mount\MountProvider->getMountsForUser(Object(OC\User\User), Object(OC\Files\Storage\StorageFactory))
#5 /var/www/nextcloud/lib/private/Files/Filesystem.php(447): OC\Files\Config\MountProviderCollection->addMountForUser(Object(OC\User\User), Object(OC\Files\Mount\Manager))
#6 /var/www/nextcloud/lib/private/Files/Node/Root.php(375): OC\Files\Filesystem::initMountPoints('Sebastian')
#7 [internal function]: OC\Files\Node\Root->getUserFolder('Sebastian')
#8 /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php(64): call_user_func_array(Array, Array)
#9 /var/www/nextcloud/lib/private/Files/Node/LazyRoot.php(281): OC\Files\Node\LazyRoot->__call('getUserFolder', Array)
#10 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(474): OC\Files\Node\LazyRoot->getUserFolder('Sebastian')
#11 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(737): OCA\Files_FullTextSearch\Service\FilesService->getPathFromViewerId(1036333, 'Sebastian')
#12 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(652): OCA\Files_FullTextSearch\Service\FilesService->updateShareNames(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\File))
#13 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(626): OCA\Files_FullTextSearch\Service\FilesService->updateDocumentAccess(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\File))
#14 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(607): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocumentFromFile(Object(OCA\Files_FullTextSearch\Model\FilesDocument), Object(OC\Files\Node\File))
#15 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(501): OCA\Files_FullTextSearch\Service\FilesService->updateFilesDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#16 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(263): OCA\Files_FullTextSearch\Service\FilesService->generateDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#17 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(325): OCA\Files_FullTextSearch\Provider\FilesProvider->fillIndexDocument(Object(OCA\Files_FullTextSearch\Model\FilesDocument))
#18 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(205): OCA\FullTextSearch\Service\IndexService->indexDocuments(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Array, Object(OCA\FullTextSearch\Model\IndexOptions))
#19 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(409): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser(Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\Files_FullTextSearch\Provider\FilesProvider), 'ChristianS', Object(OCA\FullTextSearch\Model\IndexOptions))
#20 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(273): OCA\FullTextSearch\Command\Index->indexProvider(Object(OCA\Files_FullTextSearch\Provider\FilesProvider), Object(OCA\FullTextSearch\Model\IndexOptions))
#21 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Index->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Index), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /var/www/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/nextcloud/console.php(97): OC\Console\Application->run()
#28 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#29 {main}"

@RonMen
Copy link

RonMen commented May 22, 2019

Hi,

I reverted "/lib/Mount/MountProvider.php" and then was able again to share to federated clouds. It was broken since the update to 4.0.1.

Regards
RonMen

@mtippmann mtippmann changed the title 4.0.1 breaks shares on Nextcloud 16 - Call to a member function getUID() on null" 4.0.1 breaks shares and fulltext-search on Nextcloud 16 - Call to a member function getUID() on null May 22, 2019
@janbenda
Copy link

janbenda commented May 23, 2019

public (user not logged) sharelinks are broken:
"Message":"Call to a member function getUID() on null",
"Code":0,"Trace":[{"file":"/var/www/html/custom_apps/groupfolders/lib/Mount/MountProvider.php","line":126,"function":"getCurrentUID"

/var/www/html/custom_apps/groupfolders/lib/Mount/MountProvider.php
public function getMount
this line (126) is wrong:
$inShare = $this->getCurrentUID() === null || $this->getCurrentUID() !== $user->getUID();

that works
$inShare = $this->userSession->getUser() === null || $this->getCurrentUID() !== $user->getUID();

@ShinjiLE
Copy link

I think this is fixed with 4.0.2.

@ZeikoFr
Copy link

ZeikoFr commented Dec 3, 2020

Hi @mtippmann

As group folder is now at v8.0.2 I suppose this issue can be closed ?

Regards,

@mtippmann
Copy link
Author

@ZeikoFr we stopped using fulltextsearch but I guess this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants