Bug 1792018

Summary: Virt-who is not able to upload the Hypervisor list if the manifest has content access mode as org_environment
Product: Red Hat Satellite Reporter: Rudnei Bertol Jr. <rbertolj>
Component: CandlepinAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: bcourt, csnyder, dcarmich, dwhitley, egolov, john.berninger, ktordeur, mhulan, mmccune, phess, rcavalca, saydas, wpinheir
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: candlepin-2.9.24, candlepin-2.6.15-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1792524 (view as bug list) Environment:
Last Closed: 2020-04-14 13:28:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1792524    
Bug Blocks:    
Attachments:
Description Flags
verification screenshot none

Description Rudnei Bertol Jr. 2020-01-16 21:33:12 UTC
Description of problem:

Virt-who service cannot upload the Hypervisor/Hosts collected from the Hypervisor Manager.


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

How reproducible:
Import a manifest with content access mode as 'org_environment' into the Satellite, restart the virt-who service.


Steps to Reproduce:
1. Change the Content Access Mode from the manifest to 'Organization Environment Access'
2. Create a new organization or remove the virt-who-hypervisors from the Satellite WebUI.
3. Restart the virt-who service or run the virt-who command manually.

Actual results:
The hosts collected by the virt-who are not uploaded to the Satellite, the task finish with success, however, the following error is found on the Dynflow task we can see the following error.
"""
hypervisors: []
task:
  created: '2020-01-16T17:50:49+0000'
  updated: '2020-01-16T17:50:49+0000'
  id: hypervisor_update_2abc0d22-3445-48e2-8aa1-278415afa428
  state: FAILED
  startTime: '2020-01-16T17:50:49+0000' 
  finishTime: 
  result: Could not update host/guest mapping. Auto-attach is disabled for owner ACME
    because of the content access mode setting. 
"""

Also, we can see the following error on the Candlepin logs.
"""
2020-01-16 12:50:49,623 [thread=QuartzScheduler_Worker-10] [job=hypervisor_update_2abc0d22-3445-48e2-8aa1-278415afa428, org=ACME, csid=] ERROR org.candlepin.pinsetter.tasks.HypervisorUpdateJob - HypervisorUpdateJob encountered a problem.
org.candlepin.common.exceptions.BadRequestException: Could not update host/guest mapping. Auto-attach is disabled for owner ACME because of the content access mode setting.
	at org.candlepin.pinsetter.tasks.HypervisorUpdateJob.toExecute(HypervisorUpdateJob.java:232)
	at org.candlepin.pinsetter.tasks.HypervisorUpdateJob$$EnhancerByGuice$$663b758d.CGLIB$toExecute$0(<generated>)
	at org.candlepin.pinsetter.tasks.HypervisorUpdateJob$$EnhancerByGuice$$663b758d$$FastClassByGuice$$4a8fec48.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:76)
	at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:70)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:77)
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
	at org.candlepin.pinsetter.tasks.HypervisorUpdateJob$$EnhancerByGuice$$663b758d.toExecute(<generated>)
	at org.candlepin.pinsetter.tasks.KingpinJob.execute(KingpinJob.java:114)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
"""

Expected results:

The hypervisor's hosts are created on the Satellite server.


Additional info:

Comment 8 jcallaha 2020-03-04 21:33:40 UTC
Verified in Satellite 6.7 Snap 14

Steps:
Created a new Organization
Uploaded a golden ticket manifest
Submitted a virt-who report against the organization

Results:
The report uploaded successfully
The hypervisors were added to the Satellite

See attached screenshot for verification

Comment 9 jcallaha 2020-03-04 21:35:09 UTC
Created attachment 1667585 [details]
verification screenshot

Comment 14 errata-xmlrpc 2020-04-14 13:28:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454