att-comdev / armada

This project has moved to OpenStack.
https://www.airshipit.org/
Apache License 2.0
78 stars 35 forks source link

Bug: UnicodeDecodeError because of the *.swp file #196

Closed ghost closed 6 years ago

ghost commented 6 years ago

Is this a bug report or feature request? (choose one): Bug

Python Version (output of python --version): Python 2.7.5

Development or Deployment Environment?:

Release Tag or Master:

Expected Behavior: armada apply armada-manifests/manifest.yaml This should be working.

What Actually Happened: I met a UnicodeDecodeError because of the *.swp file. 2018-03-20 03:47:30.916 35642 INFO armada.handlers.chartbuilder [-] Building dependency chart helm-toolkit for release keystone. 2018-03-20 03:47:30.960 35642 ERROR armada.cli [-] Caught internal exception: armada.exceptions.chartbuilder_exceptions.HelmChartBuildException: Failed to build Helm chart for keystone. 2018-03-20 03:47:30.960 35642 ERROR armada.cli Traceback (most recent call last): 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib/python3.6/site-packages/armada/handlers/chartbuilder.py", line 244, in get_helm_chart 2018-03-20 03:47:30.960 35642 ERROR armada.cli files=self.get_files()) 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib/python3.6/site-packages/armada/handlers/chartbuilder.py", line 170, in get_files 2018-03-20 03:47:30.960 35642 ERROR armada.cli _append_file_to_result(root, rel_folder_path, file) 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib/python3.6/site-packages/armada/handlers/chartbuilder.py", line 156, in _append_file_to_result 2018-03-20 03:47:30.960 35642 ERROR armada.cli file_contents = f.read().encode('utf-8') 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib64/python3.6/codecs.py", line 321, in decode 2018-03-20 03:47:30.960 35642 ERROR armada.cli (result, consumed) = self._buffer_decode(data, self.errors, final) 2018-03-20 03:47:30.960 35642 ERROR armada.cli UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdb in position 16: invalid continuation byte 2018-03-20 03:47:30.960 35642 ERROR armada.cli 2018-03-20 03:47:30.960 35642 ERROR armada.cli During handling of the above exception, another exception occurred: 2018-03-20 03:47:30.960 35642 ERROR armada.cli 2018-03-20 03:47:30.960 35642 ERROR armada.cli Traceback (most recent call last): 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib/python3.6/site-packages/armada/cli/__init__.py", line 40, in safe_invoke 2018-03-20 03:47:30.960 35642 ERROR armada.cli self.invoke() 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib/python3.6/site-packages/armada/cli/apply.py", line 221, in invoke 2018-03-20 03:47:30.960 35642 ERROR armada.cli resp = armada.sync() 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib/python3.6/site-packages/armada/handlers/armada.py", line 281, in sync 2018-03-20 03:47:30.960 35642 ERROR armada.cli protoc_chart = chartbuilder.get_helm_chart() 2018-03-20 03:47:30.960 35642 ERROR armada.cli File "/usr/lib/python3.6/site-packages/armada/handlers/chartbuilder.py", line 247, in get_helm_chart 2018-03-20 03:47:30.960 35642 ERROR armada.cli raise chartbuilder_exceptions.HelmChartBuildException(chart_name) 2018-03-20 03:47:30.960 35642 ERROR armada.cli armada.exceptions.chartbuilder_exceptions.HelmChartBuildException: Failed to build Helm chart for keystone. 2018-03-20 03:47:30.960 35642 ERROR armada.cli

How to Reproduce the Issue (as minimally as possible): if you have any swap file in the helm charts (in my case, it was openstack-helm keystone value.yaml swap file), it will happen.

Any Additional Comments: I want to know why it happened. I think it would be better, the file name is on the error message.

hyunsun commented 6 years ago

It would be even better if swap files could be skipped.