Project

General

Profile

Bug #24077

Uncaught exception when pulp task isnt created from dynflow step

Added by Adam Ruzicka about 1 year ago. Updated about 1 year ago.

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

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1594570

Description of problem:
When a Content Host:
- installs package (or does any other activity that triggers Actions::Katello::Host::UploadPackageProfile task)
- and promptly unregisters itself,

the UploadPackageProfile task can fail on Actions::Pulp::Consumer::GenerateApplicability step as pulp returns "Pulp consumer 8b042949-3daa-49a2-9827-21ccd982227b not found" instead of task ID for the regenerate_applicability task. This is not further handled properly by katello or foreman tasks, since:

- task itself raises uncaught exception (see below)
- sometimes the task ends up in paused/error state (this is bit tricky to reproduce)

Please improve this error handling.

Version-Release number of selected component (if applicable):
Sat6.3.1
tfm-rubygem-katello-3.4.5.64-1.el7sat.noarch
tfm-rubygem-dynflow-0.8.34-1.fm1_15.el7sat.noarch

How reproducible:
100% (the error)
20% (the stuck task)

Steps to Reproduce:
1. Register a system to Satellite, attach a subscription
2. Artificially send package profile (just for the sake of speeding up the reproducer; it is a race condition; the real use case behind involves package removal at this state, what triggers one profile upload that might repro the bug)

for i in $(seq 1 20); do katello-package-upload --force & done

3. Few seconds after that, unregister the system

4. Optionally, for reproducing also the paused/error tasks, restart foreman-tasks service few seconds after system unregistered. (this step isnt required for the uncaught exception)

5. Check tasks with error result, optionally in paused/error state/result.

Actual results:
5. There will be always error-result tasks (that's OK) with exception (that's not OK):
Error:

NoMethodError

undefined method `each' for true:TrueClass

---
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/lib/actions/pulp/abstract_async_task.rb:108:in
`external_task='"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/action/polling.rb:83:in
`initiate_external_action'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/action/polling.rb:18:in
`run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/action/cancellable.rb:13:in
`run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/lib/actions/pulp/abstract_async_task.rb:45:in
`run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/action.rb:518:in
`block (3 levels) in execute_run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/middleware/stack.rb:26:in
`pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/middleware.rb:18:in
`pass'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/middleware.rb:31:in
`run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/middleware/stack.rb:22:in
`call'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.34/lib/dynflow/middleware/stack.rb:26:in
`pass'"
..

Optionally, if you are unlucky enough, such a task is paused and hangs paused forever.

Expected results:
Provide better error text (i.e. pass the "Pulp consumer 8b042949-3daa-49a2-9827-21ccd982227b not found." error text) in the dynflow external task error text.

Ensure such task is not paused when foreman-tasks is being restarted while processing this task.

Additional info:


Related issues

Related to Katello - Bug #21797: do not log stack trace if generateapplicability generates a 404Closed2017-11-28

History

#1 Updated by Adam Ruzicka about 1 year ago

  • Related to Bug #21797: do not log stack trace if generateapplicability generates a 404 added

#2 Updated by Andrew Kofink about 1 year ago

  • Legacy Backlogs Release (now unused) set to 338

#3 Updated by Jonathon Turel about 1 year ago

  • Target version changed from Katello 3.7.0 to Katello Backlog

Also available in: Atom PDF