Bug 1685619 - swift write() error when downloading container
Summary: swift write() error when downloading container
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-common
Version: 15.0 (Stein)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Upstream M3
: 15.0 (Stein)
Assignee: Emilien Macchi
QA Contact: Sasha Smolyak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-05 16:45 UTC by Damien Ciabrini
Modified: 2019-09-26 10:48 UTC (History)
7 users (show)

Fixed In Version: openstack-tripleo-common-10.4.1-0.20190313060345.1377727.el8ost
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-21 11:20:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 641361 0 None None None 2019-03-06 13:57:59 UTC
OpenStack gerrit 641703 0 None None None 2019-03-07 15:58:18 UTC
Red Hat Product Errata RHEA-2019:2811 0 None None None 2019-09-21 11:20:55 UTC

Description Damien Ciabrini 2019-03-05 16:45:45 UTC
Description of problem:
When trying to deploy an OSP15 overcloud, mistral get data from swift, and breaks due to the way python3 interprets the data:

_id=033badf6-7ab3-4478-ae68-969ed531e3ec, action_cls='<class 'mistral.actions.action_factory.DownloadConfigAction'>', attributes='{}', params='{'work_dir': '/var/lib/mistral/overcloud', 'container_config': 'overcloud-config'}']
 write() argument must be str, not bytes: TypeError: write() argument must be str, not bytes
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor Traceback (most recent call last):
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor   File "/usr/lib/python3.6/site-packages/mistral/executors/default_executor.py", line 114, in run_action
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor     result = action.run(action_ctx)
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor   File "/usr/lib/python3.6/site-packages/tripleo_common/actions/config.py", line 124, in run
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor     self.work_dir)
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor   File "/usr/lib/python3.6/site-packages/tripleo_common/utils/swift.py", line 93, in download_container
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor     f.write(contents)
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor TypeError: write() argument must be str, not bytes
2019-03-02 07:14:32.715 1 ERROR mistral.executors.default_executor



Version-Release number of selected component (if applicable):
had-04.ha.lab.eng.bos.redhat.com:5000/openstack-mistral-executor:20190226.1

How reproducible:
always

Steps to Reproduce:
1. deploy an osp15 overcloud

Actual results:
mistral breaks while downloading swift data

Expected results:
shouldn't fail

Additional info:

The breakage disappears when changing the following line in tripleo_common/utils/swift.py in download_container:
            with open(path, 'wb') as f:
                f.write(contents)

Comment 1 Christian Schwede (cschwede) 2019-03-06 13:12:44 UTC
While this happens after downloading data from Swift, it doesn't look like a Swift issue to me, more like a py3 issue in tripleo-common when writing data to disk. Therefore re-assigning this BZ.

Comment 11 errata-xmlrpc 2019-09-21 11:20:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:2811


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