NC 21, 'Deck' + 'Circles' breaks file sharing by link

Nextcloud version 21.0.0
Operating system and version FreeBSD 11.4
Apache or nginx version Apache 2.4.46
PHP version 7.4.15

The issue you are facing:

Is this the first time you’ve seen this error? Y:

Steps to replicate it:

  1. Install NC 21
  2. Try to check file share (https://nc21.**************/index.php/s/gwy4ezJrYK6B79r) - it’s ok
  3. Add and enable Deck & Circles apps without any configuration.
  4. Repeat step 2 - error

Internal Server Error

The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.

Technical details

  • Remote Address: 192.168.65.32
  • Request ID: xClwDbfwG3cbSPR17TDn

The output of your Nextcloud log in Admin > Logging:

{"reqId":"pVN8LLsK8gBaVDx7ZkM8","level":3,"time":"2021-03-04T09:05:34+00:00","remoteAddr":"192.168.65.32","user":"--","app":"index","method":"GET","url":"/index.php/s/gwy4ezJrYK6B79r","message":{"Exception":"Exception","Message":"Call to a member function getUID() on null","Code":0,"Trace":[{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/local/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":159,"Previous":{"Exception":"Error","Message":"Call to a member function getUID() on null","Code":0,"Trace":[{"file":"/usr/local/www/nextcloud/apps-pkg/circles/lib/Api/v1/Circles.php","line":222,"function":"listCircles","class":"OCA\\Circles\\Api\\v1\\Circles","type":"::"},{"file":"/usr/local/www/nextcloud/apps-pkg/deck/lib/Db/BoardMapper.php","line":172,"function":"joinedCircles","class":"OCA\\Circles\\Api\\v1\\Circles","type":"::"},{"file":"/usr/local/www/nextcloud/apps-pkg/deck/lib/Db/BoardMapper.php","line":94,"function":"findAllByCircles","class":"OCA\\Deck\\Db\\BoardMapper","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/deck/lib/Sharing/DeckShareProvider.php","line":697,"function":"findAllForUser","class":"OCA\\Deck\\Db\\BoardMapper","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Share20/Manager.php","line":1336,"function":"getSharedWith","class":"OCA\\Deck\\Sharing\\DeckShareProvider","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/files_sharing/lib/MountProvider.php","line":82,"function":"getSharedWith","class":"OC\\Share20\\Manager","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php","line":119,"function":"getMountsForUser","class":"OCA\\Files_Sharing\\MountProvider","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Files/Filesystem.php","line":452,"function":"addMountForUser","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Files/Node/Root.php","line":379,"function":"initMountPoints","class":"OC\\Files\\Filesystem","type":"::"},{"function":"getUserFolder","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Files/Node/LazyFolder.php","line":66,"function":"call_user_func_array"},{"file":"/usr/local/www/nextcloud/lib/private/Files/Node/LazyRoot.php","line":41,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Share20/Share.php","line":183,"function":"getUserFolder","class":"OC\\Files\\Node\\LazyRoot","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/files_sharing/lib/Controller/ShareController.php","line":296,"function":"getNode","class":"OC\\Share20\\Share","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/files_sharing/lib/Controller/ShareController.php","line":320,"function":"validateShare","class":"OCA\\Files_Sharing\\Controller\\ShareController","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"showShare","class":"OCA\\Files_Sharing\\Controller\\ShareController","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/local/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/local/www/nextcloud/apps-pkg/circles/lib/Api/v1/Circles.php","Line":202},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.1; rv:52.0) Gecko/20100101 Firefox/52.0","version":"21.0.0.18","id":"6040a2dea8908"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => false,
    ),
  ),
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'dbindex' => 0,
  ),
  'instanceid' => '*************',
  'passwordsalt' => '*************',
  'secret' => '**************',
  'trusted_domains' => 
  array (
    0 => '*',
  ),
  'datadirectory' => '/data/nextcloud',
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => 'https://nc21.*************',
  'dbname' => 'NC21TEST',
  'dbhost' => 'localhost:/tmp/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_00001',
  'dbpassword' => '**************************',
  'installed' => true,
  'has_internet_connection' => false,
  'updatechecker' => false,
  'appstoreenabled' => false,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_send_plaintext_only' => true,
  'trusted_proxies' => 
  array (
    0 => '192.168.68.0/24',
  ),
  'overwriteprotocol' => 'https',
  'overwritecondaddr' => '^192\\.168\\.68\\.[0-9]+$',
  'log_rotate_size' => 67108864,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'enable_previews' => false,
  'trashbin_retention_obligation' => 'auto,5',
  'logtimezone' => 'UTC',
  'log_query' => false,
  'loglevel' => 1,
  'maintenance' => false,
  'filesystem_check_changes' => 1,
  'upgrade.disable-web' => true,
  'simpleSignUpLink.shown' => false,
  'theme' => '',
  'skeletondirectory' => '',
  'data-fingerprint' => '********************',
  'defaultapp' => 'files',
); 

The output of your Apache/nginx/system log in /var/log/____:

"GET /index.php/s/gwy4ezJrYK6B79r HTTP/1.1" 500 3785
"GET /core/css/guest.css?v=92eb28e0-0 HTTP/1.1" 200 20942
"GET /core/js/dist/files_fileinfo.js?v=92eb28e0-0 HTTP/1.1" 200 31905
"GET /apps-pkg/files_sharing/js/dist/main.js?v=92eb28e0-0 HTTP/1.1" 200 1197
"GET /apps-pkg/files_pdfviewer/js/files_pdfviewer-public.js?v=92eb28e0-0 HTTP/1.1" 200 20798
"GET /core/js/dist/files_client.js?v=92eb28e0-0 HTTP/1.1" 200 128672
"GET /apps-pkg/files_videoplayer/js/main.js?v=92eb28e0-0 HTTP/1.1" 200 6925
"GET /index.php/js/core/merged-template-prepend.js?v=92eb28e0-0 HTTP/1.1" 200 2982
"GET /core/js/dist/main.js?v=92eb28e0-0 HTTP/1.1" 200 1593367
"GET /index.php/apps/accessibility/css/user-a82fd95db10ff25dfad39f07372ebe37 HTTP/1.1" 200 38747
"GET /core/img/background.png?v=2 HTTP/1.1" 200 9621
"GET /core/img/logo/logo.svg?v=1 HTTP/1.1" 200 321

I can confirm this. If either deck or circles is disabled, then it works again, but having both apps activated together produces the problem for me.

Also, there is the error message Error: Call to a member function getUID() on null in the logs. I think it’s related. The issue has also been mentioned here: Error: Call to a member function getUID() on null in Circles.php:202 · Issue #560 · nextcloud/circles · GitHub

Same happens to me. I have deactivate Circles as a temporary solution.

After recent updates of both apps this issue is gone.

Yes, quite a lot has been done in recent versions to improve the support for the circles app. :rocket: