Could not fetch contents for file:///tmp/tripleoclient-7yIBX5/tripleo-heat-templates/network/config/single-nic-vlans/compute.yaml

Bug #1752808 reported by Juan Badia Payno
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Jiří Stránský

Bug Description

Getting the following error executing the overcloud-deploy.sh
***
...
Processing environment files /home/stack/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml
Redirecting env file /home/stack/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml to /tmp/tripleoclient-7yIBX5/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml
Error Could not fetch contents for file:///tmp/tripleoclient-7yIBX5/tripleo-heat-templates/network/config/single-nic-vlans/compute.yaml processing environment file /tmp/tripleoclient-7yIBX5/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml
Rewriting /tmp/tripleoclient-7yIBX5/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml environment to /tmp/tripleoclient-7yIBX5/tripleo-heat-templates/env-net-single-nic-with-vlans-r5vByh.yaml
Could not fetch contents for file:///tmp/tripleoclient-7yIBX5/tripleo-heat-templates/network/config/single-nic-vlans/compute.yaml
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/command.py", line 25, in run
    super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 184, in run
    return_code = self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 950, in take_action
    self._deploy_tripleo_heat_templates_tmpdir(stack, parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 415, in _deploy_tripleo_heat_templates_tmpdir
    new_tht_root, tht_root)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 478, in _deploy_tripleo_heat_templates
    cleanup=not parsed_args.no_cleanup)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 237, in _process_multiple_environments
    env_path=f.name)
  File "/usr/lib/python2.7/site-packages/heatclient/common/template_utils.py", line 319, in process_environment_and_files
    env_base_url)
  File "/usr/lib/python2.7/site-packages/heatclient/common/template_utils.py", line 357, in resolve_environment_urls
    is_object=is_object, object_request=object_request)
  File "/usr/lib/python2.7/site-packages/heatclient/common/template_utils.py", line 161, in get_file_contents
    file_content = utils.read_url_content(str_url)
  File "/usr/lib/python2.7/site-packages/heatclient/common/utils.py", line 417, in read_url_content
    raise exc.CommandError(_('Could not fetch contents for %s') % url)
CommandError: Could not fetch contents for file:///tmp/tripleoclient-7yIBX5/tripleo-heat-templates/network/config/single-nic-vlans/compute.yaml
clean_up DeployOvercloud: Could not fetch contents for file:///tmp/tripleoclient-7yIBX5/tripleo-heat-templates/network/config/single-nic-vlans/compute.yaml
...
***

TO REPRODUCE THE ISSUE
======================
Installing tripleO with tripleo-quickstart with the following command:

   /quickstart.sh -X -T all --retain-inventory -t untagged,provision,environment,libvirt,undercloud-scripts,undercloud-inventory,overcloud-scripts,undercloud-setup,undercloud-install,undercloud-post-install,tripleoui-validate,overcloud-prep-config --requirements quickstart-extras-requirements.txt -N config/nodes/1ctlr_1comp_64gb.yml -c /home/installer/.quickstart/config/general_config/containers_minimal.yml -R master 192.168.1.45

Once on the undercloud cloning the tripleo-heat-templates and modified the overcloud-prep-containers.sh and the overcloud-deploy.sh scripts to use the new t-h-t location and adding the --debug and -e /home/stack/tripleo-heat-templates/environments/debug.yaml.

WORKAROUND
==========
1.-Removed all the roles from the tripleo-heat-templates/roles_data.yaml except the compute and controller.
2.-Modified the parameter deprecated_nic_config_name on the two roles (compute & controller) the new values will be:
controller --> deprecated_nic_config_name: 'controller-role.yaml'
compute --> deprecated_nic_config_name: 'compute-role.yaml'

Revision history for this message
Steven Hardy (shardy) wrote :
Changed in tripleo:
status: New → Triaged
importance: Undecided → High
milestone: none → rocky-1
tags: added: queens-backport-potential
Revision history for this message
Steven Hardy (shardy) wrote :

In the default roles we default to e.g deprecated_nic_config_name: 'compute.yaml' which ends up being the same as the non deprecated default in the environment file, I'll check if we're doing the same elsewhere and push a patch to adjust the default when deprecated_nic_config_name is not set to match the "new" e.g non-deprecated generated filename.

Revision history for this message
Steven Hardy (shardy) wrote :

To confirm, I think this only happens when no deprecated_nic_config_name is specified in the roles_data?

Revision history for this message
Juan Badia Payno (jbadiapa) wrote :

The roles_data was not updated when I got the error, so the following file was used https://raw.githubusercontent.com/openstack/tripleo-heat-templates/master/roles_data.yaml

Deleting the deprecated_nic_config_name on the roles_data file ended up with the following error:

Processing environment files /home/stack/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml
Redirecting env file /home/stack/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml to /tmp/tripleoclient-iu6ZQG/tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml
[Errno 21] Is a directory: u'/tmp/tripleoclient-iu6ZQG/tripleo-heat-templates/network/config/single-nic-vlans/'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/command.py", line 25, in run
    super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/command.py", line 184, in run
    return_code = self.take_action(parsed_args) or 0
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 950, in take_action
    self._deploy_tripleo_heat_templates_tmpdir(stack, parsed_args)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 415, in _deploy_tripleo_heat_templates_tmpdir
    new_tht_root, tht_root)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 478, in _deploy_tripleo_heat_templates
    cleanup=not parsed_args.no_cleanup)
  File "/usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py", line 191, in _process_multiple_environments
    env_path=env_path)
  File "/usr/lib/python2.7/site-packages/heatclient/common/template_utils.py", line 319, in process_environment_and_files
    env_base_url)
  File "/usr/lib/python2.7/site-packages/heatclient/common/template_utils.py", line 357, in resolve_environment_urls
    is_object=is_object, object_request=object_request)
  File "/usr/lib/python2.7/site-packages/heatclient/common/template_utils.py", line 161, in get_file_contents
    file_content = utils.read_url_content(str_url)
  File "/usr/lib/python2.7/site-packages/heatclient/common/utils.py", line 415, in read_url_content
    content = request.urlopen(url).read()
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 1353, in file_open
    return self.open_local_file(req)
  File "/usr/lib64/python2.7/urllib2.py", line 1390, in open_local_file
    return addinfourl(open(localfile, 'rb'), headers, origurl)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

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

Changed in tripleo:
assignee: nobody → Jiří Stránský (jistr)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (master)

Change abandoned by Jiri Stransky (<email address hidden>) on branch: master
Review: https://review.openstack.org/549805
Reason: Sorry for the noise, we don't need this patch. I was just missing https://review.openstack.org/#/c/539727 in my environment.

Revision history for this message
Jiří Stránský (jistr) wrote :

@jbadiapa you may also be missing https://review.openstack.org/#/c/539727 in your environment perhaps?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/549804
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=096b5d973eac9302601b16de1cf1430883e75c32
Submitter: Zuul
Branch: master

commit 096b5d973eac9302601b16de1cf1430883e75c32
Author: Jiri Stransky <email address hidden>
Date: Mon Mar 5 17:01:08 2018 +0100

    Fix default nic config file names

    Use the jinja2 string concatenation operator. The issue affected only
    cases where roles in roles_data.yaml didn't have
    deprecated_nic_config_name defined.

    Closes-Bug: #1752808
    Change-Id: I452fe5f387732114d4c4ab8951f03622931ed780

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

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/551237

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/queens)

Reviewed: https://review.openstack.org/551237
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=61c5ec9ef908f5f3e29f7ff1bcc9aee979907de5
Submitter: Zuul
Branch: stable/queens

commit 61c5ec9ef908f5f3e29f7ff1bcc9aee979907de5
Author: Jiri Stransky <email address hidden>
Date: Mon Mar 5 17:01:08 2018 +0100

    Fix default nic config file names

    Use the jinja2 string concatenation operator. The issue affected only
    cases where roles in roles_data.yaml didn't have
    deprecated_nic_config_name defined.

    Closes-Bug: #1752808
    Change-Id: I452fe5f387732114d4c4ab8951f03622931ed780
    (cherry picked from commit 096b5d973eac9302601b16de1cf1430883e75c32)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 9.0.0.0b1

This issue was fixed in the openstack/tripleo-heat-templates 9.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 9.0.0.0b2

This issue was fixed in the openstack/tripleo-heat-templates 9.0.0.0b2 development milestone.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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