Skip to content

system CRON is not working #1303

@krakazyabra

Description

@krakazyabra

Steps to reproduce

  1. Install Nextcloud from docker image nextcloud:19.0-fpm
  2. Add cron package to the image
  3. Set Background job = Cron
  4. Use Nextcloud as usual
  5. Check page /settings/admin

Expected behaviour

Green square and message, that cron is working

Actual behaviour

Yellow/red square and message, that cronjob was running N hours/days ago
Some jobs haven’t been executed since 17 hours ago
or
Last job execution ran 12 minutes ago. Something seems wrong.

Server configuration

Operating system:
Debian 10 Buster

Web server:
nginx/1.19.1

Database:
Percona xtradb-cluster 5.7.19

PHP version:
PHP 7.3.20

Nextcloud version: (see Nextcloud admin page)
19.0.1-fpm

Updated from an older Nextcloud/ownCloud or fresh install:
Rolling updates from 16

Where did you install Nextcloud from:
Docker image

Signing status:

Signing status
No messages

List of activated apps:

App list
Enabled:
  - accessibility: 1.5.0
  - activity: 2.12.0
  - admin_audit: 1.9.0
  - analytics: 2.5.0
  - apporder: 0.11.0
  - bookmarks: 3.4.3
  - calendar: 2.0.4
  - camerarawpreviews: 0.7.8
  - checksum: 0.4.5
  - cloud_federation_api: 1.2.0
  - comments: 1.9.0
  - contacts: 3.4.0
  - contactsinteraction: 1.0.0
  - cookbook: 0.7.6
  - dashboardcharts: 0.1.3
  - dav: 1.15.0
  - deck: 1.1.2
  - dicomviewer: 1.2.2
  - encryption: 2.7.0
  - external: 3.6.0
  - extract: 1.2.4
  - federatedfilesharing: 1.9.0
  - federation: 1.9.0
  - files: 1.14.0
  - files_accesscontrol: 1.9.1
  - files_automatedtagging: 1.9.0
  - files_downloadactivity: 1.8.0
  - files_external: 1.10.0
  - files_markdown: 2.3.1
  - files_mindmap: 0.0.23
  - files_pdfviewer: 1.8.0
  - files_rightclick: 0.16.0
  - files_sharing: 1.11.0
  - files_texteditor: 2.14.0
  - files_trashbin: 1.9.0
  - files_versions: 1.12.0
  - files_videoplayer: 1.8.0
  - firstrunwizard: 2.8.0
  - forms: 2.0.4
  - gpxedit: 0.0.13
  - gpxmotion: 0.0.11
  - gpxpod: 4.2.2
  - groupfolders: 7.1.0
  - groupquota: 0.1.4
  - keeweb: 0.6.3
  - logreader: 2.4.0
  - lookup_server_connector: 1.7.0
  - mail: 1.4.1
  - maps: 0.1.6
  - music: 0.16.0
  - news: 14.2.2
  - notes: 3.6.4
  - oauth2: 1.7.0
  - ocr: 6.0.56
  - onlyoffice: 6.0.2
  - password_policy: 1.9.1
  - photos: 1.1.0
  - privacy: 1.3.0
  - provisioning_api: 1.9.0
  - quicknotes: 0.6.1
  - quota_warning: 1.8.0
  - recommendations: 0.7.0
  - serverinfo: 1.9.0
  - settings: 1.1.0
  - sharebymail: 1.9.0
  - sociallogin: 3.4.1
  - socialsharing_email: 2.1.0
  - spreed: 9.0.4
  - support: 1.2.1
  - survey_client: 1.7.0
  - systemtags: 1.9.0
  - tasks: 0.13.4
  - text: 3.0.1
  - twofactor_backupcodes: 1.8.0
  - updatenotification: 1.9.0
  - viewer: 1.3.0
  - workflowengine: 2.1.0
Disabled:
  - appointments
  - nextcloud_announcements
  - notifications
  - phonetrack
  - theming
  - theming_customcss
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "theme": "mytheme",
        "blacklisted_files": [],
        "mail_smtpmode": "sendmail",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": 25,
        "mail_smtptimeout": 10,
        "mail_smtpsecure": "",
        "mail_smtpauth": false,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "logfile": "\/dev\/stdout",
        "enable_previews": true,
        "preview_max_filesize_image": 4096,
        "preview_max_y": 4096,
        "preview_max_x": 4096,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Illustrator",
            "OC\\Preview\\Photoshop"
        ],
        "logtimezone": "Europe\/Prague",
        "social_login_auto_redirect": true,
        "updatechecker": false,
        "has_internet_connection": true,
        "objectstore_multibucket": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "num_buckets": 15000,
                "bucket": "nextcloud-",
                "autocreate": true,
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "use_ssl": true,
                "hostname": "***REMOVED SENSITIVE VALUE***",
                "port": 443,
                "use_path_style": true
            }
        },
        "onlyoffice": {
            "jwt_header": "Authorization",
            "verify_peer_off": true
        },
        "loglevel": 3,
        "trusted_domains": [
            "nc.domain.org",
            "localhost",
            "10.*.*.*",
            "onlyoffice.domain.org",
            "nc-api.domain.org",
            "*cluster.local"
        ],
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": false,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "6379",
            "timeout": 0
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "19.0.1.1",
        "overwrite.cli.url": "https:\/\/nc.domain.com",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "updater.release.channel": "stable",
        "maintenance": false
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
Minio S3 as default backend

Are you using encryption: yes/no
No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
Keyclak and Social login app in NC

Logs

Nextcloud log (data/nextcloud.log)

Nothing criminal for this operation

Also there a lot of jobs in oc_jobs table:

mysql> select count(id) as jobs, class from oc_jobs group by class order by jobs desc;
+------+-----------------------------------------------------------------+
| jobs | class                                                           |
+------+-----------------------------------------------------------------+
|  810 | OCA\QuotaWarning\Job\User                                       |
|  802 | OCA\LookupServerConnector\BackgroundJobs\RetryJob               |
|  564 | OCA\Settings\BackgroundJobs\VerifyUserData                      |
|  161 | OCA\DAV\BackgroundJob\UploadCleanup                             |
|  155 | OC\Settings\BackgroundJobs\VerifyUserData                       |
|  104 | OC\Command\CommandJob                                           |
|   43 | OCA\Mail\BackgroundJob\SyncJob                                  |
|   43 | OCA\Mail\BackgroundJob\TrainImportanceClassifierJob             |
|    6 | OCA\DAV\BackgroundJob\RefreshWebcalJob                          |
|    3 | OCA\FederatedFileSharing\BackgroundJob\RetryJob                 |
|    1 | OCA\Passwords\Cron\CheckPasswordsJob                            |
|    1 | OCA\DAV\BackgroundJob\CleanupDirectLinksJob                     |
|    1 | OCA\Passwords\Cron\CleanUpSessions                              |
|    1 | OCA\DAV\BackgroundJob\CleanupInvitationTokenJob                 |
|    1 | OCA\Passwords\Cron\ProcessDeletedEntities                       |
|    1 | OCA\DAV\BackgroundJob\EventReminderJob                          |
|    1 | OCA\Passwords\Cron\ProcessDeletedUsers                          |
|    1 | OCA\Passwords\Cron\SendServerSurvey                             |
|    1 | OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob |
|    1 | OCA\Passwords\Cron\SynchronizeShares                            |
|    1 | OCA\PhoneTrack\Cron\AutoExport                                  |
|    1 | OCA\Deck\Cron\CardDescriptionActivity                           |
|    1 | OCA\Polls\Cron\NotificationCron                                 |
|    1 | OCA\Deck\Cron\DeleteCron                                        |
|    1 | OCA\Deck\Cron\ScheduledNotifications                            |
|    1 | OCA\RansomwareDetection\BackgroundJob\CleanUpJob                |
|    1 | OCA\Federation\SyncJob                                          |
|    1 | OCA\Richdocuments\Backgroundjobs\ObtainCapabilities             |
|    1 | OCA\Files\BackgroundJob\CleanupDirectEditingTokens              |
|    1 | OCA\Files\BackgroundJob\CleanupFileLocks                        |
|    1 | OCA\Support\BackgroundJobs\CheckSubscription                    |
|    1 | OCA\Files\BackgroundJob\DeleteOrphanedItems                     |
|    1 | OCA\Talk\BackgroundJob\ExpireSignalingMessage                   |
|    1 | OCA\Files\BackgroundJob\ScanFiles                               |
|    1 | OCA\Talk\BackgroundJob\RemoveEmptyRooms                         |
|    1 | OCA\Files_Antivirus\BackgroundJob\BackgroundScanner             |
|    1 | OCA\Talk\BackgroundJob\ResetAssignedSignalingServer             |
|    1 | OCA\Files_Sharing\BackgroundJob\FederatedSharesDiscoverJob      |
|    1 | OCA\Text\Cron\Cleanup                                           |
|    1 | OCA\Files_Sharing\DeleteOrphanedSharesJob                       |
|    1 | OCA\UpdateNotification\Notification\BackgroundJob               |
|    1 | OCA\Files_Sharing\ExpireSharesJob                               |
|    1 | OCA\UpdateNotification\ResetTokenBackgroundJob                  |
|    1 | OCA\Files_Trashbin\BackgroundJob\ExpireTrash                    |
|    1 | OCA\User_LDAP\Jobs\CleanUp                                      |
|    1 | OCA\Files_Versions\BackgroundJob\ExpireVersions                 |
|    1 | OCA\User_LDAP\Jobs\Sync                                         |
|    1 | OCA\FirstRunWizard\Notification\BackgroundJob                   |
|    1 | OCA\User_LDAP\Jobs\UpdateGroups                                 |
|    1 | OCA\FullTextSearch\Cron\Index                                   |
|    1 | OCA\Activity\BackgroundJob\EmailNotification                    |
|    1 | OCA\WorkflowEngine\BackgroundJobs\Rotate                        |
|    1 | OCA\GroupFolders\BackgroundJob\ExpireGroupVersions              |
|    1 | OCA\Activity\BackgroundJob\ExpireActivities                     |
|    1 | OC\Authentication\Token\DefaultTokenCleanupJob                  |
|    1 | OCA\AdminAudit\BackgroundJobs\Rotate                            |
|    1 | OC\BackgroundJob\Legacy\RegularJob                              |
|    1 | OCA\Analytics\BackgroundJob\Daily                               |
|    1 | OCA\Analytics\BackgroundJob\Hourly                              |
|    1 | OC\Core\BackgroundJobs\CleanupLoginFlowV2                       |
|    1 | OCA\News\Cron\Updater                                           |
|    1 | OCA\Bookmarks\BackgroundJobs\CrawlJob                           |
|    1 | OC\Log\Rotate                                                   |
|    1 | OCA\NextcloudAnnouncements\Cron\Crawler                         |
|    1 | OCA\Bookmarks\BackgroundJobs\PreviewsJob                        |
|    1 | OC\Preview\BackgroundCleanupJob                                 |
|    1 | OCA\Passman\BackgroundJob\ExpireCredentials                     |
|    1 | OCA\Circles\Cron\ContactsExistingShares                         |
|    1 | OCA\Passwords\Cron\BackupJob                                    |
|    1 | OCA\ContactsInteraction\BackgroundJob\CleanupJob                |
|    1 | OCA\Passwords\Cron\CheckNightlyUpdates                          |
|    1 | OCA\Contacts\Cron\SocialUpdateRegistration                      |
+------+-----------------------------------------------------------------+
72 rows in set (0.01 sec)

The cron task exists:

root@nextcloud-0:/var/www/html# crontab -u www-data -l
*/5 * * * * php -f /var/www/html/cron.php

For now the only way, how to enforce cronjob is running manually sudo -u www-data php cron.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions