Webcron successfully fails since upgrade from NC 22 to 23 (according to message in admin panel)

Nextcloud version: 23.0.3
Operating system and version: Ubuntu 20.04.4 LTS
Apache or nginx version: Apache, unknown version (web hoster)
PHP version: 8.0.16

Yesterday I upgraded my Nextcloud installation from 22.x to 23.0.3. Since then (it never occured before) I get this error message in the admin panel under Administration - General settings (please note: I use the German version and I translated messages and menus, which means it may be called differently):

“Some jobs have not been executed since 16 hours ago. Please consider switching to system cron.” (original: “Einige Aufträge wurden seit Vor 16 Stunden nicht mehr ausgeführt. Bitte erwäge die Umstellung auf System-Cron.”).

And there is a red square in front of it.

I can only use Webcron, because I have a web hoster, no root server. The cronjob is correctly configured at the hoster, I checked it some minutes ago (and it always worked before the upgrade).

When I open the cron.php manually in the browser, I get “success”, no error. And the Nextcloud system log does not contain anything concerning the cronjob and not any error message.

How can I find out what’s wrong? Or is it just a bug in the latest version (maybe only the message itself is the bug)?

3 Likes

I’d like to chime in and add that this morning UTC-5 I upgraded to 23.0.3 and now I get the same thing as you. “Last background job execution ran 5 hours ago. Something seems wrong. Check the background job settings :arrow_upper_right:.” Of course, it’s been set to cron since day one 3 years ago and it wasn’t getting this until the upgrade. You might check from the command line too. When I run a status check I get: An unhandled exception has been thrown and that’s followed by the path to /Connection.php:87 and then presents a stack trace.

Fortunately, so far everything seems to me running fine, but who knows how long that will last.
Good Luck to you.

If I understand you correctly, you use a system cronjob, not webcron, right?

I thought the problem might be webcron, but then it seems to be a general bug in the cronjob since version 23. At least on some systems, because there are not much reports concerning this.

Maybe it’s because of a specific app? I use these:

Accessibility
Activity
AppOrder
Auditing / Logging
Brute-force settings
Calendar
Circles
Contacts Interaction
First run wizard
Log Reader
Monitoring
Nextcloud announcements
Notifications
Password policy
Privacy
Right click
Support
Theming
Update notification

@bvp
Perhaps you can use for background jobs AJAX. I use it on a Managed Nextcloud. AJAX has got disadvantages e.g. for Activity App.

Because of the disadvantages I would like to stick with Webcron. I would use a system cronjob, if it would be possible on my server.

I just checked the PHP error log and there are no errors logged (as in the log section of the admin panel).

Any ideas on how to find out which exact tasks fail? The message in the admin panel says “some”.

Perhaps you can change the loglevel for more information.
documentation

I changed loglevel from 2 to 0 and immediately I get 10 messages per second non-stop saying this:

/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.

This is nothing concerning the cronjob, because it didn’t run at that time, but it makes me impossible to use value 0 for analyzing.

So I switched to loglevel 1 and immediately got 2 times this:

Could not detect any host in https:///data/htaccesstest.txt

But when running the cronjob manually by calling cron.php in the browser, no more entries appear. I called it several times, nothing is logged with loglevel 1.

I’m having the exact same problem as OP. Before the upgrade to NC 23, everything was working fine with Webcron, but after the update, I also get the error message “Some jobs didn’t execute since 5 days ago. Please consider switching to system cron.” with the red square in front of it.
When I manually access the cron.php in my web browser I get the reply {“status”:“success”} but the error message in the admin panel remains.
As I’m also on a shared web hoster “normal” cron is not an option. (AJAX is no option either because of too few users.)

Have exact the same issue since update from 22.2.5 to 22.2.6.
After updating to 23.0.3 no difference, still “Some jobs have not been executed since…”
Webcron is calling cron.php successfully. Calling cron.php also working with success.
No error message in nectcloud log or webspace log.

I have exactly the same problem after updating from version 23.0.2 to 23.0.3. Webcron works correctly, but the error message still remains. When hovering the error message, the date/time doesn’t change. I triggered the cron.php several times, but without an effect.

I got the same problem and it would be great to get a solution. With every ner version I get the feeling it is more important for NextCloud to be “up to date” with a new number behind the name, instead of being a good running system…

Hi

Like my previous writers I have the same problem.
I use Nextcloud Hub II (23.0.3) together with mariaDB. I’ve encountered this issue also since the update to v23.0.3. I have even deleted the complete nextcloud installation, including mariaDB and did a complete fresh install. Also with a fresh database.
A few hours long the status of the background-jobs where green and now 1 day later it says already that my jobs are 23hours overdue.

