Unknown error when uploading into a shared folder on external storage

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2) : 18.0.3
Operating system and version (eg, Ubuntu 17.04) : Ubuntu 16.0.4.6 LTS
Apache or nginx version (eg, Apache 2.4.25) : 2.4.18
PHP version (eg, 7.1) : 7.3.16

The issue you are facing:
Hi, i use nextcloud with external storage. I have enabled the sharing functionality on the external storage. So now when i create a folder on the external storage and share it with a link as upload folder, the guest who has the link can upload a file but get an “unknown error”. The file is first not shown to him but it was uploaded and after refresh in the browser (F5) the file will be shown to the guest. The same problem when the guest try to rename or delete the file, each time he will get an error, but the operation is done and shown after refreh. To delete the file needs sometimes more tries. But after few tries the file will be deleted.
The error appears only when you share a folder on an external storage, when you share a folder in local user storage in the nextcloud it works fine.

Is this the first time you’ve seen this error? (Y/N):
n
Steps to replicate it:

  1. Create a new folder on a external storage in nextcloud
  2. share this folder with as upload folder with a link.
  3. Open the share with this link and upload a file (dont matter filetype or size)

The output of your Nextcloud log in Admin > Logging:

Error: Call to a member function getUID() on null
/usr/lib/nextcloud/apps/activity/lib/FilesHooks.php - line 638:
OC\Files\View->getOwner("/Eigene Dat ... f")
/usr/lib/nextcloud/apps/activity/lib/FilesHooks.php - line 190:
OCA\Activity\FilesHooks->getSourcePathAndOwner("/Eigene Dat ... f")
/usr/lib/nextcloud/apps/activity/lib/FilesHooks.php - line 148:
OCA\Activity\FilesHooks->addNotificationsForFileAction("/Eigene Dat ... f", "file_created", "", "created_public")
/usr/lib/nextcloud/apps/activity/lib/FilesHooksStatic.php - line 47:
OCA\Activity\FilesHooks->fileCreate("/Eigene Dat ... f")
/usr/lib/nextcloud/lib/private/legacy/hook.php - line 111:
OCA\Activity\FilesHooksStatic::fileCreate({ path: "/Ei ... "})
/usr/lib/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 389:
OC_Hook::emit("OC_Filesystem", "post_create", { path: "/Ei ... "})
/usr/lib/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 321:
OCA\DAV\Connector\Sabre\File->emitPostHooks(false)
/usr/lib/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:
OCA\DAV\Connector\Sabre\File->put(null)
/usr/lib/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:
OCA\DAV\Connector\Sabre\Directory->createFile("Übung Prepositions.pdf", null)
/usr/lib/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525:
Sabre\DAV\Server->createFile("Woche vom 2 ... f", null, null)
<<closure>>
Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})
/usr/lib/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:
call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])
/usr/lib/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:
Sabre\Event\EventEmitter->emit("method:PUT", [ Sabre\HTTP ... }])
/usr/lib/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})
/usr/lib/nextcloud/apps/dav/appinfo/v1/publicwebdav.php - line 109:
Sabre\DAV\Server->exec()
/usr/lib/nextcloud/public.php - line 81:
require_once("/usr/lib/ne ... p")

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

?php
$CONFIG = array (
  'instanceid' => 'inst_id',
  'passwordsalt' => 'secret',
  'secret' => 'moresecret',
  'trusted_domains' =>
  array (
    0 => 'adress0',
    1 => 'adress1',
    2 => 'adress2',
    3 => 'adress3',
    4 => 'adress4',
    5 => 'adress5',
    6 => 'adress6',
    7 => 'adress7',
    8 => 'adress8,
  ),
  'datadirectory' => '/var/lib/nextcloud',
  'dbtype' => 'pgsql',
  'version' => '18.0.3.0',
  'overwrite.cli.url' => 'https://our.domain.local',
  'dbname' => 'ourdbname',
  'dbhost' => 'ourdbhostname',
  'dbport' => '',
  'dbtableprefix' => '',
  'dbuser' => 'ourdbusername',
  'dbpassword' => 'ourpassword',
  'installed' => true,
  'ldapIgnoreNamingRules' => 'false',
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'filesystem_check_changes' => '1',
  'mail_domain' => 'ourdomainname.de',
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'localhost',
  'mail_smtpport' => '25',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'share_folder' => '/Eigene Dateien/Geteilte Dateien',
  'skeletondirectory' => '',
  'trusted_proxies' =>
  array (
    0 => 'ip-from-proxy',
  ),
  'forwarded_for_headers' =>
  array (
    0 => 'HTTP_X_FORWARDED_FOR',
  ),
  'maintenance' => true,
  'theme' => '',
  'loglevel' => 2,
  'app_install_overwrite' =>
  array (
    0 => 'bookmarks_fulltextsearch',
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => '6379',
  ),
);

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

PASTE HERE

Thanks a lot in advance

this looks related to it:

yes it seems to be exactly the same issue. Thank you!