Error creating share on federated instance

Reported twice back in 2022 and also on GitHub

Affects any configuration with PHP 8.0 or higher

Nextcloud version (eg, 20.0.5): 27.1.2
Operating system and version (eg, Ubuntu 20.04): Rocky Linux 9.2
Apache or nginx version (eg, Apache 2.4.25): Apache2.4.53
PHP version (eg, 7.4): 8.2.11

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Click to create share link on federated share
  2. “Error creating share”

The output of your Nextcloud log in Admin > Logging:

ntext	Exception: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OCA\Files_Sharing\External\Storage does not have a method "getShareId" in file '/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php' line 524
/var/www/html/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/html/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/html/nextcloud/ocs/v1.php - line 64:

OC\Route\Router->match()

/var/www/html/nextcloud/ocs/v2.php - line 23:

require_once("/var/www/ht ... p")

Caused by TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OCA\Files_Sharing\External\Storage does not have a method "getShareId"
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 524:

call_user_func_array()

<<closure>>

OC\Files\Storage\Wrapper\Wrapper->__call()

/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 524:

call_user_func_array()

/var/www/html/nextcloud/lib/private/Share20/Manager.php - line 675:

OC\Files\Storage\Wrapper\Wrapper->__call()

/var/www/html/nextcloud/lib/private/Share20/Manager.php - line 765:

OC\Share20\Manager->setLinkParent()

/var/www/html/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php - line 834:

OC\Share20\Manager->createShare("*** sensiti ... *")

/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Files_Sharing\Controller\ShareAPIController->createShare("*** sensiti ... *")

/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/html/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/html/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/html/nextcloud/ocs/v1.php - line 64:

OC\Route\Router->match()

/var/www/html/nextcloud/ocs/v2.php - line 23:

require_once("/var/www/ht ... p")

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

<?php
$CONFIG = array (
  'passwordsalt' => '--------------------',
  'secret' => '------------------',
  'trusted_domains' =>
  array (
    0 => 'pcloud.pirtek.com.au',
    1 => 'pcloud2.pirtek.com.au',
  ),
  'datadirectory' => '/pCLOUDdata',
  'dbtype' => 'mysql',
  'version' => '27.1.2.1',
  'htaccess.RewriteBase' => '/nextcloud',
  'overwrite.cli.url' => 'https://pcloud.pirtek.com.au',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_pCLOUDAdmin',
  'dbpassword' => 'CloudAdmin$$',
  'installed' => true,
  'instanceid' => 'oc1rl5m3dmfd',
  'mail_from_address' => 'zzzzzzzzzzz',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'pirtek.com.au',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.pirtek.net.au',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'zzzzzzzzzz',
  'mail_smtppassword' => 'zzzzzzz',
  'trashbin_retention_obligation' => 'auto, 14',
  'logtimezone' => 'Australia/Sydney',
  'log_rotate_size' => 104857600,
  'logtype' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => 2,
  'logdateformat' => 'F d, Y H:i:s',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
    0 => 'Pirtek IT',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
    0 => 'admin',
  ),
  'maintenance' => false,
  'theme' => '',
  'default_phone_region' => 'AU',
  'allow_local_remote_servers' => true,
  'app_install_overwrite' =>
  array (
    0 => 'impersonate',
    1 => 'cms_pico',
  ),
  'knowdedgebaseenabled' => true,
);

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

Nothing relevant is access or error logs

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
{"reqId":"ZTmsGTK3R1h@ICoEIwGO1gAAAUI","level":3,"time":"October 26, 2023 11:00:25","remoteAddr":"192.168.3.1","user":"gyoung","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OCA\\Files_Sharing\\External\\Storage does not have a method \"getShareId\" in file '/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php' line 524","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0","version":"27.1.2.1","exception":{"Exception":"Exception","Message":"call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OCA\\Files_Sharing\\External\\Storage does not have a method \"getShareId\" in file '/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php' line 524","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/nextcloud/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/nextcloud/ocs/v2.php","line":23,"args":["/var/www/html/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OCA\\Files_Sharing\\External\\Storage does not have a method \"getShareId\"","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":524,"function":"call_user_func_array"},{"function":"__call","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":524,"function":"call_user_func_array"},{"file":"/var/www/html/nextcloud/lib/private/Share20/Manager.php","line":675,"function":"__call","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Share20/Manager.php","line":765,"function":"setLinkParent","class":"OC\\Share20\\Manager","type":"->"},{"file":"/var/www/html/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php","line":834,"function":"createShare","class":"OC\\Share20\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"createShare","class":"OCA\\Files_Sharing\\Controller\\ShareAPIController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/nextcloud/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/nextcloud/ocs/v2.php","line":23,"args":["/var/www/html/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","Line":524},"CustomMessage":"--"}}