Project

General

Profile

Bug #23849

Current user is not set when triggering repetitions of recurring actions

Added by Adam Ruzicka almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:

Description

They fail with undefined method id for nil, this is caused by two factors.

1) We rely on User.current always being set in here1

2) By moving the repetition triggering to a hook, it now runs outside of scope of the KeepCurrentUser middleware and therefore the current user is unset.

[1] - https://github.com/theforeman/foreman_remote_execution/commit/cbca3763dfcf5657bc459a2a3bc629c5beaa3c6c#diff-14632ff95ad9bcb6357ed1b5ae94ed50R197

For people googling for the error, the issue can be identified by the following line in logs:

Failed to run hook 'trigger_repeat' for action 'Actions::RemoteExecution::RunHostsJob'

Related issues

Related to foreman-tasks - Bug #21802: Recurring tasks need to be more resilientClosed2017-11-29
Related to Foreman Remote Execution - Bug #24882: recurring jobs ignore organization context of host searchClosed

Associated revisions

Revision eaaecb68 (diff)
Added by Adam Ruzicka almost 3 years ago

Fixes #23849 - Restore current user+taxonomies when running hooks

History

#1 Updated by Adam Ruzicka almost 3 years ago

  • Category deleted (Foreman)
  • Subject changed from Recurring REX jobs fail to trigger repetitions to Current user is not set when triggering repetitions of recurring actions
  • Project changed from Foreman Remote Execution to foreman-tasks

#2 Updated by The Foreman Bot almost 3 years ago

  • Assignee set to Adam Ruzicka
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-tasks/pull/345 added

#3 Updated by Adam Ruzicka almost 3 years ago

  • Pull request https://github.com/Dynflow/dynflow/pull/286 added

#4 Updated by Ivan Necas almost 3 years ago

  • Description updated (diff)

#5 Updated by Ivan Necas almost 3 years ago

  • Related to Bug #21802: Recurring tasks need to be more resilient added

#6 Updated by Ivan Necas almost 3 years ago

This is a regression from #21802

#7 Updated by Ivan Necas almost 3 years ago

  • Bugzilla link set to 1589082

#8 Updated by Ivan Necas almost 3 years ago

  • Status changed from Ready For Testing to Closed

#9 Updated by Daniel Lobato Garcia almost 3 years ago

  • Legacy Backlogs Release (now unused) set to 353

#10 Updated by Daniel Lobato Garcia almost 3 years ago

  • Legacy Backlogs Release (now unused) deleted (353)

#11 Updated by Adam Ruzicka over 2 years ago

  • Related to Bug #24882: recurring jobs ignore organization context of host search added

Also available in: Atom PDF