Remove abandoned jobs from oc_jobs table
Expected behavior
Unrequired cron jobs should be removed from the oc_jobs table.
Current behavior
After checking the list of configured cron jobs I found the following two ones, which seem to be outdated, because "last_run = 0" is displayed and similar jobs exists which are executed on a regular base. Therefore these abandoned jobs should automatically be removed.
> select * from oc_jobs where last_run = '0';
+-----+----------------------------------------------+----------+----------+--------------+-------------+--------------------+
| id | class | argument | last_run | last_checked | reserved_at | execution_duration |
+-----+----------------------------------------------+----------+----------+--------------+-------------+--------------------+
| 51 | OCA\DAV\CardDAV\Sync\SyncJob | null | 0 | 1581538516 | 0 | 0 |
| 377 | OCA\Bookmarks\Lib\BackgroundJobs\PreviewsJob | null | 0 | 1581538516 | 0 | 0 |
+-----+----------------------------------------------+----------+----------+--------------+-------------+--------------------+
The given jobs seem to have been replaced by the following ones:
- OCA\DAV\CardDAV\SyncJob
- OCA\Bookmarks\BackgroundJobs\PreviewsJob
Steps to reproduce
- Check the oc_jobs table in the database.
- Identify jobs which didn't have a last_run date set.
Environment
Server Configuration
OS: Linux 4.9.207 Web server: Apache2 2.4.41 Database: MariaDB 10.2.24 PHP version: 7.3.13 Nextcloud version: 18.0.0
Client Configuration
Browser: Mozilla Firefox 73 Operating system: Windows 10
Hello,
Once I tried to write background job. If you register job like it is described in developer manual, the entry will appear in oc_jobs once you start (or restart) the application as administrator.
So these entries are not abandoned. They are useful for debug.
I assume you once run Bookmarks (from the second entry). If you disable it, I'm not sure whether it good or bad to store it in oc_jobs.
But if your Bookmarks app is active on your server, I would check what's wrong.
@Irillit At least the CardDAV job has been renamed in the past and therefore the mentioned one is not required anymore. Due to the fact that no other app are listed twice with the same job name, I believe that it has also renamed without removing the old one.
Is this Issue still valid? If not, please close this issue. Thanks! :)
@szaimen The mentioned two jobs are still on the list of jobs which have never been executed. If someone can confirm that these jobs are no longer required or have been replaced, I would delete it manually and we can close this ticket. Unfortunately this confirmation is still missing.
cc @nextcloud/server-triage please state if the mentioned abandoned jobs are still required. Thanks!
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.