Table instance_system_metadata's colume "value" is too short to contain the metadata, "Data too long for column 'value' at row 1"

Bug #1410649 reported by Jerry Cai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powervc-driver
Fix Committed
Undecided
Unassigned

Bug Description

It worked well in juno release, but in kilo, the error occurred. We'd like to insert some long metadata into instance_system_metadata, but it reported "Data too long for column 'value' at row 1".

2015-01-14 13:47:15.607 30360 ERROR oslo.db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped from (DataError) (1406, "Data too long for column 'value' at row 1") 'INSERT INTO instance_system_metadata (created_at, updated_at, deleted_at, deleted, `key`, value, instance_uuid) VALUES (%s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2015, 1, 14, 5, 47, 15, 607004), None, None, 0, 'configuration_data', '{"present_disk": {"files": {"ovf-env.xml": "<ns0:Environment xmlns:ns0=\\"http://schemas.dmtf.org/ovf/environment/1\\" ns0:id=\\"vs0\\">\\n <ns0:PlatformSection>\\n <ns0:Locale>en</ns0:Locale>\\n </ns0:PlatformSection>\\n <ns0:PropertySection>\\n <Property ns0:key=\\"com.{secret}.system.networking.ipv4defaultgateway\\" ns0:value=\\"10.9.0.1\\" /><Property ns0:key=\\"com.{secret}.system.networking.hostname\\" ns0:value=\\"tet\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.slotnumber.1\\" ns0:value=\\"179\\" /><Property ns0:key=\\"com.{secret}.system.networking.dnsIPaddresses\\" ns0:value=\\"\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.usedhcpv4.1\\" ns0:value=\\"false\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.ipv4addresses.1\\" ns0:value=\\"10.9.0.2\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.ipv4netmasks.1\\" ns0:value=\\"255.255.252.0\\" /><Property ns0:key=\\"com.{secret}.system.networking.domainname\\" ns0:value=\\"novalocal\\" /><Property ns0:key=\\"com.{secret}.system.timezone\\" ns0:value=\\"\\" /></ns0:PropertySection>\\n</ns0:Environment>"}, "volume_label": "ovf-env", "name": "disk.ovf"}}', '10818cb4-d2ae-4b8b-8bd3-f44768092960')
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters Traceback (most recent call last):
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters context)
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters cursor.execute(statement, parameters)
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters self.errorhandler(self, exc, value)
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters raise errorclass, errorvalue
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters DataError: (1406, "Data too long for column 'value' at row 1")
2015-01-14 13:47:15.607 30360 TRACE oslo.db.sqlalchemy.exc_filters
2015-01-14 13:47:15.610 30360 WARNING powervc.nova.driver.virt.powervc.driver [-] Created instance failed: (DataError) (1406, "Data too long for column 'value' at row 1") 'INSERT INTO instance_system_metadata (created_at, updated_at, deleted_at, deleted, `key`, value, instance_uuid) VALUES (%s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2015, 1, 14, 5, 47, 15, 607004), None, None, 0, 'configuration_data', '{"present_disk": {"files": {"ovf-env.xml": "<ns0:Environment xmlns:ns0=\\"http://schemas.dmtf.org/ovf/environment/1\\" ns0:id=\\"vs0\\">\\n <ns0:PlatformSection>\\n <ns0:Locale>en</ns0:Locale>\\n </ns0:PlatformSection>\\n <ns0:PropertySection>\\n <Property ns0:key=\\"com.{secret}.system.networking.ipv4defaultgateway\\" ns0:value=\\"10.9.0.1\\" /><Property ns0:key=\\"com.{secret}.system.networking.hostname\\" ns0:value=\\"tet\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.slotnumber.1\\" ns0:value=\\"179\\" /><Property ns0:key=\\"com.{secret}.system.networking.dnsIPaddresses\\" ns0:value=\\"\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.usedhcpv4.1\\" ns0:value=\\"false\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.ipv4addresses.1\\" ns0:value=\\"10.9.0.2\\" /><Property ns0:key=\\"com.{secret}.adapter.networking.ipv4netmasks.1\\" ns0:value=\\"255.255.252.0\\" /><Property ns0:key=\\"com.{secret}.system.networking.domainname\\" ns0:value=\\"novalocal\\" /><Property ns0:key=\\"com.{secret}.system.timezone\\" ns0:value=\\"\\" /></ns0:PropertySection>\\n</ns0:Environment>"}, "volume_label": "ovf-env", "name": "disk.ovf"}}', '10818cb4-d2ae-4b8b-8bd3-f44768092960')

I believe this might be a defect that it should contain a long data into system metadata. Please look into it, thanks.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Jerry,

the key and value in the instance_system_metadata is restricted to 255 since havana. right?

https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py#L510

Could it be that earlier you did not notice this problem because it got truncated?

thanks,
dims

Changed in nova:
status: New → Incomplete
Terry Yao (yaohaif)
affects: nova → powervc-driver
Changed in powervc-driver:
status: Incomplete → New
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to powervc-driver (master)

Reviewed: https://review.openstack.org/149933
Committed: https://git.openstack.org/cgit/stackforge/powervc-driver/commit/?id=a717ce4cec06bfb43c7b67b3b6de76924c450a31
Submitter: Jenkins
Branch: master

commit a717ce4cec06bfb43c7b67b3b6de76924c450a31
Author: terryyao <email address hidden>
Date: Mon Jan 26 14:58:34 2015 +0800

    Remove configuration_data from instance.system_metadata before save

    For Activation Engine, instance would have a configuration_data in its
    system metadata, powervc driver does not need this and before save nova
    instance, we need to remove this system metdata. Otherwise db will not
    throw exception.

    Closes-Bug: #1410649
    Change-Id: I3fef4ae8c2d99dc103164fa346a2424185e773f5

Changed in powervc-driver:
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to powervc-driver (stable/juno)

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

tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to powervc-driver (stable/juno)

Reviewed: https://review.openstack.org/149935
Committed: https://git.openstack.org/cgit/stackforge/powervc-driver/commit/?id=49ed480765178fee601a9bfa40d14d1b4535435c
Submitter: Jenkins
Branch: stable/juno

commit 49ed480765178fee601a9bfa40d14d1b4535435c
Author: terryyao <email address hidden>
Date: Mon Jan 26 14:58:34 2015 +0800

    Remove configuration_data from instance.system_metadata before save

    For Activation Engine, instance would have a configuration_data in its
    system metadata, powervc driver does not need this and before save nova
    instance, we need to remove this system metdata. Otherwise db will not
    throw exception.

    Closes-Bug: #1410649
    Change-Id: I3fef4ae8c2d99dc103164fa346a2424185e773f5
    (cherry picked from commit a717ce4cec06bfb43c7b67b3b6de76924c450a31)

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.