Project

General

Profile

Actions

Bug #23849

closed

Current user is not set when triggering repetitions of recurring actions

Added by Adam Ruzicka over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Fixed in Releases:
Found in Releases:

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 2 (0 open2 closed)

Related to foreman-tasks - Bug #21802: Recurring tasks need to be more resilientClosedAdam Ruzicka11/29/2017Actions
Related to Foreman Remote Execution - Bug #24882: recurring jobs ignore organization context of host searchClosedActions
Actions

Also available in: Atom PDF