Cleanup Background Jobs Job never clears from the Jobs List

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).

Server Information

  • Nextcloud Server
    • 35.0.2.2
  • OS
    • FreeBSD 15.1-RELEASE-p2
  • Web server
    • nginx/1.30.6
  • Reverse proxy
    • N/A (not in use)
  • PHP
    • 8.5.12
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Unknown
  • Installation method
    • Bare Metal
  • Are you using CloudfIare, mod_security, or similar?
    • No

Summary:

Noticed a lot of junk log entries relating to “Error while running background job ‘OC\Core\BackgroundJobs\CleanupBackgroundJobsJob’”. Further investigation showed "An exception occurred while executing a query: SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value “6905926077” is out of range for type integer.

[Possible] Steps to replicate it:

  1. Wait for the specified job to start:
    OC\Core\BackgroundJobs\CleanupBackgroundJobsJob

  2. Immediately shut down the server (gracefully, or not)

  3. Wait a few days (Yes, days. This was not a “critical” server to have up. It’s used for storing pictures and documents that aren’t accessed on a daily basis, for one user), or increment the CMOS clock a few days (and/or lie to the server with false NTP data)

  4. ???

  5. PROFIT?

Log entries

Nextcloud (nextcloud.log)

{
    "reqId": "JBI6J00tjra36Rt2vjrJ",
    "level": 3,
    "time": "October 23, 2026 18:40:01",
    "remoteAddr": "",
    "user": "--",
    "app": "core",
    "method": "",
    "url": "--",
    "scriptName": "/pool/var/www/nextcloud/nextcloud/cron.php",
    "message": "Error while running background job OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob (id: 114236626399580160, arguments: null)",
    "userAgent": "--",
    "version": "35.0.2.2",
    "occ_command": ["/pool/var/www/nextcloud/nextcloud/cron.php"],
    "exception": {
        "Exception": "OC\\DB\\Exceptions\\DbalException",
        "Message": "An exception occurred while executing a query: SQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value \"6905926077\" is out of range for type integer\nCONTEXT:  unnamed portal parameter $2 = '...'",
        "Code": 7,
        "Trace": [{
                "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/ConnectionAdapter.php",
                "line": 79,
                "function": "wrap",
                "class": "OC\\DB\\Exceptions\\DbalException",
                "type": "::",
                "args": [{
                        "__class__": "Doctrine\\DBAL\\Exception\\DriverException"
                    }, "", "UPDATE `*PREFIX*job_runs` SET `status` = :dcValue1, `duration` = :dcValue2, `ram_peak_usage` = :dcValue3 WHERE `run_id` = :dcValue4"]
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                "line": 280,
                "function": "executeStatement",
                "class": "OC\\DB\\ConnectionAdapter",
                "type": "->",
                "args": ["UPDATE `*PREFIX*job_runs` SET `status` = :dcValue1, `duration` = :dcValue2, `ram_peak_usage` = :dcValue3 WHERE `run_id` = :dcValue4", {
                        "dcValue1": 3,
                        "dcValue2": 6905926077,
                        "dcValue3": 0,
                        "dcValue4": 114237863299829760
                    }, {
                        "dcValue1": 2,
                        "dcValue2": 2,
                        "dcValue3": 2,
                        "dcValue4": 2
                    }
                ]
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/lib/private/BackgroundJob/JobRuns.php",
                "line": 60,
                "function": "executeStatement",
                "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                "type": "->",
                "args": []
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                "line": 60,
                "function": "finished",
                "class": "OC\\BackgroundJob\\JobRuns",
                "type": "->",
                "args": [114237863299829760, 6905926077, 0, {
                        "__class__": "OCP\\BackgroundJob\\JobStatus",
                        "name": "CRASHED",
                        "value": 3
                    }
                ]
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                "line": 39,
                "function": "reapCrashedJobs",
                "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                "type": "->",
                "args": []
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/Job.php",
                "line": 51,
                "function": "run",
                "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                "type": "->",
                "args": [null]
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                "line": 87,
                "function": "start",
                "class": "OCP\\BackgroundJob\\Job",
                "type": "->",
                "args": [{
                        "__class__": "OC\\BackgroundJob\\JobList"
                    }
                ]
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                "line": 204,
                "function": "start",
                "class": "OCP\\BackgroundJob\\TimedJob",
                "type": "->",
                "args": [{
                        "__class__": "OC\\BackgroundJob\\JobList"
                    }
                ]
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                "line": 107,
                "function": "runCli",
                "class": "OC\\Core\\Service\\CronService",
                "type": "->",
                "args": ["cron", null]
            }, {
                "file": "/pool/var/www/nextcloud/nextcloud/cron.php",
                "line": 52,
                "function": "run",
                "class": "OC\\Core\\Service\\CronService",
                "type": "->",
                "args": [null]
            }
        ],
        "File": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/Exceptions/DbalException.php",
        "Line": 51,
        "Previous": {
            "Exception": "Doctrine\\DBAL\\Exception\\DriverException",
            "Message": "An exception occurred while executing a query: SQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value \"6905926077\" is out of range for type integer\nCONTEXT:  unnamed portal parameter $2 = '...'",
            "Code": 7,
            "Trace": [{
                    "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1976,
                    "function": "convert",
                    "class": "Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter",
                    "type": "->",
                    "args": [{
                            "__class__": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
                        }, {
                            "__class__": "Doctrine\\DBAL\\Query"
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1918,
                    "function": "handleDriverException",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->",
                    "args": [{
                            "__class__": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
                        }, {
                            "__class__": "Doctrine\\DBAL\\Query"
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1218,
                    "function": "convertExceptionDuringQuery",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->",
                    "args": [{
                            "__class__": "Doctrine\\DBAL\\Driver\\PDO\\Exception"
                        }, "UPDATE \"oc_job_runs\" SET \"status\" = ?, \"duration\" = ?, \"ram_peak_usage\" = ? WHERE \"run_id\" = ?", [3, 6905926077, 0, 114237863299829760], [2, 2, 2, 2]]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
                    "line": 292,
                    "function": "executeStatement",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->",
                    "args": ["UPDATE \"oc_job_runs\" SET \"status\" = ?, \"duration\" = ?, \"ram_peak_usage\" = ? WHERE \"run_id\" = ?", [3, 6905926077, 0, 114237863299829760], [2, 2, 2, 2]]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/Connection.php",
                    "line": 477,
                    "function": "executeStatement",
                    "class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
                    "type": "->",
                    "args": ["UPDATE \"oc_job_runs\" SET \"status\" = :dcValue1, \"duration\" = :dcValue2, \"ram_peak_usage\" = :dcValue3 WHERE \"run_id\" = :dcValue4", {
                            "dcValue1": 3,
                            "dcValue2": 6905926077,
                            "dcValue3": 0,
                            "dcValue4": 114237863299829760
                        }, {
                            "dcValue1": 2,
                            "dcValue2": 2,
                            "dcValue3": 2,
                            "dcValue4": 2
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/ConnectionAdapter.php",
                    "line": 77,
                    "function": "executeStatement",
                    "class": "OC\\DB\\Connection",
                    "type": "->",
                    "args": ["UPDATE \"oc_job_runs\" SET \"status\" = :dcValue1, \"duration\" = :dcValue2, \"ram_peak_usage\" = :dcValue3 WHERE \"run_id\" = :dcValue4", {
                            "dcValue1": 3,
                            "dcValue2": 6905926077,
                            "dcValue3": 0,
                            "dcValue4": 114237863299829760
                        }, {
                            "dcValue1": 2,
                            "dcValue2": 2,
                            "dcValue3": 2,
                            "dcValue4": 2
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                    "line": 280,
                    "function": "executeStatement",
                    "class": "OC\\DB\\ConnectionAdapter",
                    "type": "->",
                    "args": ["UPDATE `*PREFIX*job_runs` SET `status` = :dcValue1, `duration` = :dcValue2, `ram_peak_usage` = :dcValue3 WHERE `run_id` = :dcValue4", {
                            "dcValue1": 3,
                            "dcValue2": 6905926077,
                            "dcValue3": 0,
                            "dcValue4": 114237863299829760
                        }, {
                            "dcValue1": 2,
                            "dcValue2": 2,
                            "dcValue3": 2,
                            "dcValue4": 2
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/lib/private/BackgroundJob/JobRuns.php",
                    "line": 60,
                    "function": "executeStatement",
                    "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                    "type": "->",
                    "args": []
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                    "line": 60,
                    "function": "finished",
                    "class": "OC\\BackgroundJob\\JobRuns",
                    "type": "->",
                    "args": [114237863299829760, 6905926077, 0, {
                            "__class__": "OCP\\BackgroundJob\\JobStatus",
                            "name": "CRASHED",
                            "value": 3
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                    "line": 39,
                    "function": "reapCrashedJobs",
                    "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                    "type": "->",
                    "args": []
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/Job.php",
                    "line": 51,
                    "function": "run",
                    "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                    "type": "->",
                    "args": [null]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                    "line": 87,
                    "function": "start",
                    "class": "OCP\\BackgroundJob\\Job",
                    "type": "->",
                    "args": [{
                            "__class__": "OC\\BackgroundJob\\JobList"
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                    "line": 204,
                    "function": "start",
                    "class": "OCP\\BackgroundJob\\TimedJob",
                    "type": "->",
                    "args": [{
                            "__class__": "OC\\BackgroundJob\\JobList"
                        }
                    ]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                    "line": 107,
                    "function": "runCli",
                    "class": "OC\\Core\\Service\\CronService",
                    "type": "->",
                    "args": ["cron", null]
                }, {
                    "file": "/pool/var/www/nextcloud/nextcloud/cron.php",
                    "line": 52,
                    "function": "run",
                    "class": "OC\\Core\\Service\\CronService",
                    "type": "->",
                    "args": [null]
                }
            ],
            "File": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php",
            "Line": 87,
            "Previous": {
                "Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                "Message": "SQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value \"6905926077\" is out of range for type integer\nCONTEXT:  unnamed portal parameter $2 = '...'",
                "Code": 7,
                "Trace": [{
                        "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                        "line": 132,
                        "function": "new",
                        "class": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                        "type": "::",
                        "args": [{
                                "__class__": "PDOException",
                                "errorInfo": ["22003", 7, "ERROR:  value \"6905926077\" is out of range for type integer\nCONTEXT:  unnamed portal parameter $2 = '...'"]
                            }
                        ]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php",
                        "line": 69,
                        "function": "execute",
                        "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
                        "type": "->",
                        "args": [null]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/Middleware/ConnectionActivityStatement.php",
                        "line": 26,
                        "function": "execute",
                        "class": "Doctrine\\DBAL\\Driver\\Middleware\\AbstractStatementMiddleware",
                        "type": "->",
                        "args": [null]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                        "line": 1212,
                        "function": "execute",
                        "class": "OC\\DB\\Middleware\\ConnectionActivityStatement",
                        "type": "->",
                        "args": []
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
                        "line": 292,
                        "function": "executeStatement",
                        "class": "Doctrine\\DBAL\\Connection",
                        "type": "->",
                        "args": ["UPDATE \"oc_job_runs\" SET \"status\" = ?, \"duration\" = ?, \"ram_peak_usage\" = ? WHERE \"run_id\" = ?", [3, 6905926077, 0, 114237863299829760], [2, 2, 2, 2]]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/Connection.php",
                        "line": 477,
                        "function": "executeStatement",
                        "class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
                        "type": "->",
                        "args": ["UPDATE \"oc_job_runs\" SET \"status\" = :dcValue1, \"duration\" = :dcValue2, \"ram_peak_usage\" = :dcValue3 WHERE \"run_id\" = :dcValue4", {
                                "dcValue1": 3,
                                "dcValue2": 6905926077,
                                "dcValue3": 0,
                                "dcValue4": 114237863299829760
                            }, {
                                "dcValue1": 2,
                                "dcValue2": 2,
                                "dcValue3": 2,
                                "dcValue4": 2
                            }
                        ]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/ConnectionAdapter.php",
                        "line": 77,
                        "function": "executeStatement",
                        "class": "OC\\DB\\Connection",
                        "type": "->",
                        "args": ["UPDATE \"oc_job_runs\" SET \"status\" = :dcValue1, \"duration\" = :dcValue2, \"ram_peak_usage\" = :dcValue3 WHERE \"run_id\" = :dcValue4", {
                                "dcValue1": 3,
                                "dcValue2": 6905926077,
                                "dcValue3": 0,
                                "dcValue4": 114237863299829760
                            }, {
                                "dcValue1": 2,
                                "dcValue2": 2,
                                "dcValue3": 2,
                                "dcValue4": 2
                            }
                        ]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                        "line": 280,
                        "function": "executeStatement",
                        "class": "OC\\DB\\ConnectionAdapter",
                        "type": "->",
                        "args": ["UPDATE `*PREFIX*job_runs` SET `status` = :dcValue1, `duration` = :dcValue2, `ram_peak_usage` = :dcValue3 WHERE `run_id` = :dcValue4", {
                                "dcValue1": 3,
                                "dcValue2": 6905926077,
                                "dcValue3": 0,
                                "dcValue4": 114237863299829760
                            }, {
                                "dcValue1": 2,
                                "dcValue2": 2,
                                "dcValue3": 2,
                                "dcValue4": 2
                            }
                        ]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/lib/private/BackgroundJob/JobRuns.php",
                        "line": 60,
                        "function": "executeStatement",
                        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                        "type": "->",
                        "args": []
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                        "line": 60,
                        "function": "finished",
                        "class": "OC\\BackgroundJob\\JobRuns",
                        "type": "->",
                        "args": [114237863299829760, 6905926077, 0, {
                                "__class__": "OCP\\BackgroundJob\\JobStatus",
                                "name": "CRASHED",
                                "value": 3
                            }
                        ]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                        "line": 39,
                        "function": "reapCrashedJobs",
                        "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                        "type": "->",
                        "args": []
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/Job.php",
                        "line": 51,
                        "function": "run",
                        "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                        "type": "->",
                        "args": [null]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                        "line": 87,
                        "function": "start",
                        "class": "OCP\\BackgroundJob\\Job",
                        "type": "->",
                        "args": [{
                                "__class__": "OC\\BackgroundJob\\JobList"
                            }
                        ]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                        "line": 204,
                        "function": "start",
                        "class": "OCP\\BackgroundJob\\TimedJob",
                        "type": "->",
                        "args": [{
                                "__class__": "OC\\BackgroundJob\\JobList"
                            }
                        ]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                        "line": 107,
                        "function": "runCli",
                        "class": "OC\\Core\\Service\\CronService",
                        "type": "->",
                        "args": ["cron", null]
                    }, {
                        "file": "/pool/var/www/nextcloud/nextcloud/cron.php",
                        "line": 52,
                        "function": "run",
                        "class": "OC\\Core\\Service\\CronService",
                        "type": "->",
                        "args": [null]
                    }
                ],
                "File": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
                "Line": 24,
                "Previous": {
                    "Exception": "PDOException",
                    "Message": "SQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value \"6905926077\" is out of range for type integer\nCONTEXT:  unnamed portal parameter $2 = '...'",
                    "Code": "22003",
                    "Trace": [{
                            "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                            "line": 130,
                            "function": "execute",
                            "class": "PDOStatement",
                            "type": "->",
                            "args": [null]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php",
                            "line": 69,
                            "function": "execute",
                            "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
                            "type": "->",
                            "args": [null]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/Middleware/ConnectionActivityStatement.php",
                            "line": 26,
                            "function": "execute",
                            "class": "Doctrine\\DBAL\\Driver\\Middleware\\AbstractStatementMiddleware",
                            "type": "->",
                            "args": [null]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connection.php",
                            "line": 1212,
                            "function": "execute",
                            "class": "OC\\DB\\Middleware\\ConnectionActivityStatement",
                            "type": "->",
                            "args": []
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
                            "line": 292,
                            "function": "executeStatement",
                            "class": "Doctrine\\DBAL\\Connection",
                            "type": "->",
                            "args": ["UPDATE \"oc_job_runs\" SET \"status\" = ?, \"duration\" = ?, \"ram_peak_usage\" = ? WHERE \"run_id\" = ?", [3, 6905926077, 0, 114237863299829760], [2, 2, 2, 2]]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/Connection.php",
                            "line": 477,
                            "function": "executeStatement",
                            "class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
                            "type": "->",
                            "args": ["UPDATE \"oc_job_runs\" SET \"status\" = :dcValue1, \"duration\" = :dcValue2, \"ram_peak_usage\" = :dcValue3 WHERE \"run_id\" = :dcValue4", {
                                    "dcValue1": 3,
                                    "dcValue2": 6905926077,
                                    "dcValue3": 0,
                                    "dcValue4": 114237863299829760
                                }, {
                                    "dcValue1": 2,
                                    "dcValue2": 2,
                                    "dcValue3": 2,
                                    "dcValue4": 2
                                }
                            ]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/ConnectionAdapter.php",
                            "line": 77,
                            "function": "executeStatement",
                            "class": "OC\\DB\\Connection",
                            "type": "->",
                            "args": ["UPDATE \"oc_job_runs\" SET \"status\" = :dcValue1, \"duration\" = :dcValue2, \"ram_peak_usage\" = :dcValue3 WHERE \"run_id\" = :dcValue4", {
                                    "dcValue1": 3,
                                    "dcValue2": 6905926077,
                                    "dcValue3": 0,
                                    "dcValue4": 114237863299829760
                                }, {
                                    "dcValue1": 2,
                                    "dcValue2": 2,
                                    "dcValue3": 2,
                                    "dcValue4": 2
                                }
                            ]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
                            "line": 280,
                            "function": "executeStatement",
                            "class": "OC\\DB\\ConnectionAdapter",
                            "type": "->",
                            "args": ["UPDATE `*PREFIX*job_runs` SET `status` = :dcValue1, `duration` = :dcValue2, `ram_peak_usage` = :dcValue3 WHERE `run_id` = :dcValue4", {
                                    "dcValue1": 3,
                                    "dcValue2": 6905926077,
                                    "dcValue3": 0,
                                    "dcValue4": 114237863299829760
                                }, {
                                    "dcValue1": 2,
                                    "dcValue2": 2,
                                    "dcValue3": 2,
                                    "dcValue4": 2
                                }
                            ]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/lib/private/BackgroundJob/JobRuns.php",
                            "line": 60,
                            "function": "executeStatement",
                            "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                            "type": "->",
                            "args": []
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                            "line": 60,
                            "function": "finished",
                            "class": "OC\\BackgroundJob\\JobRuns",
                            "type": "->",
                            "args": [114237863299829760, 6905926077, 0, {
                                    "__class__": "OCP\\BackgroundJob\\JobStatus",
                                    "name": "CRASHED",
                                    "value": 3
                                }
                            ]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/core/BackgroundJobs/CleanupBackgroundJobsJob.php",
                            "line": 39,
                            "function": "reapCrashedJobs",
                            "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                            "type": "->",
                            "args": []
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/Job.php",
                            "line": 51,
                            "function": "run",
                            "class": "OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob",
                            "type": "->",
                            "args": [null]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/lib/public/BackgroundJob/TimedJob.php",
                            "line": 87,
                            "function": "start",
                            "class": "OCP\\BackgroundJob\\Job",
                            "type": "->",
                            "args": [{
                                    "__class__": "OC\\BackgroundJob\\JobList"
                                }
                            ]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                            "line": 204,
                            "function": "start",
                            "class": "OCP\\BackgroundJob\\TimedJob",
                            "type": "->",
                            "args": [{
                                    "__class__": "OC\\BackgroundJob\\JobList"
                                }
                            ]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/core/Service/CronService.php",
                            "line": 107,
                            "function": "runCli",
                            "class": "OC\\Core\\Service\\CronService",
                            "type": "->",
                            "args": ["cron", null]
                        }, {
                            "file": "/pool/var/www/nextcloud/nextcloud/cron.php",
                            "line": 52,
                            "function": "run",
                            "class": "OC\\Core\\Service\\CronService",
                            "type": "->",
                            "args": [null]
                        }
                    ],
                    "File": "/pool/var/www/nextcloud/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                    "Line": 130
                }
            }
        },
        "message": "Error while running background job OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob (id: 114236626399580160, arguments: null)",
        "CustomMessage": "Error while running background job OC\\Core\\BackgroundJobs\\CleanupBackgroundJobsJob (id: 114236626399580160, arguments: null)"
    }
}

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!):

$ php occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "enable_previews": "true",
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Movie"
        ],
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "35.0.2.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": 3,
        "logdateformat": "F d, Y H:i:s",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "theme": "",
        "default_phone_region": "US",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "data-fingerprint": "***REMOVED SENSITIVE VALUE***"
    }
}

Apps

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

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Additional Symptoms:

You may see log entries from the Postgresql Server reporting SQL Query errors:

Oct 23 17:55:01 **REDACTED** postgres[24216]: [7-1] 2026-10-23 17:55:01.089 EDT [24216] ERROR:  value "6917625841" is out of range for type integer
Oct 23 17:55:01 **REDACTED** postgres[24216]: [7-2] 2026-10-23 17:55:01.089 EDT [24216] CONTEXT:  unnamed portal parameter $2 = '...'
Oct 23 17:55:01 **REDACTED** postgres[24216]: [7-3] 2026-10-23 17:55:01.089 EDT [24216] STATEMENT:  UPDATE "oc_job_runs" SET "status" = $1, "duration" = $2, "ram_peak_usage" = $3 WHERE "run_id" = $4

If you have access to the database server, and have the appropriate permissions, you can connect and delete the job manually.

  1. Connect to the database server.
  2. Find the offending job.

Context:

It seems that past jobs are stored in a table called nextcloud.oc_job_runs. They get created whenever a new job is created in nextcloud.oc_jobs to ensure consistency. Once the jobs have completed, the nextcloud.oc_job_runs table is updated to reflect the finished status.

Nextcloud Job Runs

nextcloud=# \d+ nextcloud.oc_job_runs
                                          Table "nextcloud.oc_job_runs"
     Column     |   Type   | Collation | Nullable | Default | Storage | Compression | Stats target | Description
----------------+----------+-----------+----------+---------+---------+-------------+--------------+-------------
 run_id         | bigint   |           | not null |         | plain   |             |              |
 class_id       | bigint   |           | not null |         | plain   |             |              |
 pid            | integer  |           | not null |         | plain   |             |              |
 status         | smallint |           | not null |         | plain   |             |              |
 duration       | integer  |           | not null | 0       | plain   |             |              |
 ram_peak_usage | integer  |           | not null | 0       | plain   |             |              |
Indexes:
    "oc_job_runs_pkey" PRIMARY KEY, btree (run_id)
    "status" btree (status)
Not-null constraints:
    "oc_job_runs_run_id_not_null" NOT NULL "run_id"
    "oc_job_runs_class_id_not_null" NOT NULL "class_id"
    "oc_job_runs_pid_not_null" NOT NULL "pid"
    "oc_job_runs_status_not_null" NOT NULL "status"
    "oc_job_runs_duration_not_null" NOT NULL "duration"
    "oc_job_runs_ram_peak_usage_not_null" NOT NULL "ram_peak_usage"
Access method: heap

nextcloud=# SELECT * FROM nextcloud.oc_job_runs WHERE run_id = 114237863299829760;
       run_id       |      class_id      |  pid  | status | duration | ram_peak_usage
--------------------+--------------------+-------+--------+----------+----------------
 114237863299829760 | 114237863241109504 | 87315 |      0 |        0 |              0
(1 row)

Nextcloud Jobs

nextcloud=# \d+ nextcloud.oc_jobs
                                                             Table "nextcloud.oc_jobs"
       Column       |          Type          | Collation | Nullable |         Default         | Storage  | Compression | Stats target | Description
--------------------+------------------------+-----------+----------+-------------------------+----------+-------------+--------------+-------------
 id                 | bigint                 |           | not null |                         | plain    |             |              |
 class              | character varying(255) |           | not null | ''::character varying   | extended |             |              |
 argument           | text                   |           | not null | ''::character varying   | extended |             |              |
 last_run           | integer                |           |          | 0                       | plain    |             |              |
 last_checked       | integer                |           |          | 0                       | plain    |             |              |
 reserved_at        | integer                |           |          | 0                       | plain    |             |              |
 execution_duration | integer                |           |          | 0                       | plain    |             |              |
 argument_hash      | character varying(64)  |           |          | NULL::character varying | extended |             |              |
 time_sensitive     | smallint               |           | not null | 1                       | plain    |             |              |
Indexes:
    "oc_jobs_pkey" PRIMARY KEY, btree (id)
    "job_argument_hash" btree (class, argument_hash)
    "job_class_index" btree (class)
    "job_lastcheck_reserved" btree (last_checked, reserved_at)
    "jobs_time_sensitive" btree (time_sensitive)
Not-null constraints:
    "oc_jobs_id_not_null" NOT NULL "id"
    "oc_jobs_class_not_null" NOT NULL "class"
    "oc_jobs_argument_not_null" NOT NULL "argument"
    "oc_jobs_time_sensitive_not_null" NOT NULL "time_sensitive"
Access method: heap

nextcloud=# SELECT * FROM nextcloud.oc_jobs WHERE id = 114236626399580160;
         id         |                      class                      | argument |  last_run  | last_checked | reserved_at | execution_duration |                          argument_hash
--------------------+-------------------------------------------------+----------+------------+--------------+-------------+--------------------+-----------------------------------------
 114236626399580160 | OC\Core\BackgroundJobs\CleanupBackgroundJobsJob | null     | 1792788601 |   1792792201 |           0 |                  0 | 74234e98afe7498fb5daf1f36ac2d78acc339464
(1 row)

Attempting to delete the job from nextcloud.oc_job_runs failed (no matching record):

nextcloud=# DELETE FROM nextcloud.oc_job_runs WHERE run_id = 114236626399580160;
DELETE 0

You can verify the job exists though:

nextcloud=# SELECT * FROM nextcloud.oc_jobs WHERE id = 114236626399580160;
         id         |                      class                      | argument |  last_run  | last_checked | reserved_at | execution_duration |                          argument_hash                           | time_sensitive
--------------------+-------------------------------------------------+----------+------------+--------------+-------------+--------------------+------------------------------------------------------------------+----------------
 114236626399580160 | OC\Core\BackgroundJobs\CleanupBackgroundJobsJob | null     | 1792792501 |   1792796101 |           0 |                  0 | 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b |              1
(1 row)

…and of course, delete it:

nextcloud=# DELETE FROM nextcloud.oc_jobs WHERE id = 114236626399580160;
DELETE 1

…and the job is gone:

nextcloud=# SELECT * FROM nextcloud.oc_jobs WHERE id = 114236626399580160;
 id | class | argument | last_run | last_checked | reserved_at | execution_duration | argument_hash | time_sensitive
----+-------+----------+----------+--------------+-------------+--------------------+---------------+----------------
(0 rows)