Error: Unable to delete assembly using CLI

Bug #1309328 reported by Noorul Islam K M
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Solum
Fix Released
High
Angus Salkeld

Bug Description

$ --> solum assembly delete 08a0dd5b-f787-4692-87b3-2e8a44b0b4fe
Delete an assembly.
usage: solum [-h] [--os-username OS_USERNAME] [--os-password OS_PASSWORD]
             [--os-tenant-name OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL]
             [--os-auth-token OS_AUTH_TOKEN] [--solum-url SOLUM_URL]
             [--solum-api-version SOLUM_API_VERSION]
             {app,assembly,languagepack} action assembly_uuid

positional arguments:
  {app,assembly,languagepack}
                        Target noun to act upon
  action Action to perform on resource
  assembly_uuid Assembly uuid

optional arguments:
  -h, --help show this help message and exit
  --os-username OS_USERNAME
                        Defaults to env[OS_USERNAME]
  --os-password OS_PASSWORD
                        Defaults to env[OS_PASSWORD]
  --os-tenant-name OS_TENANT_NAME
                        Defaults to env[OS_TENANT_NAME]
  --os-auth-url OS_AUTH_URL
                        Defaults to env[OS_AUTH_URL]
  --os-auth-token OS_AUTH_TOKEN
                        Defaults to env[OS_AUTH_TOKEN]
  --solum-url SOLUM_URL
                        Defaults to env[SOLUM_URL]
  --solum-api-version SOLUM_API_VERSION
                        Defaults to env[SOLUM_API_VERSION] or 1
(IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`solum`.`component`, CONSTRAINT `component_ibfk_1` FOREIGN KEY (`assembly_id`) REFERENCES `assembly` (`id`))') 'DELETE FROM assembly WHERE assembly.id = %s' (1L,) (HTTP 500)

Tags: defects errors
Adrian Otto (aotto)
Changed in solum:
milestone: none → 2014.1.2
importance: Undecided → Critical
Adrian Otto (aotto)
summary: - Unable to delete assembly
+ Error: Unable to delete assembly using CLI
Changed in solum:
status: New → Triaged
Revision history for this message
James Li (james-li-3) wrote :
Download full text (5.1 KiB)

Just give more info on this:

solum-api log:

2014-04-25 15:35:30.372 30018 ERROR wsme.api [-] Server-side error: "(IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`solum`.`component`, CONSTRAINT `component_ibfk_1` FOREIGN KEY (`assembly_id`) REFERENCES `assembly` (`id`))') 'DELETE FROM assembly WHERE assembly.id = %s' (1L,)". Detail:
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/wsmeext/pecan.py", line 77, in callfunction
    result = f(self, *args, **kwargs)

  File "/opt/stack/solum/solum/api/controllers/v1/assembly.py", line 58, in delete
    return handler.delete(self._id)

  File "/opt/stack/solum/solum/api/handlers/assembly_handler.py", line 68, in delete
    db_obj.destroy(self.context)

  File "/opt/stack/solum/solum/objects/sqlalchemy/models.py", line 132, in destroy
    filter_by(id=self.id).\

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2661, in delete
    delete_op.exec_()

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 888, in exec_
    self._do_exec()

  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1013, in _do_exec
    params=self.query._params)

  File "/opt/stack/solum/solum/openstack/common/db/sqlalchemy/session.py", line 594, in _wrap
    raise exception.DBError(e)

DBError: (IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`solum`.`component`, CONSTRAINT `component_ibfk_1` FOREIGN KEY (`assembly_id`) REFERENCES `assembly` (`id`))') 'DELETE FROM assembly WHERE assembly.id = %s' (1L,)

10.0.2.15 - - [25/Apr/2014 15:35:30] "DELETE /v1/assemblies/2dcf175e-1721-4d53-a72c-59b863f0eb00 HTTP/1.1" 500 318

mysql> show create table component;
+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table ...

Read more...

Adrian Otto (aotto)
tags: added: errors
Angus Salkeld (asalkeld)
tags: added: really-important
tags: removed: really-important
Adrian Otto (aotto)
Changed in solum:
importance: Critical → Medium
Angus Salkeld (asalkeld)
Changed in solum:
assignee: nobody → Angus Salkeld (asalkeld)
Adrian Otto (aotto)
Changed in solum:
importance: Medium → High
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to solum (master)

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

Changed in solum:
status: Triaged → In Progress
Adrian Otto (aotto)
tags: added: defects
Revision history for this message
Adrian Otto (aotto) wrote :

I confirmed the defect:

vagrant@devstack:~$ solum assembly list
+--------------------------------------+------+-------------+--------+
| uuid | name | description | status |
+--------------------------------------+------+-------------+--------+
| ea8a59eb-77a3-4c91-9aa2-23ecc49e4233 | ex1 | None | READY |
+--------------------------------------+------+-------------+--------+
vagrant@devstack:~$ solum assembly delete ea8a59eb-77a3-4c91-9aa2-23ecc49e4233
Delete an assembly.
usage: solum [-h] [--os-username OS_USERNAME] [--os-password OS_PASSWORD]
             [--os-tenant-name OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL]
             [--os-auth-token OS_AUTH_TOKEN] [--solum-url SOLUM_URL]
             [--solum-api-version SOLUM_API_VERSION]
             {app,assembly,languagepack} action assembly_uuid

positional arguments:
  {app,assembly,languagepack}
                        Target noun to act upon
  action Action to perform on resource
  assembly_uuid Assembly uuid

optional arguments:
  -h, --help show this help message and exit
  --os-username OS_USERNAME
                        Defaults to env[OS_USERNAME]
  --os-password OS_PASSWORD
                        Defaults to env[OS_PASSWORD]
  --os-tenant-name OS_TENANT_NAME
                        Defaults to env[OS_TENANT_NAME]
  --os-auth-url OS_AUTH_URL
                        Defaults to env[OS_AUTH_URL]
  --os-auth-token OS_AUTH_TOKEN
                        Defaults to env[OS_AUTH_TOKEN]
  --solum-url SOLUM_URL
                        Defaults to env[SOLUM_URL]
  --solum-api-version SOLUM_API_VERSION
                        Defaults to env[SOLUM_API_VERSION] or 1
(IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`solum`.`component`, CONSTRAINT `component_ibfk_1` FOREIGN KEY (`assembly_id`) REFERENCES `assembly` (`id`))') 'DELETE FROM assembly WHERE assembly.id = %s' (1L,) (HTTP 500)

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to solum (master)

Reviewed: https://review.openstack.org/91293
Committed: https://git.openstack.org/cgit/stackforge/solum/commit/?id=21f59537a2b6666d31f46e8d5c4eafe357362318
Submitter: Jenkins
Branch: master

commit 21f59537a2b6666d31f46e8d5c4eafe357362318
Author: Angus Salkeld <email address hidden>
Date: Wed Apr 30 21:47:14 2014 +1000

    Delete all components when deleting an assembly

    Change-Id: I6fae415c13d5703474d2e977a910512eb9c7af36
    Fixes-bug: #1309328

Changed in solum:
status: In Progress → Fix Committed
Adrian Otto (aotto)
Changed in solum:
status: Fix Committed → Fix Released
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.