Project

General

Profile

Bug #15114

Katello's late initialization causes issues when resuming dynflow tasks

Added by Ivan Necas about 3 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

It was introduced in this commit https://github.com/Katello/katello/commit/d637aa2b48ea02b3b73efbd8168eab9629be8afe#diff-cf74e596d7887011413ee9d06b16b753R198

It seems it was introduced after changes in the assets pipeline. The problem is we need to resume tasks, that are pending execution once the foreman-tasks executor starts and after_initialize is the last instance we can hook in in the load process to start the execution. Since the katello's plugin initializes itself in after_initialize as well, we occasionally hit issues such as pulp logger being not initialized yet by that time.

Action: Actions::Pulp::Repository::Sync

RuntimeError: Trying to use logger katello/pulp_rest which has not been configured.

---
- "/usr/share/foreman/lib/foreman/logging.rb:54:in `logger'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.1.0/app/services/katello/pulp/server.rb:14:in
  `config'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.1.0/config/initializers/runcible.rb:3:in
  `pulp_server'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.1.0/app/lib/actions/pulp/abstract.rb:13:in
  `pulp_resources'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.1.0/app/lib/actions/pulp/repository/sync.rb:34:in
  `invoke_external_task'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/action/polling.rb:83:in
  `initiate_external_action'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/action/polling.rb:18:in
  `run'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/action/cancellable.rb:9:in
  `run'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.1.0/app/lib/actions/pulp/abstract_async_task.rb:45:in
  `run'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/action.rb:506:in
  `block (3 levels) in execute_run'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/middleware/stack.rb:26:in
  `call'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/middleware/stack.rb:26:in
  `pass'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/middleware.rb:17:in
  `pass'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/middleware.rb:30:in
  `run'" 
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/middleware/stack.rb:22:in
  `call'" 

Related issues

Blocks foreman-tasks - Bug #15055: Task fails with "undefined method `cp_config' for"Closed2016-05-16

Associated revisions

Revision 28cb3ef5 (diff)
Added by Ivan Necas almost 3 years ago

Fixes #15114 - initialize Katello plugin sooner (#6059)

Initializing the Katello plugin too late causes issues when resuming
Dynflow tasks (for example the loggers not being initialized)

Foreman recommends before :finisher_hook as alternative hook to be used

https://github.com/theforeman/foreman/blob/1.11.0/config/initializers/assets_paths.rb#L17

Blocks https://github.com/theforeman/foreman-tasks/pull/185

History

#1 Updated by Ivan Necas about 3 years ago

  • Blocks Bug #15055: Task fails with "undefined method `cp_config' for" added

#2 Updated by The Foreman Bot about 3 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ivan Necas
  • Pull request https://github.com/Katello/katello/pull/6059 added

#3 Updated by Eric Helms almost 3 years ago

  • Legacy Backlogs Release (now unused) set to 86

#4 Updated by Ivan Necas almost 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Eric Helms almost 3 years ago

  • Legacy Backlogs Release (now unused) changed from 86 to 143

#6 Updated by Eric Helms almost 3 years ago

  • Legacy Backlogs Release (now unused) changed from 143 to 168

Also available in: Atom PDF