Bug 1459807 - Apply Errata to a Content Host via incremental C.V. has to wait till Capsule sync of the C.V. finishes
Apply Errata to a Content Host via incremental C.V. has to wait till Capsule ...
Status: NEW
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Errata Management (Show other bugs)
6.2.10
x86_64 Linux
medium Severity high (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-08 04:57 EDT by Pavel Moravec
Modified: 2017-09-11 15:11 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pavel Moravec 2017-06-08 04:57:27 EDT
Description of problem:
Having a Content Host registered to a Capsule and assigned to a Content View. If one wants to apply an errata outside the C.V. current content, incremental C.V. version is created (and published via Capsule (repo) sync to the Capsule automatically). So far so good.

But when I click to "Apply Errata to Content Hosts Immediately after publishing" checkbox, BulkAction to install the errata is scheduled independently to the C.V. (repo) sync to the Capsule, and thus the attempt to install that errata to the Content Host is made before the Capsule gets synced content with the errata. And thus the errata apply fails.

This limits usage of fast patching systems registered via Capsule, in general.

The BulkAction / errata apply task simply must wait for completion of all C.V. repos synces to all Capsules. This "wait for all these tasks completions" can be weakened e.g. to check synces of Capsules that have a Content Host we apply the errata to, only.

Or maybe even better: move the BulkAction from the current place to the end of Actions::Katello::ContentView::CapsuleGenerateAndSync - for the relevant hosts of given Capsule only, of course.


Version-Release number of selected component (if applicable):
Sat 6.2.9


How reproducible:
100%


Steps to Reproduce:
1. Create & publish (& promote) a C.V. with some bigger repo (e.g. RHEL7 base one) with exclude filter to purge away an errata (I used "skip any errata released after 01-01-2017).
2. Have a Content Host registered via an external Capsule and associated to the Content View.
3. Find some errata from the repo that isnt in the Content View (in my case, it was RHSA-2017:1365). Try to apply it to this Content Host and check on the "Apply Errata to Content Hosts Immediately after publishing" (cf. with docs [1]).
4. Wait untill the task finishes.
5. Check if the errata was applied to the Content Host and check the Host's /var/log/messages


[1] https://access.redhat.com/documentation/en-us/red_hat_satellite/6.2/html/host_configuration_guide/sect-red_hat_satellite-host_configuration_guide-viewing_and_applying_errata-applying_errata_to_content_hosts

Actual results:
5. Errata apply fails, /var/log/messages contain something like:

Jun  8 10:43:34 pmoravec-rhel72 goferd: [INFO][worker-0] gofer.rmi.dispatcher:603 - call: Content.install() sn=154d65fa-835c-4e10-9ff5-aee076c29ec1 data={u'task_id': u'67a79b8e-910e-4e8d-b587-1cb980e617ff', u'consumer_id': u'248666cd-a06e-4bf4-8314-8f0e988af579'}
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 - handler failed
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 - Traceback (most recent call last):
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 -   File "/usr/lib/python2.7/site-packages/pulp/agent/lib/dispatcher.py", line 61, in install
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 -     _report = handler.install(conduit, units, dict(options))
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 -   File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/rpm.py", line 100, in install
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 -     details = pkg.install(names)
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 -   File "/usr/lib/python2.7/site-packages/pulp_rpm/handlers/rpmtools.py", line 158, in install
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 -     raise caught
Jun  8 10:43:37 pmoravec-rhel72 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:65 - InstallError: 0:nss-3.28.4-1.2.el7_3.x86_64: No package(s) available to install

(if one compares timestamps when Actions::Katello::ContentView::CapsuleGenerateAndSync was finished and when Actions::Katello::Host::Erratum::ApplicableErrataInstall was started, then Capsule sync is finished after Errata install is started - and thats the wrong)


Expected results:
5. Errata is applied, no error in /var/log/messages on the client, Errata task is triggered after Capsule sync finishes.


Additional info:
It would be worth testing this BZ against a "mixed" hosts: i.e. apply an errata to 6 hosts where:
- one is registered to Sat and in Default C.V.
- one is registered to Sat and in non-default C.V.
- one is registered to a Caps in Default C.V.
- one is registered to a Caps in non-default C.V.
- one is registered to another Caps in Default C.V.
- one is registered to the other Caps in non-default (even different from above) C.V.

just to see foreman tasks are scheduled in really good ordering in any use case.

Note You need to log in before you can comment on or make changes to this bug.