Background Jobs not running successfully

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 28.0.12
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04.5 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.52
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • n/a
  • PHP version (e.g, 8.3):
    • 8.1.2
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • 20 days ago per the system Administration Overview
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare Metal
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

[I have noticed hundreds of errors in my logs, almost all related to the background tasks being unable to run. Crontab runs the cron.php job every 10 minutes.]

Steps to replicate it (hint: details matter!):

  1. Running the cron.php job manually results in a similar error as well.

Manual cron invocation command: sudo -u www-data php /var/www/nextcloud/cron.php

Log entries

Result of above manual invocation of cron.php

Error: Cannot call constructor in /var/www/nextcloud/apps/activity/lib/BackgroundJob/RemoteActivity.php:40
Stack trace:
#0 [internal function]: OCA\Activity\BackgroundJob\RemoteActivity->__construct()
#1 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(120): ReflectionClass->newInstanceArgs()
#2 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(128): OC\AppFramework\Utility\SimpleContainer->buildClass()
#3 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(146): OC\AppFramework\Utility\SimpleContainer->resolve()
#4 /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(470): OC\AppFramework\Utility\SimpleContainer->query()
#5 /var/www/nextcloud/lib/private/ServerContainer.php(155): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#6 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(64): OC\ServerContainer->query()
#7 /var/www/nextcloud/lib/public/Server.php(55): OC\AppFramework\Utility\SimpleContainer->get()
#8 /var/www/nextcloud/lib/private/BackgroundJob/JobList.php(325): OCP\Server::get()
#9 /var/www/nextcloud/lib/private/BackgroundJob/JobList.php(234): OC\BackgroundJob\JobList->buildJob()
#10 /var/www/nextcloud/cron.php(145): OC\BackgroundJob\JobList->getNext()
#11 {main}

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"0J9Hpd6ot5q7GnZx6m1H","level":3,"time":"2024-12-13T23:45:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Exception thrown: Error","userAgent":"--","version":"28.0.12.2","exception":{"Exception":"Error","Message":"Cannot call constructor","Code":0,"Trace":[{"function":"__construct","class":"OCA\\Activity\\BackgroundJob\\RemoteActivity","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":120,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":128,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":146,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":470,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":155,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":64,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/public/Server.php","line":55,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":325,"function":"get","class":"OCP\\Server","type":"::"},{"file":"/var/www/nextcloud/lib/private/BackgroundJob/JobList.php","line":234,"function":"buildJob","class":"OC\\BackgroundJob\\JobList","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":145,"function":"getNext","class":"OC\\BackgroundJob\\JobList","type":"->"}],"File":"/var/www/nextcloud/apps/activity/lib/BackgroundJob/RemoteActivity.php","Line":40,"CustomMessage":"Exception thrown: Error"},"id":"675cc8404a949"}

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "supportedDatabases": [
            "mysql",
            "pgsql",
            "oci"
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "10.100.1.10",
            "10.100.1.11",
            "10.90.1.30",
            "cloud.***REMOVED SENSITIVE VALUE***.org"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.***REMOVED SENSITIVE VALUE***.org",
        "dbtype": "mysql",
        "version": "28.0.12.2",
        "ldapIgnoreNamingRules": false,
        "ldapUserCleanupInterval": 51,
        "lost_password_link": "disabled",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 0
        },
        "loglevel": 1,
        "maintenance": false,
        "trashbin_retention_obligation": "auto",
        "versions_retention_obligation": "auto",
        "theme": "",
        "htaccess.RewriteBase": "\/",
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "updater.release.channel": "stable",
        "knowledgebaseenabled": false,
        "auth.bruteforce.protection.enabled": false,
        "mysql.utf8mb4": true,
        "log_rotate_size": 0,
        "default_phone_region": "US",
        "allow_local_remote_servers": true,
        "profile.enabled": false,
        "maintenance_window_start": 3
    }
}

Apps

The output of occ app:list (if possible).

Enabled:

  • activity: 2.20.0
  • admin_audit: 1.18.0
  • cloud_federation_api: 1.11.0
  • comments: 1.18.0
  • dav: 1.29.2
  • deck: 1.12.6
  • federatedfilesharing: 1.18.0
  • federation: 1.18.0
  • files: 2.0.0
  • files_external: 1.20.0
  • files_pdfviewer: 2.9.0
  • files_reminders: 1.1.0
  • files_sharing: 1.20.0
  • files_trashbin: 1.18.0
  • files_versions: 1.21.0
  • firstrunwizard: 2.17.0
  • groupfolders: 16.0.12
  • impersonate: 1.15.0
  • logreader: 2.13.0
  • lookup_server_connector: 1.16.0
  • notifications: 2.16.0
  • oauth2: 1.16.4
  • onlyoffice: 9.5.0
  • photos: 2.4.0
  • provisioning_api: 1.18.0
  • quota_warning: 1.20.0
  • related_resources: 1.3.0
  • serverinfo: 1.18.0
  • settings: 1.10.1
  • sharelisting: 1.2.0
  • systemtags: 1.18.0
  • text: 3.9.2
  • theming: 2.3.0
  • twofactor_backupcodes: 1.17.0
  • twofactor_totp: 10.0.0-beta.2
  • updatenotification: 1.18.0
  • user_ldap: 1.19.0
  • user_saml: 6.4.1
  • user_usage_report: 1.12.1
  • viewer: 2.2.0
  • workflowengine: 2.10.0
    Disabled:
  • apporder: 0.15.0 (installed 0.15.0)
  • bruteforcesettings: 2.8.0 (installed 1.6.0)
  • circles: 28.0.0 (installed 22.3.1)
  • contactsinteraction: 1.9.0 (installed 1.5.0)
  • dashboard: 7.8.0 (installed 7.0.0)
  • encryption: 2.16.0
  • files_rightclick: 0.15.1 (installed 1.6.0)
  • nextcloud_announcements: 1.17.0 (installed 1.1)
  • password_policy: 1.18.0 (installed 1.2.2)
  • privacy: 1.12.0 (installed 1.0.0)
  • recommendations: 2.0.0 (installed 0.4.0)
  • sharebymail: 1.18.0 (installed 1.8.0)
  • support: 1.11.1 (installed 1.7.0)
  • survey_client: 1.16.0 (installed 1.0.0)
  • suspicious_login: 6.0.0
  • user_status: 1.8.1 (installed 1.0.1)
  • weather_status: 1.8.0 (installed 1.0.0)

Thank you for any assistance or clues to help me fix this issue.

This was already fixed in >= 28.0.13.

Thank you JTR.

I will try to upgrade this weekend.

Does anyone know, since 28.0.13 was withdrawn, will upgrade.phar offer to upgrade to 28.0.14 or to 29.0.10?

I presume it will present 28.0.14.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.