stack_user_domain_name not working as expected

Bug #1376213 reported by Matt Thompson
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Ethan Lynn
Juno
Fix Released
Undecided
Unassigned

Bug Description

Hi All,

It's my understanding that I can configure heat to use a keystone domain by referencing the domain by id (stack_user_domain_id) or by name (stack_user_domain_name). Specifying the domain by id works fine. However, when I specify the domain by name (stack_user_domain_name) and create a subsequent stack the stack remains in CREATE_IN_PROGRESS status indefinitely and I see the following in keystone's log:

2014-10-01 10:51:14.531 2926 DEBUG keystone.common.sql.core [-] Conflict project: (IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (`keystone`.`project`, CONSTRAINT `fk_project_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain` (`id`))') 'INSERT INTO project (id, name, domain_id, description, enabled, extra) VALUES (%s, %s, %s, %s, %s, %s)' ('7ec83ff8ba8942c08fd14f3869110b7c', 'edae0993222646239f9c2cb0b0a31ab3-e89d144d-c35d-49f2-bbb3-5dd7420', 'heat', 'Heat stack user project', 1, '{}') wrapper /usr/local/lib/python2.7/dist-packages/keystone/common/sql/core.py:410

It looks like heat isn't resolving the domain name to id before attempting to create a project under that domain.

I'm using master branch w/ the latest commit being ff1f85c6099dfd285459f7c209f60ff840af2b4a.

Thanks!

--mattt

Steven Hardy (shardy)
Changed in heat:
status: New → Triaged
importance: Undecided → High
milestone: none → kilo-1
Changed in heat:
assignee: nobody → Sirushti Murugesan (sirushtim)
Revision history for this message
Sirushti Murugesan (sirushtim) wrote :

There's actually two parts to this bug. One being that the domain_id isn't being used explicitly when keystone client API calls are made and the other being that because we set CREATE_IN_PROGRESS explicitly during the creation of a stack object, any failing operation happening before the `stack_task` task where all the events are set leaves the stack output to be in a CREATE_IN_PROGRESS state forever.

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

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

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Sirushti Murugesan (<email address hidden>) on branch: master
Review: https://review.openstack.org/127167

Changed in heat:
assignee: Sirushti Murugesan (sirushtim) → Ethan Lynn (ethanlynn)
Revision history for this message
Ethan Lynn (ethanlynn) wrote :

As chef deployer cookbook in community only sets stack_user_domain_name in heat.conf, heat will not work after deploy.
https://github.com/stackforge/cookbook-openstack-orchestration/blob/master/templates/default/heat.conf.erb#L125-L129

This patch is badly needed.

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

Reviewed: https://review.openstack.org/132955
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=f4998edf938ee83bcecfe8cf4d66822c98bdabb4
Submitter: Jenkins
Branch: master

commit f4998edf938ee83bcecfe8cf4d66822c98bdabb4
Author: Ethan Lynn <email address hidden>
Date: Thu Nov 6 12:00:49 2014 +0800

    Always using domain id to create domain project or user

    Add a function to get domain id from a domain name,
    and use domain id to create domain project or user.

    Change-Id: Ie97c179e62311406201476c0d4c43a731c48908c
    Partial-Bug: #1376213

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/133591

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

Reviewed: https://review.openstack.org/133591
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=c9d671cd0bb0b38745f5dfd0b32b9f096296bd9e
Submitter: Jenkins
Branch: stable/juno

commit c9d671cd0bb0b38745f5dfd0b32b9f096296bd9e
Author: Ethan Lynn <email address hidden>
Date: Thu Nov 6 12:00:49 2014 +0800

    Always using domain id to create domain project or user

    Add a function to get domain id from a domain name,
    and use domain id to create domain project or user.

    Change-Id: Ie97c179e62311406201476c0d4c43a731c48908c
    Partial-Bug: #1376213
    (cherry picked from commit f4998edf938ee83bcecfe8cf4d66822c98bdabb4)

tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/133895
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=73cc28fbdbe31a7f859cf0674b660f45f6da06bf
Submitter: Jenkins
Branch: master

commit 73cc28fbdbe31a7f859cf0674b660f45f6da06bf
Author: Ethan Lynn <email address hidden>
Date: Tue Nov 11 17:16:19 2014 +0800

    Correct error message when query domain id

    As discussion in comments of https://review.openstack.org/132955 ,
    correct error message when query domain id.

    Partial-Bug: #1376213
    Change-Id: Id39ee6d4acca82c908b690c748609ed1125012eb

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/133896
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=dca8e37e651c32aca7224fda208e1241efbf23f2
Submitter: Jenkins
Branch: master

commit dca8e37e651c32aca7224fda208e1241efbf23f2
Author: Ethan Lynn <email address hidden>
Date: Wed Nov 12 14:01:19 2014 +0800

    Catch v3 keystone unauthorized error when creating stack

    If v3 keystone unauthorized error raise during creating stack,
    then this stack will remaid in status of create_in_progress. This
    patch modify heat keystoneclient to catch unauthorized error and
    set stack status to failed.

    Closes-Bug: #1376213
    Change-Id: I9a34c20fc6ac3ce235aaba4eac25a6d5ceb43f5f

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/214165

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

Reviewed: https://review.openstack.org/214165
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=46bef7ae3bbff3abcfc36a173e86636791d218ed
Submitter: Jenkins
Branch: stable/juno

commit 46bef7ae3bbff3abcfc36a173e86636791d218ed
Author: Ethan Lynn <email address hidden>
Date: Wed Nov 12 14:01:19 2014 +0800

    Catch v3 keystone unauthorized error when creating stack

    If v3 keystone unauthorized error raise during creating stack,
    then this stack will remaid in status of create_in_progress. This
    patch modify heat keystoneclient to catch unauthorized error and
    set stack status to failed.

    Closes-Bug: #1376213
    Closes-Bug: #1450923
    Change-Id: I9a34c20fc6ac3ce235aaba4eac25a6d5ceb43f5f
    (cherry picked from commit dca8e37e651c32aca7224fda208e1241efbf23f2)

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.