Bug 1670460 - fence_rhevm is limited to ASCII content only, throwing stack-trace on UTF-8 characters
Summary: fence_rhevm is limited to ASCII content only, throwing stack-trace on UTF-8 c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: fence-agents
Version: 7.6
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1712263 1716704
TreeView+ depends on / blocked
 
Reported: 2019-01-29 15:10 UTC by Andreas Bleischwitz
Modified: 2019-08-06 12:35 UTC (History)
8 users (show)

Fixed In Version: fence-agents-4.2.1-21.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1712263 (view as bug list)
Environment:
Last Closed: 2019-08-06 12:34:23 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3869731 None None None 2019-01-29 15:15:31 UTC
Red Hat Product Errata RHSA-2019:2037 None None None 2019-08-06 12:35:15 UTC

Description Andreas Bleischwitz 2019-01-29 15:10:29 UTC
Description of problem:
When using "fence_rhevm" for fencing of virtual machines in RHV, neither the "Comment", nor the "Description" field of said vm must contain non ASCII-characters

Version-Release number of selected component (if applicable):
fence-agents-rhevm-4.2.1-11.el7_6.1.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create VM "test" in RHV, Comment = "ÄÖÜ"
2. Invoke fence_rhevm -o status ... test
3.

Actual results:
Stack-trace:
Traceback (most recent call last):
  File "/usr/sbin/fence_rhevm_old", line 200, in <module>
    main()
  File "/usr/sbin/fence_rhevm_old", line 195, in main
    result = fence_action(None, options, set_power_status, get_power_status, get_list)
  File "/usr/share/fence/fencing.py", line 884, in fence_action
    status = get_multi_power_fn(connection, options, get_power_fn)
  File "/usr/share/fence/fencing.py", line 752, in get_multi_power_fn
    plug_status = get_power_fn(connection, options)
  File "/usr/sbin/fence_rhevm_old", line 19, in get_power_status
    res = send_command(options, "vms/?search=name%3D" + options["--plug"])
  File "/usr/sbin/fence_rhevm_old", line 131, in send_command
    result = web_buffer.getvalue().decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2459: ordinal not in range(128)


Expected results:
Status: ON|OFF

Additional info:

Comment 2 Andreas Bleischwitz 2019-01-29 15:15:32 UTC
There is a pull request which at least solves the status issue, there still seem to be an issue when using "-v" and non ASCII-characters:

# fence_rhevm -o status -v --ssl --ssl-insecure -a <rhev-ip> --username <user@domain> --password=<password> --disable-http-filter --ipport 443 -n <vm-name>

2019-01-29 16:08:15,198 DEBUG: vms/?search=name%3Dtest

Traceback (most recent call last):
  File "/usr/sbin/fence_rhevm", line 202, in <module>
    main()
  File "/usr/sbin/fence_rhevm", line 197, in main
    result = fence_action(None, options, set_power_status, get_power_status, get_list)
  File "/usr/share/fence/fencing.py", line 884, in fence_action
    status = get_multi_power_fn(connection, options, get_power_fn)
  File "/usr/share/fence/fencing.py", line 752, in get_multi_power_fn
    plug_status = get_power_fn(connection, options)
  File "/usr/sbin/fence_rhevm", line 19, in get_power_status
    res = send_command(options, "vms/?search=name%3D" + options["--plug"])
  File "/usr/sbin/fence_rhevm", line 136, in send_command
    logging.debug("%s\n", result)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1619, in debug
    root.debug(msg, *args, **kwargs)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1137, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1268, in _log
    self.handle(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1278, in handle
    self.callHandlers(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1318, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 749, in handle
    self.emit(record)
  File "/usr/share/fence/fencing.py", line 1074, in emit
    syslog.syslog(syslog_level, msg.replace("\x00", "\n"))
TypeError: [priority,] message string

Comment 3 Sandro 2019-01-30 08:57:47 UTC
Info: PR got merged

Comment 5 Sandro 2019-02-13 12:40:57 UTC
Is there a plan when this will get packaged and shipped to the rhn channels ?

Comment 6 Chris Feist 2019-02-13 20:50:54 UTC
Sandro,

Unfortunately we don't have an exact date as to when this will be available in Red Hat, however, if you contact your Red Hat support team they can escalate the request and help us to prioritize to get this fix out sooner.

Thanks,
Chris

Comment 21 Doran Moppert 2019-06-04 01:07:37 UTC
This issue was assigned CVE-2019-10153:  bug 1716286.

Comment 23 errata-xmlrpc 2019-08-06 12:34:23 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-2019:2037


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