image 'NoneType' object has no attribute 'replace'

Bug #1468031 reported by DWang on 2015-06-23
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Invalid
Undecided
Zoltan Arnold Nagy

Bug Description

I followed the installation guide to verify my heat installation, however, I can't create a stack. My template is exactly the same as "installation guide for Ubuntu 14.04 LTS":('=''s are only used to separate different sections)

====
heat_template_version: 2014-10-16
description: A simple server.

parameters:
  ImageID:
    type: string
    description: Image use to boot a server
  NetID:
    type: string
    description: Network ID for the server

resources:
  server:
    type: OS::Nova::Server
    properties:
      image: { get_param: ImageID }
      flavor: m1.tiny
      networks:
      - network: { get_param: NetID }

outputs:
  private_ip:
    description: IP address of the server in the private network
    value: { get_attr: [ server, first_address ] }
====

The command I used to create a stack is:
====
# NET_ID=$(nova net-list | awk '/ demo-net / { print $2 }')
# heat stack-create -f test-stack.yml -P "ImageID=cirros-0.3.3-x86_64;NetID=$NET_ID" testStack
====

This is the error I get:
====
2015-06-24 01:21:41.435 8092 DEBUG heat.common.serializers [req-7d0fee69-93ef-4ad9-857d-c99acdd81ba6 admin admin] JSON response : {"explanation": "The server could not comply with the request since it is either malformed or otherwise incorrect.", "code": 400, "error": {"message": "Property error : server: image 'NoneType' object has no attribute 'replace'",
"traceback": "Traceback (most recent call last):\n\n
File \"/usr/lib/python2.7/dist-packages/heat/common/context.py\", line 300, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n
File \"/usr/lib/python2.7/dist-packages/heat/engine/service.py\", line 669, in create_stack\n parent_resource_name)\n\n
File \"/usr/lib/python2.7/dist-packages/heat/engine/service.py\", line 577, in _parse_template_and_validate_stack\n stack.validate()\n\n
File \"/usr/lib/python2.7/dist-packages/osprofiler/profiler.py\", line 105, in wrapper\n return f(*args, **kwargs)\n\n
File \"/usr/lib/python2.7/dist-packages/heat/engine/stack.py\", line 613, in validate\n raise ex\n\nStackValidationFailed: Property error : server: image 'NoneType' object has no attribute 'replace'\n", "type": "StackValidationFailed"}, "title": "Bad Request"} to_json /usr/lib/python2.7/dist-packages/heat/common/serializers.py:42

DWang (darren-wang) on 2015-06-23
description: updated
DWang (darren-wang) on 2015-06-23
description: updated
Steve Baker (steve-stevebaker) wrote :

what version of heat-engine do you have installed?

Do you have a glance image named cirros-0.3.3-x86_64?

Changed in heat:
status: New → Incomplete
DWang (darren-wang) on 2015-06-24
tags: added: heat
DWang (darren-wang) wrote :

It seems I'm using the heat (2015.1.0), I do have a "cirros-0.3.3-x86_64":

# nova image-show cirros-0.3.3-x86_64
+----------------------+--------------------------------------+
| Property | Value |
+----------------------+--------------------------------------+
| OS-EXT-IMG-SIZE:size | 13200896 |
| created | 2015-01-17T08:00:18Z |
| id | e73d12b2-8b3a-4e58-a232-521146bf96ce |
| minDisk | 0 |
| minRam | 0 |
| name | cirros-0.3.3-x86_64 |
| progress | 100 |
| status | ACTIVE |
| updated | 2015-01-17T08:00:18Z |
+----------------------+--------------------------------------+

Changed in heat:
assignee: nobody → Razumovsky Peter (prazumovsky)
Peter Razumovsky (prazumovsky) wrote :

OK, DWang, I can't reproduce your issue now, can you give me some additional information:
1. Do you have demo-net in nova net-list?
2. Do you use fresh stable heat version of 2015.1?

DWang (darren-wang) wrote :
Download full text (4.2 KiB)

@Razumovsky Peter (prazumovsky) , the answer to question 1 is yes, as for the second question, when I run "$ pip show heat", I get this:
Metadata-Version: 1.1
Name: heat
Version: 2015.1.0
Summary: OpenStack Orchestration
Home-page: http://www.openstack.org/
Author: OpenStack
Author-email: <email address hidden>
License: UNKNOWN
Location: /usr/lib/python2.7/dist-packages
Requires: pbr, Babel, eventlet, greenlet, httplib2, iso8601, keystonemiddleware, kombu, lxml, netaddr, oslo.config, oslo.concurrency, oslo.context, oslo.db, oslo.i18n, oslo.log, oslo.messaging, oslo.serialization, oslo.utils, osprofiler, oslo.versionedobjects, PasteDeploy, posix-ipc, pycrypto, python-ceilometerclient, python-cinderclient, python-glanceclient, python-heatclient, python-keystoneclient, python-neutronclient, python-novaclient, python-saharaclient, python-swiftclient, python-troveclient, PyYAML, requests, Routes, six, SQLAlchemy, sqlalchemy-migrate, stevedore, WebOb
Entry-points:
  [heat.templates]
  AWSTemplateFormatVersion.2010-09-09 = heat.engine.cfn.template:CfnTemplate
  heat_template_version.2013-05-23 = heat.engine.hot.template:HOTemplate20130523
  heat_template_version.2015-04-30 = heat.engine.hot.template:HOTemplate20150430
  HeatTemplateFormatVersion.2012-12-12 = heat.engine.cfn.template:HeatTemplate
  heat_template_version.2014-10-16 = heat.engine.hot.template:HOTemplate20141016
  [heat.stack_lifecycle_plugins]
  [oslo.config.opts]
  heat.engine.resources = heat.engine.resources:list_opts
  heat.common.config = heat.common.config:list_opts
  heat_integrationtests.common.config = heat_integrationtests.common.config:list_opts
  heat.common.crypt = heat.common.crypt:list_opts
  heat.common.heat_keystoneclient = heat.common.heat_keystoneclient:list_opts
  heat.openstack.common.policy = heat.openstack.common.policy:list_opts
  heat.api.middleware.ssl = heat.api.middleware.ssl:list_opts
  heat.common.wsgi = heat.common.wsgi:list_opts
  heat.api.aws.ec2token = heat.api.aws.ec2token:list_opts
  heat.openstack.common.eventlet_backdoor = heat.openstack.common.eventlet_backdoor:list_opts
  heat.engine.notification = heat.engine.notification:list_opts
  heat.engine.clients = heat.engine.clients:list_opts
  [heat.constraints]
  sahara.image = heat.engine.clients.os.sahara:ImageConstraint
  nova.flavor = heat.engine.clients.os.nova:FlavorConstraint
  nova.keypair = heat.engine.clients.os.nova:KeypairConstraint
  cinder.volume = heat.engine.clients.os.cinder:VolumeConstraint
  nova.server = heat.engine.clients.os.nova:ServerConstraint
  iso_8601 = heat.engine.iso_8601:ISO8601Constraint
  trove.flavor = heat.engine.clients.os.trove:FlavorConstraint
  neutron.network = heat.engine.clients.os.neutron:NetworkConstraint
  neutron.port = heat.engine.clients.os.neutron:PortConstraint
  neutron.router = heat.engine.clients.os.neutron:RouterConstraint
  cinder.vtype = heat.engine.clients.os.cinder:VolumeTypeConstraint
  neutron.subnet = heat.engine.clients.os.neutron:SubnetConstraint
  glance.image = heat.engine.clients.os.glance:ImageConstraint
  cinder.snapshot = heat.engine.clients.os.cinder:VolumeSnapshotConstraint
  [oslo.messaging.notify.drivers]
  heat.openst...

Read more...

Steve Baker (steve-stevebaker) wrote :

Can you confirm that your heat.conf [keystone_authtoken] auth_uri is set to your keystone/identity endpoint?

If not, then set that value and restart heat-engine and heat-api

DWang (darren-wang) wrote :

@Steve Baker (steve-stevebaker)
You are absolutely right that the problem is between authtoken and keystone.

I checked configurations realted to keystone in my heat.conf, here it is:

[DEFAULT]
keystone_backend=heat.common.heat_keystoneclient.KeystoneClientV3

[auth_password]
#multi_cloud=false
#allowed_auth_uris=

[clients_keystone]
#endpoint_type=<None>
...

[ec2authtoken]
auth_uri=http://controller1:5000/v2.0
#multi_cloud=false
#allowed_auth_uris=

[keystone_authtoken]
auth_uri = http://PUBLIC_KEYSTONE:5000 # I replaced the public URL of our keystone
auth_url = http://controller1:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = heat
password = PASSWORD

[ec2authtoken]
keystone_backend=heat.common.heat_keystoneclient.KeystoneClientV3

I used username and password of user heat to login through openstackclient + v3_auth_api_version and it succeeded.

Can you find any clue or some other more information?

DWang (darren-wang) wrote :

oh, dose this configuraion matter:

[paste_deploy]
#flavor=custombackend
api_paste_config=api-paste.ini

It seems I'm using the custombackend pipeline.

Changed in heat:
assignee: Peter Razumovsky (prazumovsky) → nobody
Zoltan Arnold Nagy (zoltan) wrote :

I've run into the same issue on 14.04

Changed in heat:
status: Incomplete → Confirmed
Zoltan Arnold Nagy (zoltan) wrote :

so I've tracked down the culprit. You need to have auth_uri configured in your keystone authtoken configuration else you'll get this. I'll submit a patch to make it more nice and/or handle the behavior more nicely.

Changed in heat:
assignee: nobody → Zoltan Arnold Nagy (zoltan)
DWang (darren-wang) wrote :

@Zoltan Arnold Nagy (zoltan) , Hi, but I have auth_uri configured, you can see it in the configuration I gave.

Zoltan Arnold Nagy (zoltan) wrote :

You're absolutely right, I missed that.

Can you try setting your [keystone_authtoken] as shown below report back? Thanks!

[keystone_authtoken]
identity_uri = http://internal adminend point:35357
auth_uri = http://external public endpoint:5000/v2.0
auth_protocol = http
admin_tenant_name = admin tenant's name
admin_user = admin user's name
admin_password = admin user's password

Thomas Herve (therve) on 2017-02-24
Changed in heat:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers