kolla_set_configs --check fails for non-unicode files

Bug #1913952 reported by Radosław Piliszek on 2021-01-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Status tracked in Wallaby
Train
Medium
Unassigned
Ussuri
Medium
Unassigned
Victoria
Medium
Unassigned
Wallaby
Medium
Radosław Piliszek

Bug Description

Non-unicode files (especially binary ones) might trigger Unicode decoding errors when trying to compare file contents.

Example failure:

'Traceback (most recent call last):\n File "/tmp/ansible_kolla_docker_payload_4lbmc5u7/ansible_kolla_docker_payload.zip/ansible/modules/kolla_docker.py", line 1176, in main\n File "/tmp/ansible_kolla_docker_payload_4lbmc5u7/ansible_kolla_docker_payload.zip/ansible/modules/kolla_docker.py", line 338, in compare_container\n File "/tmp/ansible_kolla_docker_payload_4lbmc5u7/ansible_kolla_docker_payload.zip/ansible/modules/kolla_docker.py", line 603, in compare_config\nException: Failed to compare container configuration: b\'INFO:__main__:Loading config file at /var/lib/kolla/config_files/config.json\\nINFO:__main__:Validating config file\\nERROR:__main__:Unexpected error:\\nTraceback (most recent call last):\\n File "/usr/local/bin/kolla_set_configs", line 424, in main\\n execute_config_check(config)\\n File "/usr/local/bin/kolla_set_configs", line 410, in execute_config_check\\n config_file.check()\\n File "/usr/local/bin/kolla_set_configs", line 231, in check\\n elif not self._cmp_file(source, dest):\\n File "/usr/local/bin/kolla_set_configs", line 168, in _cmp_file\\n if f1.read() != f2.read():\\n File "/usr/lib64/python3.6/codecs.py", line 321, in decode\\n (result, consumed) = self._buffer_decode(data, self.errors, final)\\nUnicodeDecodeError: \\\'utf-8\\\' codec can\\\'t decode byte 0xea in position 2: invalid continuation byte\\n\'\n'

description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers