Wrong handling of is_system flag at workbooks causes DB error with MySQL 5.7

Bug #1733501 reported by Istvan Imre
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Undecided
Istvan Imre

Bug Description

Sometimes is_system flag is not filled at workbook creation and that causes MYSQL error. It seems new MySQL does not allow null values for a boolean (is_system = sa.Column(sa.Boolean())) filed.

Error from DB:

DBAPIError exception wrapped from (_mysql_exceptions.InterfaceError) (-1, 'error totally whack') [SQL: u'INSERT INTO workbooks_v2 (scope, project_id, created_at, updated_at, id, name, definition, spec, tags, is_system) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'] [parameters: ('private', '<default-project>', datetime.datetime(2017, 11, 20, 11, 8, 50), None, '31afc3f3-88bc-4746-b628-3182d9b25ed3', 'test_workbook', '---\nname: test_workbook\nversion: \'2.0\'\nworkflows:\n wf_a:\n tasks:\n a:\n action: std_noop\n', '{"version": "2.0", "name": "test_workbook", "workflows": {"wf_a": {"tasks": {"a": {"name": "a", "action": "std_noop", "type": "direct"}}, "name": "wf_a", "version": "2.0"}, "version": "2.0"}}', '[]', None)]
Traceback (most recent call last):
  File "/opt/nokia/cbam-venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/opt/nokia/cbam-venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/nokia/cbam-venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/opt/nokia/cbam-venv/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
InterfaceError: (-1, 'error totally whack')

Changed in mistral:
assignee: nobody → Istvan Imre (istvan.imre)
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/522823

Changed in mistral:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/522823
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=f254c3925737aa8bb53d4072681bc6f7ab7893ff
Submitter: Zuul
Branch: master

commit f254c3925737aa8bb53d4072681bc6f7ab7893ff
Author: Istvan Imre <email address hidden>
Date: Fri Nov 24 14:47:25 2017 +0100

    Wrong handling of is_system flag at workbooks causes DB error with MySQL 5.7

    If we leave is_system workbook attribute as undefined (Null) that causes
    database insert error in MySQL 5.7, due to database constraints.
    So let's use constant False as is_system attribute in workbook create.
    It is OK, because there is no system workbook support in mistral yet.

    Change-Id: Idabf9d04d105c2386b9b110f1bbab3e69502b8e0
    Closes-Bug: #1733501

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 6.0.0.0b2

This issue was fixed in the openstack/mistral 6.0.0.0b2 development milestone.

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.