Bug 1434363 - os-collect-config.service entered failed state: No JSON object could be decoded
Summary: os-collect-config.service entered failed state: No JSON object could be decoded
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: os-collect-config
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z5
: 11.0 (Ocata)
Assignee: Lukas Bezdicka
QA Contact: Yurii Prokulevych
URL:
Whiteboard:
Depends On:
Blocks: 1394025
TreeView+ depends on / blocked
 
Reported: 2017-03-21 11:05 UTC by Yurii Prokulevych
Modified: 2018-06-22 12:31 UTC (History)
13 users (show)

Fixed In Version: os-collect-config-6.1.1-1.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-22 12:31:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 455829 0 None MERGED Don't fail on non-valid json in cache files 2020-04-13 10:07:09 UTC

Description Yurii Prokulevych 2017-03-21 11:05:41 UTC
Description of problem:
-----------------------
Service os-collect-config.service failed to start reporting next traceback:
Mar 21 10:08:41 ceph-2.localdomain systemd[1]: Started Collect metadata and run hook commands..
Mar 21 10:08:41 ceph-2.localdomain systemd[1]: Starting Collect metadata and run hook commands....
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: Traceback (most recent call last):
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/bin/os-collect-config", line 10, in <module>
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: sys.exit(__main__())
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/lib/python2.7/site-packages/os_collect_config/collect.py", line 262, in __main__
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: collector_kwargs_map=collector_kwargs_map)
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/lib/python2.7/site-packages/os_collect_config/collect.py", line 166, in collect_all
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: content = module.Collector(**collector_kwargs).collect()
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/lib/python2.7/site-packages/os_collect_config/ec2.py", line 71, in collect
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: metadata = json.load(f)
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/lib64/python2.7/json/__init__.py", line 290, in load
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: **kw)
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: return _default_decoder.decode(s)
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: raise ValueError("No JSON object could be decoded")
Mar 21 10:08:42 ceph-2.localdomain os-collect-config[3434]: ValueError: No JSON object could be decoded
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: os-collect-config.service: main process exited, code=exited, status=1/FAILURE
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: Unit os-collect-config.service entered failed state.
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: os-collect-config.service failed.
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: os-collect-config.service holdoff time over, scheduling restart.
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: start request repeated too quickly for os-collect-config.service
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: Failed to start Collect metadata and run hook commands..
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: Unit os-collect-config.service entered failed state.
Mar 21 10:08:42 ceph-2.localdomain systemd[1]: os-collect-config.service failed.

The reason was that cache file '/var/lib/os-collect-config/ec2.json' existed but was empty.
This line caused failure: 
https://github.com/openstack/os-collect-config/blob/master/os_collect_config/ec2.py#L69

Removing empty file eliminated the issue.

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
os-collect-config-6.0.0-1.el7ost.noarch

How reproducible:
-----------------
It's not reproducible with director all the times. But you can easily create a
file manually:

touch /var/lib/os-collect-config/ec2.json

Comment 1 Lukas Bezdicka 2017-04-03 12:31:17 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1438096

Comment 3 Marios Andreou 2017-04-24 11:08:26 UTC
updating trackers to point to stable/ocata review and moving POST... lbezdick is this a duplicate of BZ 1438096 that you pointed to in comment #1 ? It looks like it is to me, at least they both point to same gerrit fix and both OSP11 os-collect-config? There are also two further clones of BZ 1438096 and they are also both os-c-c osp 11 so not sure . Anyway should we close this one as duplicate?

Comment 5 Jon Schlueter 2017-11-15 01:58:47 UTC
According to our records, this should be resolved by os-collect-config-6.1.1-1.el7ost.  This build is available now.

Comment 7 Scott Lewis 2018-06-22 12:31:11 UTC
OSP11 is now retired, see details at https://access.redhat.com/errata/product/191/ver=11/rhel---7/x86_64/RHBA-2018:1828


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