OperationalError on run of DB init script

Bug #1339728 reported by ruhe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Critical
ruhe

Bug Description

Steps to reproduce:
===================
1. Checkout murano from master
2. Configure murano to use MySQL
3. run murano-db-manage upgrade

Observed behaviour:
===================
Following error message was observed:
(OperationalError) (1071, 'Specified key was too long; max key length is 767 bytes')

Expected behaviour:
===================
DB upgrade script should finish without errors

Analysis:
=========
If the collation of the DB and table is utf8 and the columns we want to
index are 512 chars, it is too big for the index since the max key length
is 767 bytes.

How to fix:
===========
Reduce length of indexed columns to fix problem. 128 chars should be probably enough

ruhe (ruhe)
Changed in murano:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Ruslan Kamaldinov (ruhe)
milestone: none → juno-2
Changed in murano:
status: Triaged → In Progress
Revision history for this message
ruhe (ruhe) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/104205
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=2174fc8a8496dd6cd9b154bc9bd5a8569695de13
Submitter: Jenkins
Branch: master

commit 2174fc8a8496dd6cd9b154bc9bd5a8569695de13
Author: Ruslan Kamaldinov <email address hidden>
Date: Wed Jul 2 18:35:51 2014 +0400

    Fix DB migration script

    Problems we had:
    1. If the collation of the DB and table is utf8 and the columns we want to
       index are 512 chars, it is too big for the index since the max key length
       is 767 bytes. Following error message observed:
       (OperationalError) (1071, 'Specified key was too long; max key length is 767 bytes')

    2. During migration to Alembic we missed the unique field for the
       'fully_qualified_name' column of the table 'package'. This change
       fixes that issue.

    Fixes:
    1. Reduce length of indexed columns to fix problem. 128 chars should be probably enough
    2. Add uniqe paramater for column fully_qualified_name of table package

    Additional changes:
    * Test that column is unique in DB migration tests (on real databases)
    * Introduced base for DB-related unit-tests. These tests use in-memory
      instance of SQLite
    * Test that column is unique in DB-related unit-tests

    Closes-Bug: #1339201
    Closes-Bug: #1339728
    Change-Id: I4816790e11f225c5dbb130747535094fdf06733e

Changed in murano:
status: In Progress → Fix Committed
ruhe (ruhe)
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: juno-2 → 2014.2
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.