Nextcloud 12 throwing fatal error: cron - "Call to a member function getFileInfo() on null"

I’m a beginner with Nextcloud and I set up a nextcloud 12.0.3 a few days ago.
It works, but I get every day between 9 pm and 10 pm the following error message:

{"reqId":"5kYNUzZGYp3iiub1VHMM","level":4,"time":"2017-10-08T19:30:04+00:00","remoteAddr":"","user":"--","app":"cron","method":"--","url":"--","message":"Call to a member function getFileInfo() on null","userAgent":"--","version":""}

In my opinion the problem is not the Crownjob. For www-data only one Cornjob is set up:
*/15 * * * * php -f /var/www/nextcloud/cron.php

About my system:

Debian Stretch

PHP-fpm: 7.0.19
Database: MySQL - MariaDB
Webserver: nginx

Does anyone have any solutions?

Thank you in advance.

It can be still a cron job error. cron.php is executed every 15 mins, but not every kind of background job is executed every 15 mins by it. Some run just every 24h.

Also that the error appears exactly 19:30 o’clock points toward a cron job execution. Could you check if the time is the same for the other error messages, of if this was just by chance?

first of all thanks for your help.

This are the times when the error occurred:

Looks like the error would occur from day to day later.

Yeah, but this defenitly looks like daily background job executed by cron. After execution the job will be added 24h later, which most likely will be then scheduled in the cron execution 15 mins later, besides the jobs gets delayed by some reason (xx:16 instead of xx:15)

I was just asking in another topic for a list of all background jobs. Could be something related to file cache cleanup, but I hope someone can find a more detailed reason based on the error message.

Ok, thank you for your suggestion.

I will try to do a file cache cleanup.
Can you tell me how to empty the file cache? I never did it before.

Ah, I mean maybe the cleanup itself produces the error. As far as I remember cron.php does the file cache cleanup once every 24h. You could try it by sudo -u www-data /path/to/nextcloud/occ files:cleanup, in case www-data is your web server user.

Ok I just tried to delete the cache and it works.

But the right command was:
sudo -u www-data php /path/to/nextcloud/occ files:cleanup

Nothing was deleted, it said :
0 orphaned file cache entries deleted

Today I got this error again. Any other solutions?
Does ist helps when I post my cronjobs?

Ah yeah sorry, for me somehow php is not needed inside occ command, was wondering myself :smile:.

Okay, so cache cleanup seems not to be the related background job. I hope to soon get some answer here about other daily background jobs of Nextcloud. Will reply if I have some idea/other jobs to test. Maybe in between someone with more insight can help you further.

Also consider to open a issue on github (bug tracker), as you are closer to the developers with more detailed knowledge there:

Thanks for your suggestion.

I opened an issue here.

Should be solved: