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

Conscience agent crash when one file watch-file is miss formatted #1497

Open
cdelgehier opened this issue Jun 16, 2018 · 0 comments
Open

Conscience agent crash when one file watch-file is miss formatted #1497

cdelgehier opened this issue Jun 16, 2018 · 0 comments

Comments

@cdelgehier
Copy link
Contributor

ISSUE TYPE
  • Bug Report
COMPONENT NAME

conscience-agent

SDS VERSION
[root@node4 /]# rpm -qa|grep sds-common
openio-sds-common-4.1.24-1.el7.oio.x86_64
CONFIGURATION
[root@node4 /]# cat /etc/oio/sds.conf.d/TESTCDE
# OpenIO managed
[TESTCDE]
# endpoints
conscience=172.17.0.3:6000
#zookeeper=
proxy=172.17.0.5:6006
event-agent=beanstalk://172.17.0.5:6014
ecd=172.17.0.5:6017
ns.meta1_digits=2
udp_allowed=yes

ns.storage_policy=THREECOPIES
ns.chunk_size=10485760
ns.service_update_policy=meta2=KEEP|3|1|;rdir=KEEP|3|1|;
OS / ENVIRONMENT
[root@node4 /]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
SUMMARY

When a watch-file is miss formatted, the conscience agent crash instead of ignoring the resource and log a warning

STEPS TO REPRODUCE

Delete a curly bracket in the first 'stat' list

[root@node4 /]# cat /etc/oio/sds/TESTCDE/watch/rawx-0.yml
# OpenIO managed
---
host: 172.17.0.5
port: 6200
type: rawx
location: node4
checks:
  - {type: http, uri: /info}
stats:
  - {type: volume, path: /mnt/sdb1/TESTCDE/rawx-0
  - {type: rawx, path: /stat}
  - {type: system}
...
EXPECTED RESULTS

The resource is ignored. A warning log entry is emit

ACTUAL RESULTS
[root@node4 /]# gridinit_cmd status TESTCDE-conscienceagent-0
KEY                       STATUS      PID GROUP
TESTCDE-conscienceagent-0 BROKEN       -1 TESTCDE,conscienceagent,0

[root@node4 /]# /usr/bin/oio-conscience-agent /etc/oio/sds/TESTCDE/conscienceagent-0/conscienceagent-0.yml
Traceback (most recent call last):
  File "/usr/bin/oio-conscience-agent", line 28, in <module>
    run_daemon(ConscienceAgent, config, **options)
  File "/usr/lib/python2.7/site-packages/oio/common/daemon.py", line 77, in run_daemon
    klass(conf).start(**kwargs)
  File "/usr/lib/python2.7/site-packages/oio/conscience/agent.py", line 205, in __init__
    self.load_services()
  File "/usr/lib/python2.7/site-packages/oio/conscience/agent.py", line 264, in load_services
    self.conf['services'][name] = parse_config(cfgfile)
  File "/usr/lib/python2.7/site-packages/oio/common/utils.py", line 297, in parse_config
    conf = yaml.load(f)
  File "/usr/lib64/python2.7/site-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib64/python2.7/site-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/lib64/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib64/python2.7/site-packages/yaml/parser.py", line 550, in parse_flow_mapping_key
    "expected ',' or '}', but got %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a flow mapping
  in "/etc/oio/sds/TESTCDE/watch/rawx-0.yml", line 10, column 5
expected ',' or '}', but got '{'
  in "/etc/oio/sds/TESTCDE/watch/rawx-0.yml", line 11, column 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants