Failed to validate: Failed to validate: resources[0]: Property network not assigned

Bug #1591186 reported by Guoping Jia
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Confirmed
Undecided
Manimala Tangudu

Bug Description

That's for heat stack-create failure with template using nested resources in ResourceGroup. Everything works with the same template on Liberty. However, it fails persistently to validate on Mitaka.

Here is the debug output:

INFO (connectionpool) Starting new HTTPS connection (1): 10.241.226.42
DEBUG (connectionpool) "POST /v1/12ee707cf4144dde83ed46db989019c8/stacks HTTP/1.1" 400 1289
DEBUG (session) RESP: [400] Date: Fri, 10 Jun 2016 12:29:44 GMT Content-Length: 1289 Content-Type: application/json; charset=UTF-8 X-Openstack-Request-Id: req-3b9a684a-dc3b-46d9-8509-b1f1f03e404d
RESP BODY: {"explanation": "The server could not comply with the request since it is either malformed or otherwise incorrect.", "code": 400, "error": {"message": "Failed to validate: Failed to validate: resources[0]: Property network not assigned", "traceback": "Traceback (most recent call last):\n\n File \"/opt/stack/venv/heat-20160531T211724Z/lib/python2.7/site-packages/heat/common/context.py\", line 329, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File \"/opt/stack/venv/heat-20160531T211724Z/lib/python2.7/site-packages/heat/engine/service.py\", line 802, in create_stack\n stack_user_project_id, convergence, parent_resource_name)\n\n File \"/opt/stack/venv/heat-20160531T211724Z/lib/python2.7/site-packages/heat/engine/service.py\", line 680, in _parse_template_and_validate_stack\n stack.validate()\n\n File \"/opt/stack/venv/heat-20160531T211724Z/lib/python2.7/site-packages/osprofiler/profiler.py\", line 117, in wrapper\n return f(*args, **kwargs)\n\n File \"/opt/stack/venv/heat-20160531T211724Z/lib/python2.7/site-packages/heat/engine/stack.py\", line 761, in validate\n raise ex\n\nStackValidationFailed: Failed to validate: Failed to validate: resources[0]: Property network not assigned\n", "type": "StackValidationFailed"}, "title": "Bad Request"}

Traceback (most recent call last):
  File "/usr/bin/heat", line 10, in <module>
    sys.exit(main())
  File "/opt/stack/venv/heatclient-20160531T211724Z/lib/python2.7/site-packages/heatclient/shell.py", line 702, in main
    HeatShell().main(args)
  File "/opt/stack/venv/heatclient-20160531T211724Z/lib/python2.7/site-packages/heatclient/shell.py", line 652, in main
    args.func(client, args)
  File "/opt/stack/venv/heatclient-20160531T211724Z/lib/python2.7/site-packages/heatclient/v1/shell.py", line 144, in do_stack_create
    hc.stacks.create(**fields)
  File "/opt/stack/venv/heatclient-20160531T211724Z/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 162, in create
    data=kwargs, headers=headers)
  File "/opt/stack/venv/heatclient-20160531T211724Z/lib/python2.7/site-packages/keystoneclient/adapter.py", line 182, in post
    return self.request(url, 'POST', **kwargs)
  File "/opt/stack/venv/heatclient-20160531T211724Z/lib/python2.7/site-packages/heatclient/common/http.py", line 311, in request
    raise exc.from_response(resp)
heatclient.exc.HTTPBadRequest: ERROR: Failed to validate: Failed to validate: resources[0]: Property network not assigned

Revision history for this message
Guoping Jia (guoping-jia) wrote :

heat templates with nested resources.

Revision history for this message
Guoping Jia (guoping-jia) wrote :
Revision history for this message
Dmitriy (duvarenkov) wrote :

Hi!
I tried to reproduce this on Mitaka master. Created stack five times and every time it was created fine.
I used these params:
  key_name: default
  instance_type: m1.tiny
  image_id: cirros-0.3.4-x86_64-uec
  public_net: public
  dns_list: []
  cidr: 10.0.0.16/24
  instances_per_group: 1

Which parameters you have used?

Revision history for this message
Guoping Jia (guoping-jia) wrote :

Thank you for trying this out from your setting.

I retried the heat stack-create using very much the same params as you did, it still failed (from our 2 testing systems) with the same error:

ERROR: Failed to validate: Failed to validate: resources[0]: Property network not assigned

The heat template-validate did not show any issue (see below). Just wondering if there is any debug option / logs I could use /look at for this failure ?

$ heat template-validate -e server_group.env.yaml -f server_group.yaml
{
  "Description": "No description",
  "Parameters": {
    "dns_list": {
      "Type": "CommaDelimitedList",
      "NoEcho": "false",
      "Description": "",
      "Label": "dns_list"
    },
    "public_net": {
      "Type": "String",
      "NoEcho": "false",
      "Description": "",
      "Value": "public",
      "Label": "public_net"
    },
    "image_id": {
      "Type": "String",
      "NoEcho": "false",
      "Description": "",
      "Value": "cirros-0.3.4-x86_64",
      "Label": "image_id"
    },
    "key_name": {
      "Type": "String",
      "NoEcho": "false",
      "Description": "",
      "Value": "default",
      "Label": "key_name"
    },
    "instances_per_group": {
      "Type": "Number",
      "NoEcho": "false",
      "Description": "",
      "Value": 1,
      "Label": "instances_per_group"
    },
    "instance_type": {
      "Type": "String",
      "NoEcho": "false",
      "Description": "",
      "Value": "m1.tiny",
      "Label": "instance_type"
    },
    "cidr": {
      "Type": "String",
      "NoEcho": "false",
      "Description": "",
      "Value": "10.0.0.16/24",
      "Label": "cidr"
    }
  }
}

Revision history for this message
Guoping Jia (guoping-jia) wrote :

env file used in heat stack-create.

Revision history for this message
Guoping Jia (guoping-jia) wrote :

Did you try the heat stack-create using the env file ? Or you passed the parameters directly in your testing ?

My colleague told me he saw the same issue when he tried from devstack mitaka using the template, together with the env file. He may update the ticket with the error he had.

Revision history for this message
Anant Patil (ananta) wrote :

I am able to reproduce this issue when I use an environment file. Without an environment file, I can create a stack with the parameters specified in CLI. However, if I use the environment file to specify the parameters, things fail. The is possibly a bug that sneaked in in the environment file processing.

Revision history for this message
Guoping Jia (guoping-jia) wrote :

I can try to pass all the required properties using the parameters option. However, here we have the nested heat templates, i.e., using the resource_registry to link the 'server_with_vol_and_fip.yaml' with the parent 'server_group.yaml' (as the new 'My::Server::WithVolumeFIP' resource).

I am not sure how can we pass this resource_registry using any other option, rather than using the env file ?

Revision history for this message
Anant Patil (ananta) wrote :

I have investigated and found that the template is using properties moved to HIDDEN status and hence is not able to create new stack using it. Please use the new properties:

For OS::Neutron::RouterInterface:
Use router instead of router_id
Use subnet instead of subnet_id

For OS::Neutron::Port:
Use network instead of network_id

For OS::Neutron::Subnet:
Use network instead of netowrk_id.

Unfortunately, the mitaka release notes doesn't have this information.

Changed in heat:
status: New → Invalid
Revision history for this message
Guoping Jia (guoping-jia) wrote :

I am not sure if we should simply set this bug as invalid.

Given that everything worked well in Liberty and it simply stops working in Mitaka, we at least need to mention it somewhere for those moved properties in Mitaka. There is still an issue in back-ward compatibility.

Anant Patil (ananta)
Changed in heat:
status: Invalid → Confirmed
Revision history for this message
Anant Patil (ananta) wrote :

I see that there are two parts to the problem:

(1) Users are able to create stack with resource properties that are hidden (https://bugs.launchpad.net/heat/+bug/1599074) (these don't have nested stack).

(2) User creating a stack with nested resources seem to fail when they use the resource properties that are hidden.

I am not sure how to handle (2). After upgrade, the stacks should continue to run even if they were created with resource properties that are marked as hidden. Can the user update the stack with same template having the same hidden properties?

Revision history for this message
Diego Casati (diego-casati) wrote :

Just to add to the list described by Anant.

For OS::Neutron::FloatingIP
Use floating_network instead of floating_network_id

Revision history for this message
Al Bailey (albailey1974) wrote :

There is a comment in resource.py that says
" # Only translate in cases where strict_validate is True "

For nested stacks and resource groups, strict_validate is false which is why the translation rules are never applied and these stacks fail.

Amy Fong (afong2)
Changed in heat:
assignee: nobody → Amy Fong (afong2)
Amy Fong (afong2)
Changed in heat:
assignee: Amy Fong (afong2) → nobody
Revision history for this message
Ethan Lynn (ethanlynn) wrote :

Any update for this bug?

Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
Changed in heat:
assignee: nobody → Manimala Tangudu (ztngman)
Revision history for this message
Manimala Tangudu (ztngman) wrote :

Hi,

I used the same templates attached above.
Stack creation failed when I used normal network but the same is successful when external network is used.
Please try to use any external network using the command "neutron net-external-list".
And let us know if you still find any issues.

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.