Unable to add resource in pcs | redhat cluster

Issues related to applications and software problems
Post Reply
Asjad
Posts: 1
Joined: 2020/05/12 09:59:56

Unable to add resource in pcs | redhat cluster

Post by Asjad » 2020/05/12 10:05:56

Hello,
I am using centos 7.8 and below packages.

python-2.7.5-88.el7.x86_64
pacemaker-1.1.21-4.el7.x86_64
fence-agents-all-4.2.1-30.el7.x86_64
corosync-2.4.5-4.el7.x86_64

I am trying to a add resource in my pcs cluster but it gives me below python error.

[root@zabbixcore1 ~]# pcs resource create zabbix_server systemd:zabbix-server op monitor interval=10s
Traceback (most recent call last):
File "/usr/sbin/pcs", line 9, in <module>
load_entry_point('pcs==0.9.168', 'console_scripts', 'pcs')()
File "/usr/lib/python2.7/site-packages/pcs/app.py", line 296, in main
cmd_map[command](argv)
File "/usr/lib/python2.7/site-packages/pcs/resource.py", line 89, in resource_cmd
resource_create(lib, argv_next, modifiers)
File "/usr/lib/python2.7/site-packages/pcs/resource.py", line 488, in resource_create
**settings
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 19, in run
return next_in_line(env, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/pcs/cli/common/middleware.py", line 42, in apply
result_of_next = next_in_line(env, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/pcs/cli/common/middleware.py", line 68, in apply
result_of_next = 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/resource.py", line 247, in create
use_default_operations,
File "/usr/lib/python2.7/site-packages/pcs/lib/cib/resource/primitive.py", line 101, in create
force=allow_invalid_instance_attributes,
File "/usr/lib/python2.7/site-packages/pcs/lib/cib/resource/primitive.py", line 213, in validate_resource_instance_attributes_create
resource_agent, instance_attributes, resources_section, force=force
File "/usr/lib/python2.7/site-packages/pcs/lib/cib/resource/primitive.py", line 175, in validate_unique_instance_attributes
resources_section, resource_agent
File "/usr/lib/python2.7/site-packages/pcs/lib/cib/resource/primitive.py", line 45, in find_primitives_by_agent
_provider=" and @provider='{}'".format(provider) if provider else "",
File "lxml.etree.pyx", line 1477, in lxml.etree._Element.xpath (src/lxml/lxml.etree.c:46714)
File "xpath.pxi", line 310, in lxml.etree.XPathElementEvaluator.__call__ (src/lxml/lxml.etree.c:133059)
File "apihelpers.pxi", line 1335, in lxml.etree._utf8 (src/lxml/lxml.etree.c:24625)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters
[root@zabbixcore1 ~]#

ethaniel
Posts: 1
Joined: 2021/11/11 21:55:14

Re: Unable to add resource in pcs | redhat cluster

Post by ethaniel » 2021/11/11 21:56:00

This one is easy. You copied this command (pcs resource create zabbix_server systemd:zabbix-server op monitor interval=10s) from some website, which replaces the "-" character with a different one. It's not visible to the human eye, but the system thinks it's not correct.
Type in the dash manually and you'll be fine:

Code: Select all

pcs resource create zabbix_server systemd:zabbix-server op monitor interval=10s

Post Reply