Bug 1419639

Summary: pcs metadata xml encoding issues
Product: [Fedora] Fedora Reporter: Oyvind Albrigtsen <oalbrigt>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: 25CC: anprice, cfeist, idevat, jpokorny, tojeline
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.9.156-1.fc24 pcs-0.9.156-1.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-03 21:18:14 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:
Attachments:
Description Flags
proposed fix none

Description Oyvind Albrigtsen 2017-02-06 15:53:54 UTC
Description of problem:
pcs resource list, pcs resource describe/create AoEtarget fails due to encoding="UTF-8" XML-tag.

Version-Release number of selected component (if applicable):
pcs-0.9.154-2.fc25.x86_64
resource-agents-3.9.7-5.fc25.x86_64

How reproducible:
100% of the time

Steps to Reproduce:
1. Run "pcs resource list" or "pcs resource describe AoEtarget"
2.
3.

Actual results:
# pcs resource list
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.154', 'console_scripts', 'pcs')()
  File "/usr/lib/python3.5/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python3.5/site-packages/pcs/resource.py", line 46, in resource_cmd
    resource_list_available(argv)
  File "/usr/lib/python3.5/site-packages/pcs/resource.py", line 283, in resource_list_available
    utils.cmd_runner(), full_res_name
  File "/usr/lib/python3.5/site-packages/pcs/lib/resource_agent.py", line 323, in get_resource_agent_metadata
    return _get_ocf_resource_agent_metadata(runner, *agent_info[1:])
  File "/usr/lib/python3.5/site-packages/pcs/lib/resource_agent.py", line 231, in _get_ocf_resource_agent_metadata
    return etree.fromstring(stdout)
  File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:79010)
  File "src/lxml/parser.pxi", line 1843, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:118282)
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.

# pcs resource describe AoEtarget
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.154', 'console_scripts', 'pcs')()
  File "/usr/lib/python3.5/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python3.5/site-packages/pcs/resource.py", line 49, in resource_cmd
    resource_list_options(argv[0])
  File "/usr/lib/python3.5/site-packages/pcs/resource.py", line 422, in resource_list_options
    descriptions, parameters, actions = get_desc_params(agent)
  File "/usr/lib/python3.5/site-packages/pcs/resource.py", line 391, in get_desc_params
    runner, agent_name
  File "/usr/lib/python3.5/site-packages/pcs/lib/resource_agent.py", line 323, in get_resource_agent_metadata
    return _get_ocf_resource_agent_metadata(runner, *agent_info[1:])
  File "/usr/lib/python3.5/site-packages/pcs/lib/resource_agent.py", line 231, in _get_ocf_resource_agent_metadata
    return etree.fromstring(stdout)
  File "src/lxml/lxml.etree.pyx", line 3213, in lxml.etree.fromstring (src/lxml/lxml.etree.c:79010)
  File "src/lxml/parser.pxi", line 1843, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:118282)
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.


Expected results:
pcs resource list and describe works.

Additional info:
Removing " encoding="UTF-8"" from the first line of metadata for AoEtarget fixes the issue:
<?xml version="1.0" encoding="UTF-8"?>

Comment 1 Tomas Jelinek 2017-02-07 15:21:55 UTC
Created attachment 1248431 [details]
proposed fix

Comment 2 Fedora Update System 2017-02-22 14:45:11 UTC
pcs-0.9.156-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-11b7c94278

Comment 3 Fedora Update System 2017-02-22 14:45:20 UTC
pcs-0.9.156-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-45e09f6147

Comment 4 Fedora Update System 2017-02-23 22:22:33 UTC
pcs-0.9.156-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-45e09f6147

Comment 5 Fedora Update System 2017-02-23 23:20:42 UTC
pcs-0.9.156-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-11b7c94278

Comment 6 Fedora Update System 2017-03-03 21:18:14 UTC
pcs-0.9.156-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2017-03-03 21:49:33 UTC
pcs-0.9.156-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.