Project

General

Profile

Bug #30670

foreman-rake reports:daily runs all reports twice

Added by Gerald Vogt over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Reporting
Target version:
-
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Since the update to katello 3.16 from 3.15 I have noticed that all daily reports from the rake reports:daily cron job are generated twice. For instance, I get two "Configuration Management Summary Reports". The first one contains the "Summary from 1 day ago to now", the second one immediately following contains "Summary from less than a minute ago to now".

If I run the cronjob manually, i.e. as user foreman:

$ RAILS_ENV=production FOREMAN_HOME=/usr/share/foreman /usr/sbin/foreman-rake reports:daily

the same happens.

See also here https://community.theforeman.org/t/rake-reports-daily-runs-reports-twice/20074


Related issues

Copied to Katello - Bug #31418: foreman-rake reports:daily runs all reports twiceClosed

Associated revisions

Revision 2987de10 (diff)
Added by Marek Hulán over 2 years ago

Fixes #30670 - start dynflow client in report tasks

As reported, a single foreman-rake reports:daily in fact triggers the
rake task twice. This is caused by plugins that need to extend this (and
similar tasks) with their own logic and add other rake tasks
dependencies. For that they need to `load` our core tasks, causing the
duplication. `load` should be avoided entirely.

In this specific case though, the need was to add dynflow:client
dependecy to reports, since Katello plugin may schedule some dynflow
job as part of that. Therefore it needs client connection to dynflow.
This task does not start the executor.

Instead of asking all plugins to add such dependency if their custom
mail notification requires dynflow client, the Foreman core should offer
this by default.

The real fix needs to land in Katello, it should no longer load the core
task definition, however in order for that to be possible, this PR needs
to be merged first.

What was tried:
  • modify the Katello in a way requiring the task does not cause
    duplicity
  • clearing the task after it's loaded - this helps but may have other
    consequences and does not solve the issue for other plugins

Revision dbe3104c (diff)
Added by Marek Hulán over 2 years ago

Refs #30670 - dynflow client depends on environment

History

#1 Updated by Dominik Matoulek over 2 years ago

  • Assignee set to Dominik Matoulek

#2 Updated by Gerald Vogt over 2 years ago

  • Found in Releases 2.2.1 added

I have noticed the "Remove orphans" task which is running once a week always get into paused state. Checking the tasks view it also seems to be running twice at the same time. One of those tasks succeeds while the other gets paused eventually.

#3 Updated by Marek Hulán over 2 years ago

  • Copied to Bug #31418: foreman-rake reports:daily runs all reports twice added

#4 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8165 added

#5 Updated by The Foreman Bot over 2 years ago

  • Fixed in Releases 2.4.0 added

#6 Updated by Marek Hulán over 2 years ago

  • Status changed from Ready For Testing to Closed

#7 Updated by The Foreman Bot over 2 years ago

  • Pull request https://github.com/theforeman/foreman/pull/8174 added

Also available in: Atom PDF