Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1360964 - Failed to send h/g mapping info to satellite when set "hypervisor_id=hostname"
Summary: Failed to send h/g mapping info to satellite when set "hypervisor_id=hostname"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Subscription Management
Version: 6.2.0
Hardware: x86_64
OS: Linux
unspecified
high vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-28 03:52 UTC by Liushihui
Modified: 2018-06-15 22:08 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-24 14:19:37 UTC


Attachments (Terms of Use)
foreman-debug (deleted)
2016-08-01 02:26 UTC, Liushihui
no flags Details

Description Liushihui 2016-07-28 03:52:47 UTC
Description of problem:
When configure virt-who with "hypervisor_id=hostname", virt-who failed to send mapping info to satellite.

Version-Release number of selected component (if applicable):
virt-who-0.17-6.el7.noarch
subscription-manager-1.17.9-1.el7.x86_64
python-rhsm-1.17.5-1.el7.x86_64
katello-3.0.0-10.el6sat.noarch
candlepin-0.9.54.7-1.el6.noarch
foreman-1.11.0.49-1.el6sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Register system to satellite6
2. Configure virt-who with "hypervisor_id=hostname"
[root@hp-microservergen8-01 ~]# cat /etc/virt-who.d/virt 
[hyperv]
type=hyperv
server=10.73.5.212
username=administrator
password=Welcome1
owner=ACME_Corporation
env=Library
hypervisor_id=hostname
3. Restart virt-who and check virt-who's log
[root@hp-microservergen8-01 ~]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log
2016-07-27 23:50:42,091 [virtwho.main INFO] MainProcess(54788):MainThread @subscriptionmanager.py:hypervisorCheckIn:194 - Sending update in hosts-to-guests mapping for config "hyperv": 1 hypervisors and 3 guests found
2016-07-27 23:50:42,091 [virtwho.main DEBUG] MainProcess(54788):MainThread @subscriptionmanager.py:hypervisorCheckIn:195 - Host-to-guest mapping: {
    "hyperv_02": [
        {
            "guestId": "C877953C-A19E-5149-B614-D97873C4CBD2", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "hyperv"
            }
        }, 
        {
            "guestId": "8329390B-8359-F646-9176-27D738580E81", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "hyperv"
            }
        }, 
        {
            "guestId": "EB2C30F2-A847-3749-9828-20EBFB664490", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "hyperv"
            }
        }
    ]
}
2016-07-27 23:50:43,664 [virtwho.main ERROR] MainProcess(54788):MainThread @executor.py:send:143 - Unable to send data: Communication with subscription manager failed with code 500: Task 32f0e8f4-2f19-4360-9452-bfb5f28b2cc8: ActiveRecord::RecordInvalid: Validation failed: Name is invalid, Name is invalid


Actual results:
Failed to send host/guest mapping info to satellite as "Name is invalid"

Expected results:
Virt-who should send host/guest mapping info to satellite successfully

Additional info:

Comment 1 Radek Novacek 2016-07-28 07:03:04 UTC
It seems that the name is failing some validation check higher in the stack:

ActiveRecord::RecordInvalid: Validation failed: Name is invalid, Name is invalid

Reassigning this bug to candlepin. Can you please check why is the name considered invalid?

Comment 2 Brad Buckingham 2016-07-29 15:43:22 UTC
Can you attach the foreman-debug so that we can see the full stack trace? Thanks!

Comment 3 Liushihui 2016-08-01 02:26:03 UTC
Created attachment 1186224 [details]
foreman-debug

Comment 4 Liushihui 2016-08-01 02:26:16 UTC
Please see foreman-debug result in attachment

Comment 5 Brad Buckingham 2016-08-01 12:58:04 UTC
From the production.log:

2016-07-31 22:01:14 [app] [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#hypervisors_update as JSON
2016-07-31 22:01:14 [app] [I]   Parameters: {"hyperv_02"=>[{"guestId"=>"C877953C-A19E-5149-B614-D97873C4CBD2", "state"=>5, "attributes"=>{"active"=>0, "virtWhoType"=>"hyperv"}}, {"guestId"=>"8329390B-8359-F646-9176-27D738580E81", "state"=>5, "attributes"=>{"active"=>0, "virtWhoType"=>"hyperv"}}, {"guestId"=>"EB2C30F2-A847-3749-9828-20EBFB664490", "state"=>5, "attributes"=>{"active"=>0, "virtWhoType"=>"hyperv"}}], "owner"=>"ACME_Corporation", "env"=>"Library"}
2016-07-31 22:01:15 [foreman-tasks/action] [E] Validation failed: Name is invalid, Name is invalid (ActiveRecord::RecordInvalid)
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'

Comment 10 jcallaha 2018-04-24 14:19:37 UTC
This bug was fixed as part of #1353110


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