Error: Call to a member function getUID() on null when uploading files to shared folder

[details=“Support intro”]

Hello.
We are seeing this error a lot since we upgraded from version 17 to version 18.02
I am not sure if the error was present before we upgraded.
Users are also having a hard time uploading files to shared folders.

These are the logs:

{"reqId":"SsQKNPsE6arBNHssiWI3","level":3,"time":"2020-03-20T15:53:51+00:00","remoteAddr":"172.24.16.100","user":"--","app":"public","method":"PUT","url":"/public.php/webdav/SAVVY_apo%20cert%20of%20address_21.02.2020.pdf","message":{"Exception":"Error","Message":"Call to a member function getUID() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/activity/lib/FilesHooks.php","line":638,"function":"getOwner","class":"OC\\Files\\View","type":"->","args":["/My Folder/xxx//SAVVY_apo cert of address_21.02.2020.pdf"]},{"file":"/var/www/nextcloud/apps/activity/lib/FilesHooks.php","line":190,"function":"getSourcePathAndOwner","class":"OCA\\Activity\\FilesHooks","type":"->","args":["/My Folder/xxx//SAVVY_apo cert of address_21.02.2020.pdf"]},{"file":"/var/www/nextcloud/apps/activity/lib/FilesHooks.php","line":148,"function":"addNotificationsForFileAction","class":"OCA\\Activity\\FilesHooks","type":"->","args":["/My Folder/xxx//SAVVY_apo cert of address_21.02.2020.pdf","file_created","","created_public"]},{"file":"/var/www/nextcloud/apps/activity/lib/FilesHooksStatic.php","line":47,"function":"fileCreate","class":"OCA\\Activity\\FilesHooks","type":"->","args":["/My Folder/xxx//SAVVY_apo cert of address_21.02.2020.pdf"]},{"file":"/var/www/nextcloud/lib/private/legacy/hook.php","line":111,"function":"fileCreate","class":"OCA\\Activity\\FilesHooksStatic","type":"::","args":[{"path":"/My Folder/xxx//SAVVY_apo cert of address_21.02.2020.pdf"}]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":389,"function":"emit","class":"OC_Hook","type":"::","args":["OC_Filesystem","post_create",{"path":"/My Folder/xxx//SAVVY_apo cert of address_21.02.2020.pdf"}]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":321,"function":"emitPostHooks","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[false]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":156,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1096,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["SAVVY_apo cert of address_21.02.2020.pdf",null]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":525,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["SAVVY_apo cert of address_21.02.2020.pdf",null,null]},{"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https://secure.mysite.com/public.php/webdav/SAVVY_apo%20cert%20of%20address_21.02.2020.pdf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpPut"],[{"absoluteUrl":"https://secure.mysite.com/public.php/webdav/SAVVY_apo%20cert%20of%20address_21.02.2020.pdf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:PUT",[{"absoluteUrl":"https://secure.mysite.com/public.php/webdav/SAVVY_apo%20cert%20of%20address_21.02.2020.pdf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https://secure.mysite.com/public.php/webdav/SAVVY_apo%20cert%20of%20address_21.02.2020.pdf","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php","line":109,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/nextcloud/public.php","line":81,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/View.php","Line":1690,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36","version":"18.0.2.2","id":"5e74ebcd0ca56"}

Nextcloud version: 18.02
Operating system and version: Ubuntu 18.04.4 LTS
Apache or nginx version : Apache/2.4.29 (Ubuntu)
PHP version : PHP 7.2.24-0ubuntu0.18.04.3 (cli) (built: Feb 11 2020 15:55:52) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.3, Copyright © 1999-2018, by Zend Technologies

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 => 'my.website.com',
    1 => '172.24.16.7',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '18.0.2.2',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncadmin',
  'dbpassword' => '***',
  'installed' => true,
  'instanceid' => 'oc9qj0lhtn4e',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '1',
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '10485760',
  'trashbin_retention_obligation' => 'auto, 180',
  'versions_retention_obligation' => 'auto, 365',
  'simpleSignUpLink.shown' => 'false',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => '***',
  ),
  'updater.release.channel' => 'stable',
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_from_address' => 'noreply',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'mydomain.com',
  'mail_smtphost' => 'smtp.mydomain.com',
  'overwriteprotocol' => 'https',
  'mail_smtpport' => '25',
  'updater.secret' => '***',
);

I think this problem has already been reported here.

Thanks j-ed
Will give this a try.

Hi
i Have exactly the same error.

I deactivated the Activity App and the error messages for fileuploading and foldercreation are gone. But if i want to delete a file or replace a file it is not possible and i get the error message again.
grafik

In the Log file i get the “Call to a member function getUID” error.

Do you have any workaround or solution for this?

Same here. Please check this issue I’ve reported

I get the same error, when an external/or internal user tries delete a file

Rgds

Haydar

I get the same errors under 18.0.3!!

[core] Error: Error: Call to a member function getUID() on null at <>

  1. /var/www/nextcloud/apps/files_retention/lib/BackgroundJob/RetentionJob.php line 151
    OCA\Files_Retention\BackgroundJob\RetentionJob->notifyNode(OC\Files\Node\Folder {}, DateTime {date: … "})
  2. /var/www/nextcloud/lib/private/BackgroundJob/Job.php line 61
    OCA\Files_Retention\BackgroundJob\RetentionJob->run({tag: 33})
  3. /var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php line 55
    OC\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
  4. /var/www/nextcloud/cron.php line 125
    OC\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

at 2020-04-21T14:20:02+02:00

And they appear when using the retention app / the function to delete files tagged with a special “deletable tag”
Don’t know how to get rid of them …

hi @chrissi55 you have to use the the Version 6.0.5 if it this question is in combination with Group Folders

Haydar

I’m using version 6.0.6 meanwhile of the group folder app.

My retention app is at version 1.7.0

And still having this errors - now under nextcloud version 18.0.4.2 (i made the update yesterday)

Message from the logs

[core] Error: Error: Call to a member function getUID() on null at <>

  1. /var/www/nextcloud/apps/files_retention/lib/BackgroundJob/RetentionJob.php line 151
    OCA\Files_Retention\BackgroundJob\RetentionJob->notifyNode(OC\Files\Node\Folder {}, DateTime {date: … "})
  2. /var/www/nextcloud/lib/private/BackgroundJob/Job.php line 61
    OCA\Files_Retention\BackgroundJob\RetentionJob->run({tag: 33})
  3. /var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php line 55
    OC\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
  4. /var/www/nextcloud/cron.php line 125
    OC\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

at 2020-04-24T14:35:01+02:00

My update from 18.0.3 -> 18.0.4.2 was at 2020-04-24T06:45:39
As seen my last error message has been logged hours after i updated my nextcloud instance.
So it must come from the constellation nc 18.0.4.2, Retention 1.7.0

My group_folders app i updated early this morning to 6.0.6 -> so the listed error above must have been under version 6.0.5 - i assume.

nextcloud version 19 group folders 6.0.6 and the same error appears: /