empty hieradata override files results in DeploymentError that does not clearly state the problem

Bug #1810436 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Low
Alex Schultz

Bug Description

If the hieradata override file is empty, the deployment will fail with an error about it not being in the correct format because we attempt to convert it to yaml. We should do an empty check so we can more specifically tell the user what needs to be corrected.

rendering j2 template to file: /home/stack/tripleo-heat-installer-templates/./puppet/services/container-image-prepare.yaml
/etc/keystone file is Absent.
Unsupported data format in hieradata override /home/stack/hiera_override.yaml
Exception: Unsupported data format in hieradata override /home/stack/hiera_override.yaml
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py", line 1074, in _standalone_deploy
    parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py", line 673, in _deploy_tripleo_heat_templates
    environments = self._setup_heat_environments(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py", line 638, in _setup_heat_environments
    parsed_args.standalone_role))
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/tripleo_deploy.py", line 974, in _process_hieradata_overrides
    raise exceptions.DeploymentError(msg)
DeploymentError: Unsupported data format in hieradata override /home/stack/hiera_override.yaml
None
Install artifact is located at /home/stack/undercloud-install-20181212121415.tar.bzip2

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Deployment Failed!

ERROR: Heat log files: /var/log/heat-launcher/undercloud_deploy-6W6qSB

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Deployment failed.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

An error has occured while deploying the Undercloud.

See the previous output for details about what went wrong.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Command '['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', '--standalone-role', 'Undercloud', '--stack', 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--heat-native', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/docker.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/undercloud.yaml', '-e', '/home/stack/containers-prepare-parameter.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/masquerade-networks.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/ironic.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/ironic-inspector.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/mistral.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/zaqar-swift-backend.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/tripleo-ui.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/tempest.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-haproxy.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/services/undercloud-keepalived.yaml', '--public-virtual-ip', '192.168.24.2', '--control-virtual-ip', '192.168.24.3', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/ss[stack@undercloud-0 ~]$ cat /home/stack/hiera_override.yaml
[stack@undercloud-0 ~]$

summary: - empty hieradata override files results in DeploymentError
+ empty hieradata override files results in DeploymentError that does not
+ clearly state the problem
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/628267

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.openstack.org/628267
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=8ddcc2cd145451335a90b6816c8110c65dc73998
Submitter: Zuul
Branch: master

commit 8ddcc2cd145451335a90b6816c8110c65dc73998
Author: Alex Schultz <email address hidden>
Date: Thu Jan 3 12:06:36 2019 -0700

    Improve error message around hieradata override file

    If the file specified is empty, we currently throw a generic message
    about it not being in the correct format. Let's add a check to make sure
    the file is not empty before attempting to parse it as yaml.

    Change-Id: I702da1170484c0d10c3ae836ec3f7550975a341c
    Closes-Bug: #1810436

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/633548

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/rocky)

Reviewed: https://review.openstack.org/633548
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=8e38e214ed2ef770ee9c34c854fe809e1ac0fbb0
Submitter: Zuul
Branch: stable/rocky

commit 8e38e214ed2ef770ee9c34c854fe809e1ac0fbb0
Author: Alex Schultz <email address hidden>
Date: Thu Jan 3 12:06:36 2019 -0700

    Improve error message around hieradata override file

    If the file specified is empty, we currently throw a generic message
    about it not being in the correct format. Let's add a check to make sure
    the file is not empty before attempting to parse it as yaml.

    Change-Id: I702da1170484c0d10c3ae836ec3f7550975a341c
    Closes-Bug: #1810436
    (cherry picked from commit 8ddcc2cd145451335a90b6816c8110c65dc73998)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 11.3.0

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

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

This issue was fixed in the openstack/python-tripleoclient 10.6.1 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.