Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcs stonith list: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 222: ordinal not in range(128) #151

Closed
brianjmurrell opened this issue Oct 16, 2017 · 3 comments

Comments

@brianjmurrell
Copy link

When parsing the output of a fence agent's metadata, where that metadata contains non-ascii characters such as ® for example, pcs stonith list fence_... produces:

Traceback (most recent call last):
  File "/usr/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.158', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 191, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/stonith.py", line 43, in stonith_cmd
    stonith_list_available(lib, argv_next, modifiers)
  File "/usr/lib/python2.7/site-packages/pcs/stonith.py", line 120, in stonith_list_available
    agent_list = lib.stonith_agent.list_agents(modifiers["describe"], search)
  File "/usr/lib/python2.7/site-packages/pcs/cli/common/lib_wrapper.py", line 97, in decorated_run
    return run_with_middleware(run, cli_env, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pcs/cli/common/middleware.py", line 20, in run
    return next_in_line(env, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pcs/cli/common/lib_wrapper.py", line 87, in run
    lib_call_result = run_library_command(lib_env, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pcs/lib/commands/stonith_agent.py", line 25, in list_agents
    resource_agent.StonithAgent
  File "/usr/lib/python2.7/site-packages/pcs/lib/commands/resource_agent.py", line 95, in _complete_agent_list
    agent_list.append(agent_metadata.get_description_info())
  File "/usr/lib/python2.7/site-packages/pcs/lib/resource_agent.py", line 398, in get_description_info
    agent_info["shortdesc"] = self.get_shortdesc()
  File "/usr/lib/python2.7/site-packages/pcs/lib/resource_agent.py", line 420, in get_shortdesc
    self._get_metadata().find("shortdesc")
  File "/usr/lib/python2.7/site-packages/pcs/lib/resource_agent.py", line 596, in _get_metadata
    self._metadata = self._parse_metadata(self._load_metadata())
  File "/usr/lib/python2.7/site-packages/pcs/lib/resource_agent.py", line 716, in _load_metadata
    "PATH": env_path,
  File "/usr/lib/python2.7/site-packages/pcs/lib/external.py", line 436, in run
    out_err=out_err
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 222: ordinal not in range(128)
@tomjelinek
Copy link
Member

I believe this has been fixed in 52ea51c. Can you try it with the latest pcs?

@brianjmurrell
Copy link
Author

I'm working in a RHEL environment and thus using the pcs package(s) supplied by RHEL 7.4. I will file a bug upstream with them to have 52ea51c backported to RHEL 7.4.

@tomjelinek
Copy link
Member

52ea51c is not a sufficient fix. Fixed in 66a5672.

hi-a pushed a commit to hi-a/trinityX that referenced this issue Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants