Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextcloud 12 throwing fatal error: cron - “Call to a member function getFileInfo() on null” #6803

Closed
Xleg opened this issue Oct 10, 2017 · 6 comments

Comments

@Xleg
Copy link

Xleg commented Oct 10, 2017

Hello,
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 6 pm and 8 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":"12.0.3.3"}

For www-data only one Cornjob is set up:
*/15 * * * * php -f /var/www/nextcloud/cron.php

This are the times when the error occurred:
2017-10-02T18:15:36+00:00
2017-10-03T18:30:03+00:00
2017-10-04T18:45:13+00:00
2017-10-05T18:46:04+00:00
2017-10-06T19:00:03+00:00
2017-10-07T19:16:53+00:00
2017-10-08T19:30:04+00:00
2017-10-09T19:45:03+00:00

I tried to cleanup the occ file cache, but there was no file cache entries deleted.

About my system:
Debian Stretch

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

Does anyone have any solutions?

Thank you in advance.

@MichaIng
Copy link
Member

MichaIng commented Oct 10, 2017

According to the error times and dates, it looks like an daily cron.php background job error.

For easier debugging/evaluation of errors, it would be nice to have a list of all background jobs, cron.php executes in what time schedule. I know jobs can also be added by apps, but the core jobs would already help. I already asked for this in the forum, as I often find issues there that could be related to a certain background job: https://help.nextcloud.com/t/list-of-background-cron-jobs-with-execution-schedule/22105

@nickvergessen
Copy link
Member

As mentioned above, please provide the content of your jobs table

@MichaIng
Copy link
Member

MichaIng commented Oct 10, 2017

mysql -u<user> -p<pass> -e 'select * from nextcloud.oc_jobs;' provides the wanted list.

By checking the related apps background job php you can find out the schedule.
NextcloudAnnouncements\Cron\Crawler, ExpireActivities, ExpireSharesJob, Federation- and CardDAV SyncJobs would be e.g. candidates that run once a day, but it really depends on which apps are active/installed.

@Xleg
Copy link
Author

Xleg commented Oct 11, 2017

Ok I run the sql command. These are my job results (I have already formatted the date):

OCA\Files_Sharing\DeleteOrphanedSharesJob
last run => 11.10.2017 22:30:01

OCA\Files_Sharing\ExpireSharesJob
last run => 11.10.2017 20:45:05

OCA\Files_Trashbin\BackgroundJob\ExpireTrash
last run => 11.10.2017 22:00:34

OCA\Activity\BackgroundJob\EmailNotification
last run => 11.10.2017 22:30:01

OCA\Activity\BackgroundJob\ExpireActivities
last run => 11.10.2017 20:45:05

OCA\Files\BackgroundJob\ScanFiles
last run => 11.10.2017 22:30:01

OCA\Files\BackgroundJob\DeleteOrphanedItems
last run => 11.10.2017 21:45:02

OCA\Files\BackgroundJob\CleanupFileLocks
last run => 11.10.2017 22:30:02

OCA\Federation\SyncJob
last run => 11.10.2017 20:30:13

OCA\DAV\CardDAV\SyncJob
last run => 11.10.2017 20:30:13

OCA\UpdateNotification\Notification\BackgroundJob
last run => 11.10.2017 20:31:33

OCA\Files_Versions\BackgroundJob\ExpireVersions
last run => 11.10.2017 22:15:03

OCA\NextcloudAnnouncements\Cron\Crawler
last run => 11.10.2017 20:45:02

\OC\Authentication\Token\DefaultTokenCleanupJob
last run => 11.10.2017 22:30:03

OCA\QuotaWarning\Job\User for User1
last run => 11.10.2017 21:45:02

OCA\QuotaWarning\Job\User for User2
last run => 11.10.2017 22:00:34

OCA\QuotaWarning\Job\User for User3
last run => 11.10.2017 22:00:34

OCA\QuotaWarning\Job\User for User4 (this account is deleted)
last run => 11.10.2017 22:00:34

OC\BackgroundJob\Legacy\RegularJob
last run => 11.10.2017 22:30:03

OCA\QuotaWarning\Job\User for User 5
last run => 11.10.2017 22:30:02

OCA\QuotaWarning\Job\User for User 6
last run => 10.10.2017 22:45:03

OC\Log\Rotate
last run => 11.10.2017 22:30:02

The last time when the error occured was 2017-10-11T20:00:34+00:00 as the log said.
But if I check the log via web it says 2017-10-11T22:00:34+0200.
So what is the right time ?

It looks like the weblog is right.
The error can only occure from:
OCA\Files_Trashbin\BackgroundJob\ExpireTrash
OCA\QuotaWarning\Job\User for User2
OCA\QuotaWarning\Job\User for User3
OCA\QuotaWarning\Job\User for User4 (this account is deleted)

Maybe it's the job for User4 which is already deleted, so it can't find the right sources?

What should I do? Delete the entry?

@nickvergessen
Copy link
Member

You can try the following code change too:
https://github.com/nextcloud/quota_warning/pull/25/files#diff-9b24eeb8fed24e0f7c5552c5644ebe8b

That will remove the background job when the user does not exist anymore. If it works I will release it in a new version tomorrow

@Xleg
Copy link
Author

Xleg commented Oct 13, 2017

It worked !
Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants