Skip to content

[Bug]: background-job:list lists several time the same job #35993

@MCMic

Description

@MCMic

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

When using occ command background-job:list, if there are several jobs with the same job class, they appear as duplicates of the last one instead of being listed correctly.

This comes from the joblist reusing the same object through OC::$server->get for each line with the same class.

Either new objects need to be used (or clones), or the getJobs method may be changed to return an generator, so that several job may share the same object without causing this bug.

It is not clear if it is expected for buildJob to reuse a job instance and if it may cause problems in other parts of the code or not.

Steps to reproduce

  1. run occ background-job:list in a case where several jobs are planned with the same class (at least OCA\DAV\BackgroundJob\RefreshWebcalJob and OCA\Recognize\BackgroundJobs\StorageCrawlJob are concerned)
  2. The list contains duplicated lines with the same id and argument instead of the correct data

Expected behavior

Each job should be listed with its own id and argument.

Installation method

Other Community project

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

Enabled:
  - activity: 2.17.0
  - calendar: 4.2.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.0.2
  - contactsinteraction: 1.6.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_automatedtagging: 1.15.0
  - files_external: 1.17.0
  - files_pdfviewer: 2.6.0
  - files_retention: 1.14.1
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - flow_notifications: 1.5.0
  - forms: 3.0.3
  - holiday_calendars: 0.2.1
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - maps: 0.2.4
  - news: 20.0.0
  - nextcloud_announcements: 1.14.0
  - notes: 4.6.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recognize: 3.3.4
  - related_resources: 1.0.3
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - support: 1.8.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - uppush: 1.1.3
  - user_ldap: 1.15.0
  - user_migration: 2.0.1
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflow_kitinerary: 1.0.3
  - workflow_script: 1.10.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - apporder: 0.15.0
  - bruteforcesettings
  - dashboard: 7.1.0
  - encryption
  - files_texteditor: 2.15.0
  - recommendations: 1.1.0
  - suspicious_login
  - twofactor_totp
  - updatenotification: 1.3.0
  - user_external: 3.1.0

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

Metadata

Metadata

Assignees

Labels

25-feedback4. to releaseReady to be released and/or waiting for tests to finishbug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions