overcloud deploy fails with TypeError

Bug #1915368 reported by Rabi Mishra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
In Progress
High
Rabi Mishra

Bug Description

We now archive the user environment files to the archive from heat files map. Files like shell scripts (used with 'get_file' in templates) are stored as bytestrings.

traceback:

  2021-02-11 03:29:17.681 249869 INFO tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] DEBUG - reloc_path /tmp/tripleoclient-0gw37l35/tripleo-heat-templates/user-environments/overcloud-baremetal-deployed.yaml:
  2021-02-11 03:29:17.682 249869 INFO tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] DEBUG - fullpath {"parameter_defaults": {"ComputeCount": 1, "ComputeHostnameFormat": "compute-%index%", "ControllerCount": 1, "ControllerHostnameFormat": "controller-%index%", "DeployedServerPortMap": {"compute-0-ctlplane": {"fixed_ips": [{"ip_address": "192.168.26.26"}]}, "controller-0-ctlplane": {"fixed_ips": [{"ip_address": "192.168.25.24"}]}}, "HostnameMap": {"compute-0": "compute-0", "controller-0": "controller-0"}}, "resource_registry": {"OS::TripleO::DeployedServer::ControlPlanePort": "file:///usr/share/openstack-tripleo-heat-templates/deployed-server/deployed-neutron-port.yaml"}}:
  2021-02-11 03:29:17.682 249869 INFO tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] DEBUG - reloc_path /tmp/tripleoclient-0gw37l35/tripleo-heat-templates/user-environments/pyshim.sh:
  2021-02-11 03:29:17.683 249869 INFO tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] DEBUG - fullpath b'#!/bin/bash\n# Copyright 2018 Red Hat Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the "License"); you may\n# not use this file except in compliance
with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n#\n# Usage: pyshim.sh <script and/or arguments>\n#\n# Unfortunately THT doesn\'t know which version of python might be in a\n# container so we need this script to be able to try python3 or python2\n# depending on availability. Since this is a temporary shim until we\'ve\n# fully cut over to python3, we check for the existence of python3 first\n# before falling back to python2. This will help in the transition from\n# python2 based containers to python3.\n\nshow_usage() {\n echo "Usage: pyshim.sh <script and/or arguments>"\n}\n\nif [ $# -lt 1 ]\nthen\n show_usage\n exit 1\nfi\n\nset -x\nif command -v python3 >/dev/null; then\n python3 "$@"\nelif command -v python2 >/dev/null; then\n python2 "$@"\nelif command -v python >/dev/null; then\n python "$@"\nelse\n echo "ERROR: python is not available!"\n exit 1\nfi\n':
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud [-] Exception occured while running the command: TypeError: write() argument must be str, not bytes
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud Traceback (most recent call last):
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/tripleoclient/command.py", line 34, in run
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud super(Command, self).run(parsed_args)
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/osc_lib/command/command.py", line 39, in run
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud return super(Command, self).run(parsed_args)
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/cliff/command.py", line 185, in run
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud return_code = self.take_action(parsed_args) or 0
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_deploy.py", line 965, in take_action
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud self._deploy_tripleo_heat_templates_tmpdir(stack, parsed_args)
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_deploy.py", line 303, in _deploy_tripleo_heat_templates_tmpdir
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud new_tht_root, tht_root)
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_deploy.py", line 381, in _deploy_tripleo_heat_templates
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud self._copy_env_files(env_files, tht_root)
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_deploy.py", line 444, in _copy_env_files
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud utils.safe_write(reloc_path, files_dict[fullpath])
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud File "/usr/lib/python3.6/site-packages/tripleoclient/utils.py", line 2409, in safe_write
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud f.write(data)
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud TypeError: write() argument must be str, not bytes
  2021-02-11 03:29:29.285 249869 ERROR tripleoclient.v1.overcloud_deploy.DeployOvercloud
  2021-02-11 03:29:29.294 249869 ERROR openstack [-] write() argument must be str, not bytes
  2021-02-11 03:29:29.301 249869 INFO osc_lib.shell [-] END return value: 1

Revision history for this message
Rabi Mishra (rabi) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 16.0.0

This issue was fixed in the openstack/python-tripleoclient 16.0.0 release.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.