No start of json char found
Package:
ansible
49704

Exception Class:
ValueError
Raise code
if line.startswith(u'{'):
endchar = u'}'
break
elif not objects_only and line.startswith(u'['):
endchar = u']'
break
else:
raise ValueError('No start of json char found')
# Filter trailing junk
lines = lines[start:]
for reverse_end_offset, line in enumerate(reversed(lines)):
if line.strip().endswith(endchar):
break
🙏 Scream for help to Ukraine
Today, 14th August 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too!
We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.
Links to the raise (2)
https://github.com/ansible/ansible/blob/015331518dff60f31a7d8ce24fc315e3ac9e86f8/lib/ansible/module_utils/json_utils.py#L57 https://github.com/ansible/ansible/blob/015331518dff60f31a7d8ce24fc315e3ac9e86f8/lib/ansible/modules/async_wrapper.py#L99Ways to fix
Summary: Make sure you use the symbol "{" at the beginning of the line json:
Code to reproduce (WRONG):
from ansible.module_utils.json_utils import _filter_non_json_lines
json_text = u'"key":"value"}'
filtered, warnings = _filter_non_json_lines(jsons)
print('filtered', filtered)
print('warnings', warnings)
Working version (Fixed):
from ansible.module_utils.json_utils import _filter_non_json_lines
json_text = u'{"key":"value"}' # <--- HERE IS A FIX WE ADDED "{"
filtered, warnings = _filter_non_json_lines(jsons)
print('filtered', filtered)
print('warnings', warnings)
Add a possible fix
Please authorize to post fix