heat-translator failed: - [Errno 13] Permission denied: 'SP1_res.yaml'

Bug #1749394 reported by dharmendra on 2018-02-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Translator
Undecided
Unassigned
tacker
Critical
dharmendra

Bug Description

Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.257 INFO heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA input type to HOT input type.
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.259 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Mapping between TOSCA nodetemplate and HOT resource. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py:158
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.261 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating the node templates. _translate_nodetemplates /usr/local/lib/python2.7/dist-packages/translator/hot/translate_node_templates.py:216
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.263 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.266 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.268 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.270 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.273 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.276 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.300 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.302 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA node type to HOT resource type. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_resource.py:43
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.349 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Translating TOSCA outputs to HOT outputs. __init__ /usr/local/lib/python2.7/dist-packages/translator/hot/translate_outputs.py:26
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.351 DEBUG heat-translator [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Converting translated output to yaml format.
output_to_yaml /usr/local/lib/python2.7/dist-packages/translator/hot/syntax/hot_template.py:67
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.381 DEBUG tacker.vnfm.infra_drivers.openstack.translate_template [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] heat-translator error: [Errno 13] Permission denied: 'SP1_res.yaml' _generate_hot_from_tosca /opt/stack/tacker/tacker/vnfm/infra_drivers/openstack/translate_template.py:302
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.384 DEBUG tacker.vnfm.plugin [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] Fail to create vnf a4bda308-3b96-47be-9c87-b8c114ee744a in infra_driver, so delete this vnf _create_vnf /opt/stack/tacker/tacker/vnfm/plugin.py:346
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.436 DEBUG tacker.db.vnfm.vnfm_db [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] vnf_db <tacker.db.vnfm.vnfm_db.VNF[object at 7fa59f7dc2d0] {tenant_id=u'9036161e5dfc4faf82f7b8ae6570f257', id=u'a4bda308-3b96-47be-9c87-b8c114ee744a', created_at=datetime.datetime(2018, 2, 14, 8, 20, 41), updated_at=None, deleted_at=datetime.datetime(1, 1, 1, 0, 0), vnfd_id=u'221dc02a-1a87-4b8e-b782-c8fd8f3c3976', name=u'test', description=u'sample-tosca-vnfd-scaling', instance_id=None, mgmt_url=None, status='PENDING_DELETE', vim_id=u'cf690194-64eb-402b-9dca-287c01a7d81c', placement_attr={u'vim_name': u'VIM0'}, erro
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.449 DEBUG tacker.db.vnfm.vnfm_db [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] vnf_db attributes [] _make_vnf_dict /opt/stack/tacker/tacker/db/vnfm/vnfm_db.py:220
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.484 DEBUG tacker.common.log [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] tacker.db.common_services.common_services_db_plugin.CommonServicesPluginDb method create_event called with arguments (<tacker.context.Context object at 0x7fa59f83f250>,) {'res_type': 'vnf', 'tstamp': datetime.datetime(2018, 2, 14, 8, 20, 42, 484074), 'details': 'VNF delete initiated', 'evt_type': 'DELETE', 'res_id': 'a4bda308-3b96-47be-9c87-b8c114ee744a', 'res_state': 'PENDING_DELETE'} wrapper /opt/stack/tacker/tacker/common/log.py:34
Feb 14 08:20:42 control tacker-server[14365]: 2018-02-14 08:20:42.523 DEBUG tacker.vnfm.vim_client [req-78e745fb-f25c-4ef5-828f-853deefcf1ee admin admin] VIM info found for vim id cf690194-64eb-402b-9dca-287c01a7d81c get_vim /opt/stack/tacker/tacker/vnfm/vim_client.py:55

In Tacker, I have created a VNFD with with autoscaling, template as in [1].

After that while deploying VNF with that VNFD, it failed with error:

vagrant@control:/opt/stack/tacker/samples/tosca-templates/vnfd$ tacker vnf-create --vnfd-id 221dc02a-1a87-4b8e-b782-c8fd8f3c3976 test
heat-translator failed: - [Errno 13] Permission denied: 'SP1_res.yaml'

[1]: https://github.com/openstack/tacker/blob/master/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml

As per my observation, root cause is [2] opening file in root dir (i.e. '/'), due to which it giving permission denied.
[2]: https://github.com/openstack/heat-translator/blob/master/translator/hot/tosca_translator.py#L69

Changed in tacker:
importance: Undecided → Critical
status: New → Confirmed
Changed in tacker:
assignee: nobody → dharmendra (dharmendra-kushwaha)

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

Changed in tacker:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/545435
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=c6b758477c3304deb8435b369406ea11e00f71db
Submitter: Zuul
Branch: master

commit c6b758477c3304deb8435b369406ea11e00f71db
Author: dharmendra <email address hidden>
Date: Fri Feb 16 18:34:35 2018 +0000

    Permission issue with heat.

    While deploying a vnf with autoscaling, heat translator failed with
    premission denied error. This issue occured because [1] opening file
    in root dir (i.e. '/'), due to which it giving permission denied.
    Fixing it by setting current working dir as '/temp'

    [1]: https://github.com/openstack/heat-translator/blob/master/translator/hot/tosca_translator.py#L69

    Change-Id: Ib2b0fd6c4c32a523b9fb25f47eae19225b84439f
    Closes-bug: #1749394

Changed in tacker:
status: In Progress → Fix Released
Jisoo Kim (jisookim) wrote :

I've exactly same issue on kolla-ansible environment.

Any VNFDs can be used to create VNFs but if trying with VNFD including scaling-policies this issue happen.

Any idea?

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

Other bug subscribers