--template <path-to-tht> is broken for standaone

Bug #1919449 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Triaged
High
Unassigned

Bug Description

sudo openstack tripleo deploy \
  --templates /home/stack/tripleo-heat-templates \
  --local-ip=192.168.24.2/24 \
  --control-virtual-ip 192.168.24.3 \
  -e /usr/share/openstack-tripleo-heat-templates/environments/standalone/standalone-tripleo.yaml \
  -r /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml \
  -e /home/stack/containers-prepare-parameters.yaml \
  -e /home/stack/standalone_parameters.yaml \
  --output-dir /home/stack \
  --standalone

jinja2 rendering network template port_from_pool_v6.network.j2.yaml
jinja2 rendering networks
jinja2 rendering network template port_v6.network.j2.yaml
jinja2 rendering networks
jinja2 rendering role template role.role.j2.yaml
jinja2 rendering roles Standalone
rendering j2 template to file: /home/stack/tripleo-heat-installer-templates/./puppet/standalone-role.yaml
Not cleaning working directory /home/stack/tripleo-heat-installer-templates
Not cleaning ansible directory /home/stack/standalone-ansible-xolsundi
Install artifact is located at /home/stack/tripleo-heat-installer-templates/standalone-install-20210317105806.tar.bzip2

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

Deployment Failed!

ERROR: Heat log files: /var/log/heat-launcher/undercloud_deploy-iodvxygt

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

Exception: Could not fetch contents for file:///home/deployed-server/deployed-neutron-port.yaml
Traceback (most recent call last):
  File "/usr/lib64/python3.6/urllib/request.py", line 1505, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '/home/deployed-server/deployed-neutron-port.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/heatclient/common/utils.py", line 415, in read_url_content
    content = request.urlopen(url).read()
  File "/usr/lib64/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.6/urllib/request.py", line 1483, in file_open
    return self.open_local_file(req)
  File "/usr/lib64/python3.6/urllib/request.py", line 1522, in open_local_file
    raise URLError(exp)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '/home/deployed-server/deployed-neutron-port.yaml'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tripleoclient/utils.py", line 1759, in process_multiple_environments
    env_path=env_path, include_env_in_files=include_env_in_files)
  File "/usr/lib/python3.6/site-packages/heatclient/common/template_utils.py", line 331, in process_environment_and_files
    env_base_url)
  File "/usr/lib/python3.6/site-packages/heatclient/common/template_utils.py", line 369, in resolve_environment_urls
    is_object=is_object, object_request=object_request)
  File "/usr/lib/python3.6/site-packages/heatclient/common/template_utils.py", line 167, in get_file_contents
    file_content = utils.read_url_content(str_url)
  File "/usr/lib/python3.6/site-packages/heatclient/common/utils.py", line 417, in read_url_content
    raise exc.CommandError(_('Could not fetch contents for %s') % url)
heatclient.exc.CommandError: Could not fetch contents for file:///home/deployed-server/deployed-neutron-port.yaml

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/urllib/request.py", line 1505, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [Errno 2] No such file or directory: '/home/deployed-server/deployed-neutron-port.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/heatclient/common/utils.py", line 415, in read_url_content
    content = request.urlopen(url).read()
  File "/usr/lib64/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.6/urllib/request.py", line 1483, in file_open
    return self.open_local_file(req)
  File "/usr/lib64/python3.6/urllib/request.py", line 1522, in open_local_file
    raise URLError(exp)
urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '/home/deployed-server/deployed-neutron-port.yaml'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/tripleo_deploy.py", line 1421, in take_action
    self._standalone_deploy(parsed_args)
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/tripleo_deploy.py", line 1252, in _standalone_deploy
    parsed_args)
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/tripleo_deploy.py", line 742, in _deploy_tripleo_heat_templates
    cleanup=parsed_args.cleanup)
  File "/usr/lib/python3.6/site-packages/tripleoclient/utils.py", line 1810, in process_multiple_environments
    env_path=f.name, include_env_in_files=include_env_in_files)
  File "/usr/lib/python3.6/site-packages/heatclient/common/template_utils.py", line 331, in process_environment_and_files
    env_base_url)
  File "/usr/lib/python3.6/site-packages/heatclient/common/template_utils.py", line 369, in resolve_environment_urls
    is_object=is_object, object_request=object_request)
  File "/usr/lib/python3.6/site-packages/heatclient/common/template_utils.py", line 167, in get_file_contents
    file_content = utils.read_url_content(str_url)
  File "/usr/lib/python3.6/site-packages/heatclient/common/utils.py", line 417, in read_url_content
    raise exc.CommandError(_('Could not fetch contents for %s') % url)
heatclient.exc.CommandError: Could not fetch contents for file:///home/deployed-server/deployed-neutron-port.yaml
None
Could not fetch contents for file:///home/deployed-server/deployed-neutron-port.yaml

Changed in tripleo:
milestone: wallaby-3 → wallaby-rc1
Revision history for this message
Yadnesh Kulkarni (ykulkarn) wrote :

Can you pass the path for these 2 files from the rendered templates directory and retry ?
~~~
  -e /usr/share/openstack-tripleo-heat-templates/environments/standalone/standalone-tripleo.yaml \
  -r /usr/share/openstack-tripleo-heat-templates/roles/Standalone.yaml \
~~~

Also, did you passed the standalone role file to the ./tools/process-templates.py command while rendering templates ?

Revision history for this message
Rabi Mishra (rabi) wrote :

For some strange reason we flat copy[1] the environments outside templates dir to tht_render. If there are relative references it won't work.

Heat would pickup relative files in environments (if we don't flat copy them and use existing path), but it won't jinja render the references.

The only way to fix this is to pull all references along with an environment file to the tht_render where they can be jinja rendered.

However, it's better to use in-tree env files from custom tht_dir (specified with --templates), if they or references used by them are to be jinja rendered (which works atm).

[1] https://github.com/openstack/python-tripleoclient/blob/master/tripleoclient/v1/tripleo_deploy.py#L550-L553

Changed in tripleo:
milestone: wallaby-rc1 → xena-1
Changed in tripleo:
milestone: xena-1 → xena-2
Changed in tripleo:
milestone: xena-2 → xena-3
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.