After update to v.34.0.1, cron.php: CleanupBackgroundJobsJob reports "ps: cmd: keyword not found"

After updating to v.34.0.1, cron.php started reporting the following:

ps: cmd: keyword not found
ps: no valid keywords; valid keywords:

cron.php seems to be completing, so these don’t seem to be fatal errors.

Today, the pertinent output excerpt from cron.php, run with the --verbose flag, was:

Starting job OC\Core\BackgroundJobs\CleanupBackgroundJobsJob (id:
100550618071846912, arguments: null)
ps: cmd: keyword not found
ps: no valid keywords; valid keywords:
ps: cmd: keyword not found
ps: no valid keywords; valid keywords:
ps: cmd: keyword not found
ps: no valid keywords; valid keywords:
ps: cmd: keyword not found
ps: no valid keywords; valid keywords:
ps: cmd: keyword not found
ps: no valid keywords; valid keywords:
Job OC\Core\BackgroundJobs\CleanupBackgroundJobsJob (id:
100550618071846912, arguments: null) done in 0.27 seconds
  • I’ve scheduled cron.php to run twice every hour. This happens in about 50% of the runs.
  • The instances that don’t produce these messages don’t report that CleanupBackgroundJobsJob has run, so cron.php apparently does not always run this job.
  • The number of times the two lines occur in the output has increased incrementally since they first started appearing. Initially they occurred once, now they occur five times.

What’s going on here?

Hi,

I am facing the same problem.

What I have found so far:

The problem are different implementations of the command “ps” on Linux and FreeBSD. My Nextcloud instance runs on FreeBSD, the “ps”-command there does not have an format option (-o) “cmd”. Instead it has a format option “command”.

“ps” on a Ubuntu Linux has the format option “cmd”.

Secondly “CleanupBackgroundJobsJob” is new in 34.0.1, it does not exists in the 33.0.6 Backup.

So I think there needs to be a distinction implemented in CleanupBackgroundJobsJob to respect different “ps” implementations.

Quick and dirty fix: Replace “cmd” with “command” in CleanupBackgroundJobsJob.php should work (not tested here).

I hope this helps.

Best regards

Sven

There’s work on this to have a better handling for that job.

@sei77 thanks!

My Nextcloud is also running on FreeBSD. I’ll report the issue.

Bug report: Background job cleanup fails on BSD/macOS; also `background_jobs_expiration_days` is ignored · Issue #61635 · nextcloud/server · GitHub

No need, if you check, there’s already an issue and PR for that exactly :slight_smile: