Traceback in mistral log, after attempt to create workbook twice with one name

Bug #1268501 reported by Sergey Murashov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Nikolay Makhotkin

Bug Description

Steps to reproduce:
1. Launch mistral
2. Send POST request with following body {"name": "test"}
3. Send POST request with following body {"name": "test"}

Actual result:
In mistral log we can see the following traceback:
2014-01-13 08:28:23.998 2520 DEBUG mistral.api.controllers.v1.workbook [-] Create workbook [workbook=Workbook [description='Unset', name='test', tags='Unset']] post /home/ubuntu/mistral/mistral/api/controllers/v1/workbook.py:74
2014-01-13 08:28:24.001 2520 ERROR mistral.db.sqlalchemy.api [-] Database registration exception: (IntegrityError) column name is not unique u'INSERT INTO workbooks (created_at, updated_at, id, name, definition, description, tags, scope, project_id, trust_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' ('2014-01-13 08:28:24.000638', None, u'3eee9dde-25ab-4bf3-9009-2eade332bd3a', u'test', None, None, None, None, None, None)
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api Traceback (most recent call last):
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api File "/home/ubuntu/mistral/mistral/db/sqlalchemy/api.py", line 263, in workbook_create
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api workbook.save(session=session)
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api File "/home/ubuntu/mistral/mistral/openstack/common/db/sqlalchemy/models.py", line 51, in save
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api session.flush()
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api File "/home/ubuntu/mistral/mistral/openstack/common/db/sqlalchemy/session.py", line 548, in _wrap
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api _raise_if_duplicate_entry_error(e, get_engine().name)
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api File "/home/ubuntu/mistral/mistral/openstack/common/db/sqlalchemy/session.py", line 493, in _raise_if_duplicate_entry_error
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api raise exception.DBDuplicateEntry(columns, integrity_error)
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api DBDuplicateEntry: (IntegrityError) column name is not unique u'INSERT INTO workbooks (created_at, updated_at, id, name, definition, description, tags, scope, project_id, trust_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' ('2014-01-13 08:28:24.000638', None, u'3eee9dde-25ab-4bf3-9009-2eade332bd3a', u'test', None, None, None, None, None, None)
2014-01-13 08:28:24.001 2520 TRACE mistral.db.sqlalchemy.api
2014-01-13 08:28:24.003 2520 WARNING wsme.api [-] Client-side error: Duplicate entry for Workbook: ['name']
172.18.78.126 - - [13/Jan/2014 08:28:24] "POST /v1/workbooks HTTP/1.1" 400 122

Changed in mistral:
importance: Undecided → Medium
milestone: none → 0.1
assignee: nobody → Nikolay Makhotkin (nmakhotkin)
Changed in mistral:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

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

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

Reviewed: https://review.openstack.org/66289
Committed: https://git.openstack.org/cgit/stackforge/mistral/commit/?id=348f3eea19bc43892a1e0c09acac991126b2ed7c
Submitter: Jenkins
Branch: master

commit 348f3eea19bc43892a1e0c09acac991126b2ed7c
Author: Nikolay Mahotkin <email address hidden>
Date: Mon Jan 13 13:58:55 2014 +0400

    Fix exceptions output when creating object in DB

    Fixes: bug #1268501

    Change-Id: I0fe7f61b72afc9cd7a5c3b65b343c1d438e07632

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
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.