RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1336507 - virt-who doesn't handle quoted strings
Summary: virt-who doesn't handle quoted strings
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: pre-dev-freeze
: ---
Assignee: Radek Novacek
QA Contact: Eko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-16 16:45 UTC by Paul Armstrong
Modified: 2016-12-01 00:36 UTC (History)
5 users (show)

Fixed In Version: virt-who-0.17-3.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2016-11-04 05:08:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2387 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2016-11-03 13:53:39 UTC

Description Paul Armstrong 2016-05-16 16:45:23 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1. configure IdM client
ipa-client-install

2. configure integrated login
katello-installer --foreman-ipa-authentication=true

3. configure virt-who on Satellite using the following:

yum -y install virt-who

cat << EOF > /etc/virt-who.d/satellite.conf
[vmware]
type=esx
server=vsphere.parmstro.redhat.com
username=root
encrypted_password=deleted
owner=RedHatCanada
env=Library
hypervisor_id=hostnamerhsm_username="admin"
rhsm_encrypted_password=deleted
rhsm_hostname=sat6.parmstro.redhat.com
rhsm_prefix=/rhsm
EOF

systemctl restart virt-who

4. run one-shot with debug
virt-who -o -d -c /etc/virt-who.d/satellite.conf

Actual results:
repeated 5 x...

2016-05-16 12:32:40,259 DEBUG: Authenticating with RHSM username "admin"
2016-05-16 12:32:40,363 DEBUG: Checking if server has capability 'hypervisor_async'
2016-05-16 12:32:40,464 DEBUG: Server does not have 'hypervisors_async' capability
2016-05-16 12:32:40,464 INFO: Sending update in hosts-to-guests mapping: {
    "esx551.parmstro.redhat.com": [
        {
            "guestId": "564d97cc-ee21-b868-74f1-094f10c722a3", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }
    ], 
    "esx552.parmstro.redhat.com": [
        {
            "guestId": "422d472f-6a2c-0061-e89e-4340c5a2661d", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }, 
        {
            "guestId": "422db9e2-4ac4-5945-27e4-9ef657e39731", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }
    ]
}
2016-05-16 12:32:40,499 ERROR: Communication with server failed:
Traceback (most recent call last):
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 167, in hypervisorCheckIn
    result = self.connection.hypervisorCheckIn(config.owner, config.env, serialized_mapping)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 903, in hypervisorCheckIn
    res = self.conn.request_post(url, host_guest_mapping)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 647, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 564, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 617, in validateResponse
    handler=handler)
RemoteServerException: Server error attempting a POST to /rhsm/hypervisors?owner=RedHatCanada&env=Library returned status 500
2016-05-16 12:32:40,499 ERROR: Unable to send data: Communication with subscription manager failed with code 500: Server error attempting a POST to /rhsm/hypervisors?owner=RedHatCanada&env=Library returned status 500
2016-05-16 12:32:40,500 ERROR: Sending data failed 5 times, report skipped
2016-05-16 12:32:40,500 DEBUG: Association for config vmware gathered
2016-05-16 12:32:41,501 DEBUG: virt-who shut down started


Expected results:
update succeeds

Additional info:
From /var/log/foreman/production.log
2016-05-16 12:32:40 [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#hypervisors_update as JSON
2016-05-16 12:32:40 [I]   Parameters: {"esx551.parmstro.redhat.com"=>[{"guestId"=>"564d97cc-ee21-b868-74f1-094f10c722a3", "state"=>1, "attributes"=>{"active"=>1, "virtWhoType"=>"esx", "hypervisorType"=>"vmware"}}], "esx552.parmstro.redhat.com"=>[{"guestId"=>"422d472f-6a2c-0061-e89e-4340c5a2661d", "state"=>5, "attributes"=>{"active"=>0, "virtWhoType"=>"esx", "hypervisorType"=>"vmware"}}, {"guestId"=>"422db9e2-4ac4-5945-27e4-9ef657e39731", "state"=>1, "attributes"=>{"active"=>1, "virtWhoType"=>"esx", "hypervisorType"=>"vmware"}}], "owner"=>"RedHatCanada", "env"=>"Library"}
2016-05-16 12:32:40 [I] invalid user
[ WARN 2016-05-16 12:32:40 cp_proxy  #28400] SSO failed
2016-05-16 12:32:40 [I]   Rendered api/v2/errors/unauthorized.json.rabl within api/v2/layouts/error_layout (0.5ms)
[ERROR 2016-05-16 12:32:40 cp_proxy  #28400] *** ERROR: Access denied (403) ***
[ERROR 2016-05-16 12:32:40 cp_proxy  #28400] REQUEST URL: /rhsm/hypervisors?owner=RedHatCanada&env=Library
[ERROR 2016-05-16 12:32:40 cp_proxy  #28400] Katello::HttpErrors::Forbidden: Access denied
 | /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.85/app/controllers/katello/api/rhsm
...
...
...

Comment 1 Paul Armstrong 2016-05-16 16:59:05 UTC
Component is wrong, should not be API. Just checked API usage with basic auth and works fine.

Comment 2 Paul Armstrong 2016-05-30 14:36:20 UTC
Latest info from /var/log/foreman/production.log

Definitely failing because virt-who process is not passing SSO. This is then a configuration issue after SSO is enabled...


2016-05-30 10:27:53 [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#server_status as JSON
2016-05-30 10:27:53 [I] Completed 200 OK in 218ms (Views: 0.4ms | ActiveRecord: 0.0ms)
2016-05-30 10:27:53 [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#server_status as JSON
2016-05-30 10:27:53 [I] Completed 200 OK in 74ms (Views: 0.4ms | ActiveRecord: 0.0ms)
2016-05-30 10:27:53 [I] Processing by Katello::Api::Rhsm::CandlepinProxiesController#hypervisors_update as JSON
2016-05-30 10:27:53 [I]   Parameters: {"rhev3.parmstro.redhat.com"=>[], "rhev2.parmstro.redhat.com"=>[{"guestId"=>"db0d1a95-3238-43d9-9b64-d79b03c816da", "state"=>1, "attributes"=>{"active"=>1, "virtWhoType"=>"rhevm", "hypervisorType"=>"qemu"}}], "rhev4.parmstro.redhat.com"=>[{"guestId"=>"2afbd589-f6c4-4800-9ec9-501059c77403", "state"=>1, "attributes"=>{"active"=>1, "virtWhoType"=>"rhevm", "hypervisorType"=>"qemu"}}], "rhev1.parmstro.redhat.com"=>[], "owner"=>"RedHatCanada", "env"=>"Library"}
2016-05-30 10:27:53 [I] invalid user
[ WARN 2016-05-30 10:27:53 cp_proxy  #6260] SSO failed
2016-05-30 10:27:53 [I]   Rendered api/v2/errors/unauthorized.json.rabl within api/v2/layouts/error_layout (0.5ms)
[ERROR 2016-05-30 10:27:53 cp_proxy  #6260] *** ERROR: Access denied (403) ***
[ERROR 2016-05-30 10:27:53 cp_proxy  #6260] REQUEST URL: /rhsm/hypervisors?owner=RedHatCanada&env=Library
[ERROR 2016-05-30 10:27:53 cp_proxy  #6260] Katello::HttpErrors::Forbidden: Access denied
 | /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.85/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:278:in `deny_access'
 | /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.85/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:458:in `authorize_client_or_admin'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:522:in `block (5 levels) in _run__1918499828023245448__process_action__3783961781045914592__callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_12016'
 | /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.85/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:39:in `repackage_message'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_12016'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:517:in `block (4 levels) in _run__1918499828023245448__process_action__3783961781045914592__callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_12015'
 | /usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_12015'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:494:in `block (3 levels) in _run__1918499828023245448__process_action__3783961781045914592__callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_12014'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_3883'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_12014'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:482:in `block (2 levels) in _run__1918499828023245448__process_action__3783961781045914592__callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_12013'
 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_12013'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:426:in `block in _run__1918499828023245448__process_action__3783961781045914592__callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_12012'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:310:in `_callback_around_13'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_12012'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__1918499828023245448__process_action__3783961781045914592__callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.85/app/controllers/katello/concerns/api/api_controller.rb:59:in `process_action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in `dispatch'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in `block in action'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
 | /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
 | /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
 | /opt/rh/ruby193/root/usr/share/gems/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.2.5/lib/apipie/extractor/recorder.rb:97:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/apipie-rails-0.2.5/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/conditionalget.rb:35:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
 | /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__2176254542193086730__call__2600234932565403436__callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.85/lib/katello/middleware/silenced_logger.rb:29:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/builder.rb:134:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:64:in `block in call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `each'
 | /opt/rh/ruby193/root/usr/share/gems/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `call'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
 | /usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
 | /opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `call'
 | /opt/rh/ruby193/root/usr/share/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
2016-05-30 10:27:53 [I] Completed 500 Internal Server Error in 13ms
2016-05-30 10:27:53 [F] 
AbstractController::DoubleRenderError (Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return".):
  lib/middleware/catch_json_parse_errors.rb:9:in `call'
  app/controllers/api/v2/base_controller.rb:151:in `disable_json_root'
  app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

Comment 3 Paul Armstrong 2016-05-30 14:38:09 UTC
Please note, this does not allow me to register *any* hypervisors, therefore attach *any* subs to virtual guests.

Comment 4 Paul Armstrong 2016-06-07 03:32:46 UTC
Ok. I'm an blind and stupid. I really needed to make this work, so went digging deeper. It turns out to be something unexpected.

rhsm_username="admin"

changing it to

rhsm_username=admin

fixes the issue and all is fine. That does bring up the point that perhaps the quotes should be ignored. Then again I am just happy that it is working and not something more major. This now goes in the virt-who bucket.

Comment 5 Bryan Kearney 2016-06-10 15:31:22 UTC
Paul, does this mean we can close this?

Comment 6 Paul Armstrong 2016-06-13 12:24:57 UTC
We should move this to virt-who. This is still a problem. 

virt-who should handle quotes.

Comment 8 Radek Novacek 2016-06-23 14:37:28 UTC
Ability to handle quoted config values is now implemented upstream:

https://github.com/virt-who/virt-who/commit/d0a7be6e66dbd835a5d586d8b742df6cc453f913

Comment 9 Radek Novacek 2016-06-23 14:41:23 UTC
Fixed in virt-who-0.17-3.el7.

Comment 11 Liushihui 2016-09-08 06:56:36 UTC
Verified it on virt-who-0.17-10.el7.noarch  since virt-who can handle quotes noramlly. Therefore, verify it.

Verified version:
virt-who-0.17-10.el7.noarch 
subscription-manager-1.17.11-1.el7.x86_64 
python-rhsm-1.17.7-1.el7.x86_64

Verified process:
1. Register system to stage candlepin.
2. Configure virt-who run at esx mode with quoted config values as the following:
[root@hp-z220-06 virt-who.d]# cat /etc/virt-who.d/esx 
['esx']
type="esx"
server='10.73.2.95'
username="administrator"
password='Welcome1!'
owner='7985933'
env='7985933'
encrypted_password='c1f318df5970650c7eb5f97cf14884a9'
rhsm_username='virt-who-test'
rhsm_encrypted_password="b6f7c80ee12b4a7f805b33c5ceabe254"
hypervisor_id="hostname"
3. Restart virt-who and check virt-who's log
[root@hp-z220-06 virt-who.d]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log
2016-09-08 02:51:33,430 [virtwho.main DEBUG] MainProcess(16276):MainThread @executor.py:terminate:303 - virt-who is shutting down
2016-09-08 02:51:33,462 [virtwho.'esx' DEBUG] Esx-1(16283):MainThread @virt.py:run:389 - Virt backend ''esx'' terminated
2016-09-08 02:51:34,433 [virtwho.main DEBUG] MainProcess(16276):MainThread @__main__.py:main:19 - virt-who terminated
2016-09-08 02:51:34,553 [virtwho.init DEBUG] MainProcess(16334):MainThread @executor.py:__init__:65 - Using config named ''esx''
2016-09-08 02:51:34,553 [virtwho.init INFO] MainProcess(16334):MainThread @main.py:main:160 - Using configuration "'esx'" ("esx" mode)
2016-09-08 02:51:34,553 [virtwho.init INFO] MainProcess(16334):MainThread @main.py:main:162 - Using reporter_id='hp-z220-06.qe.lab.eng.nay.redhat.com-8d1c9031b64f48e0beccba0614a92ee7'
2016-09-08 02:51:34,555 [virtwho.main DEBUG] MainProcess(16334):MainThread @executor.py:run:171 - Starting infinite loop with 60 seconds interval
2016-09-08 02:51:34,584 [virtwho.'esx' DEBUG] Esx-1(16341):MainThread @virt.py:run:364 - Virt backend ''esx'' started
2016-09-08 02:51:34,585 [virtwho.'esx' DEBUG] Esx-1(16341):MainThread @esx.py:_prepare:128 - Log into ESX
2016-09-08 02:51:34,807 [virtwho.'esx' DEBUG] Esx-1(16341):MainThread @esx.py:_prepare:131 - Creating ESX event filter
2016-09-08 02:51:34,888 [virtwho.'esx' DEBUG] Esx-1(16341):MainThread @virt.py:enqueue:357 - Report for config "'esx'" gathered, putting to queue for sending
2016-09-08 02:51:34,900 [virtwho.main DEBUG] MainProcess(16334):MainThread @subscriptionmanager.py:_connect:120 - Authenticating with RHSM username virt-who-test
2016-09-08 02:51:36,347 [virtwho.main DEBUG] MainProcess(16334):MainThread @subscriptionmanager.py:hypervisorCheckIn:172 - Checking if server has capability 'hypervisor_async'
2016-09-08 02:51:37,769 [virtwho.main DEBUG] MainProcess(16334):MainThread @subscriptionmanager.py:hypervisorCheckIn:184 - Server does not have 'hypervisors_async' capability
2016-09-08 02:51:37,769 [virtwho.main INFO] MainProcess(16334):MainThread @subscriptionmanager.py:hypervisorCheckIn:195 - Sending update in hosts-to-guests mapping for config "'esx'": 1 hypervisors and 2 guests found
2016-09-08 02:51:37,769 [virtwho.main DEBUG] MainProcess(16334):MainThread @subscriptionmanager.py:hypervisorCheckIn:196 - Host-to-guest mapping: {
    "bootp-73-5-201.rhts.eng.pek2.redhat.com": [
        {
            "guestId": "4206ee69-f83e-c97f-521f-4af794d5cde9", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }
        }, 
        {
            "guestId": "42067ff0-8098-f4a4-8c53-826adb0e7b84", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }
        }
    ]
}
2016-09-08 02:51:39,618 [virtwho.main DEBUG] MainProcess(16334):MainThread @executor.py:send_report:101 - Report for config "'esx'" sent


Result:
Virt-who can handle single quotes and double quotes normally, it can send mapping info to server successfully.

Comment 13 errata-xmlrpc 2016-11-04 05:08:56 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://rhn.redhat.com/errata/RHBA-2016-2387.html


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