Unfortunately I only have managed webhosting. Therefore without SSH access. So I am forced to use webcron or AJAX. So I decided to use webcron. I have a raspberrypi running at my home, which calls all 5min the cron.php file. Return message is always: {"status": "success"}. I have even set up a task in postman to call the job several hundreds times, one after another. Always with the success message in return. I checked the table “oc_bruteforce_attempts” to be sure that the postman job doesn’t block me. So far so good. No entries in this table.

Now I’m out of ideas how to fix this issue. Did anyone had already success in resolving this?

Here have an export of the important fields from oc_jobs.
The last entry is interesting as last_run stays always at 0. No matter how often the cron job have been run.

table oc_jobs

id,class,last_run,last_checked
1,OCA\UpdateNotification\Notification\BackgroundJob,1650471000,1650555598
2,OCA\UserStatus\BackgroundJob\ClearOldStatusesBackgroundJob,1650471018,1650570902
3,OCA\ServerInfo\Jobs\UpdateStorageStats,1650552406,1650555599
4,OCA\Text\Cron\Cleanup,1650555438,1650555595
5,OCA\WorkflowEngine\BackgroundJobs\Rotate,1650552408,1650555596
6,OCA\Files\BackgroundJob\ScanFiles,1650555435,1650555597
7,OCA\Files\BackgroundJob\DeleteOrphanedItems,1650552410,1650555599
8,OCA\Files\BackgroundJob\CleanupFileLocks,1650555437,1650555595
9,OCA\Files\BackgroundJob\CleanupDirectEditingTokens,1650554708,1650555596
10,OCA\NextcloudAnnouncements\Cron\Crawler,1650471142,1650555597
11,OCA\DAV\BackgroundJob\CleanupDirectLinksJob,1650471151,1650555598
12,OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob,1650552608,1650555597
13,OCA\DAV\BackgroundJob\CleanupInvitationTokenJob,1650471171,1650555598
14,OCA\DAV\BackgroundJob\EventReminderJob,1650555594,1650555599
15,OCA\DAV\BackgroundJob\CalendarRetentionJob,1650549903,1650555598
16,OCA\Files_Sharing\DeleteOrphanedSharesJob,1650554709,1650555595
17,OCA\Files_Sharing\ExpireSharesJob,1650471223,1650471223
18,OCA\Files_Sharing\BackgroundJob\FederatedSharesDiscoverJob,1650471297,1650555598
19,OCA\ContactsInteraction\BackgroundJob\CleanupJob,1650471300,1650471300
20,OCA\Files_Versions\BackgroundJob\ExpireVersions,1650554709,1650555602
21,OCA\Notifications\BackgroundJob\GenerateUserSettings,1650471605,1650555594
22,OCA\Notifications\BackgroundJob\SendNotificationMails,1650555594,1650555594
23,OCA\Activity\BackgroundJob\EmailNotification,1650555595,1650555595
24,OCA\Activity\BackgroundJob\ExpireActivities,1650472500,1650472500
25,OCA\Activity\BackgroundJob\DigestMail,1650552002,1650555596
26,OCA\Files_Trashbin\BackgroundJob\ExpireTrash,1650554710,1650555596
27,OCA\Support\BackgroundJobs\CheckSubscription,1650555435,1650555597
28,OCA\Circles\Cron\Maintenance,1650555597,1650555597
29,OCA\Federation\SyncJob,1650474000,1650555595
30,OC\Authentication\Token\DefaultTokenCleanupJob,1650555597,1650555597
31,OC\Log\Rotate,1650555598,1650555598
32,OC\Preview\BackgroundCleanupJob,1650552404,1650555595
34,OCA\Calendar\BackgroundJob\CleanUpOutdatedBookingsJob,1650471632,1650471278
35,OCA\Contacts\Cron\SocialUpdateRegistration,1650480001,1650480001
48,OCA\Settings\BackgroundJobs\VerifyUserData,0,1650555596

Just a new update to v23.0.4 where published a few minutes ago.
I updated therefore my nextcloud installation but nothing changed with the webcron / background jobs issue. I’ve triggered again several cron.php update jobs with the Postman app but in settings I get still the waring with the red square symbol that some jobs are overdue.

Unfortunately an upload of screenshots doesn’t work for me. Therefore I describe what have been changed in the oc_jobs table. There are now about 5 new jobs and still the job OC\Preview\BackgroundCleanupJob wit a last run = 0. Also after the cron.php call.

I hoped really that v23.0.4 would solve this issue but it seems to be not the case. Did anyone had success with the new version?

Best regards
Simon

No, nothing changed after the current update. The cronjob last ran successfully a month ago.

Hello, this issue will most likely be solved with Get not only time-sensitive next job from list but any when not in cron-mode by k-popov · Pull Request #32109 · nextcloud/server · GitHub

1 Like

That sounds great! :slight_smile:
Looking forward to the next release with this fix included :+1: