nova baremetal-node-create fails with HTTP 500

Bug #1322599 reported by Giulio Fidente
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned
tripleo
Fix Released
Critical
Steve Kowalik

Bug Description

baremetal-node-create fails with HTTP 500 as pm_password we pass is bigger than allowed; DB schema reports VARCHAR255

trace is as follows:

nova.openstack.common.db.sqlalchemy.session File "/opt/stack/venvs/nova/lib/python2.7/site-packages/nova/openstack/common/db/sqlalchemy/session.py", line 439, in _wrap
nova.openstack.common.db.sqlalchemy.session return f(self, *args, **kwargs)
nova.openstack.common.db.sqlalchemy.session File "/opt/stack/venvs/nova/lib/python2.7/site-packages/nova/openstack/common/db/sqlalchemy/session.py", line 705, in flush
nova.openstack.common.db.sqlalchemy.session return super(Session, self).flush(*args, **kwargs)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1824, in flush
nova.openstack.common.db.sqlalchemy.session self._flush(objects)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1942, in _flush
nova.openstack.common.db.sqlalchemy.session transaction.rollback(_capture_exception=True)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
nova.openstack.common.db.sqlalchemy.session compat.reraise(exc_type, exc_value, exc_tb)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1906, in _flush
nova.openstack.common.db.sqlalchemy.session flush_context.execute()
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
nova.openstack.common.db.sqlalchemy.session rec.execute(self)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 525, in execute
nova.openstack.common.db.sqlalchemy.session uow
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 64, in save_obj
nova.openstack.common.db.sqlalchemy.session table, insert)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 569, in _emit_insert_statements
nova.openstack.common.db.sqlalchemy.session execute(statement, params)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 662, in execute
nova.openstack.common.db.sqlalchemy.session params)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
nova.openstack.common.db.sqlalchemy.session compiled_sql, distilled_params
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
nova.openstack.common.db.sqlalchemy.session context)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
nova.openstack.common.db.sqlalchemy.session exc_info
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
nova.openstack.common.db.sqlalchemy.session reraise(type(exception), exception, tb=exc_tb)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
nova.openstack.common.db.sqlalchemy.session context)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 324, in do_execute
nova.openstack.common.db.sqlalchemy.session cursor.execute(statement, parameters)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
nova.openstack.common.db.sqlalchemy.session self.errorhandler(self, exc, value)
nova.openstack.common.db.sqlalchemy.session File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
nova.openstack.common.db.sqlalchemy.session raise errorclass, errorvalue
nova.openstack.common.db.sqlalchemy.session DataError: (DataError) (1406, "Data too long for column 'pm_password' at row 1") 'INSERT INTO bm_nodes (created_at, updated_at, deleted_at, deleted, uuid, service_host, instance_uuid, instance_na
me, cpus, memory_mb, local_gb, preserve_ephemeral, pm_address, pm_user, pm_password, task_state, terminal_port, image_path, pxe_config_path, deploy_key, root_mb, swap_mb, ephemeral_mb)

Tags: baremetal
Derek Higgins (derekh)
Changed in tripleo:
importance: Undecided → Critical
Changed in tripleo:
status: New → Triaged
Revision history for this message
Giulio Fidente (gfidente) wrote :

I'm trying to revert If26b648dee95abc5aa0bf80d3111265b00141b6d and see if things work

Revision history for this message
Giulio Fidente (gfidente) wrote :

Reverting fixed the issue. The change If26b648dee95abc5aa0bf80d3111265b00141b6d inherits from oslo-incubator "a584166 Make TRADITIONAL the default SQL mode".

With TRADITIONAL mode off, we were truncating pm_password to 255, now it is raising an error.

I think though we should *not* paste the rsa key in pm_password, virtual_power_driver expects the key to be a file configured by: virtual_power_host_key

Changed in tripleo:
assignee: nobody → Giulio Fidente (gfidente)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-incubator (master)

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

Changed in tripleo:
assignee: Giulio Fidente (gfidente) → Ben Nemec (bnemec)
status: Triaged → In Progress
Ben Nemec (bnemec)
Changed in tripleo:
assignee: Ben Nemec (bnemec) → Giulio Fidente (gfidente)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in tripleo:
assignee: Giulio Fidente (gfidente) → Steve Kowalik (stevenk)
Tracy Jones (tjones-i)
tags: added: baremetal
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-incubator (master)

Reviewed: https://review.openstack.org/95445
Committed: https://git.openstack.org/cgit/openstack/tripleo-incubator/commit/?id=b14981502e9c72be7623ed1920163deebdda4337
Submitter: Jenkins
Branch: master

commit b14981502e9c72be7623ed1920163deebdda4337
Author: Steve Kowalik <email address hidden>
Date: Mon May 26 17:43:08 2014 +1000

    Clamp pm_password to 255 for nova-bm nodes

    Due to nova If26b648dee95abc5aa0bf80d3111265b00141b6d, pm_password
    is now enforced to be 255 characters, so clamp pm_password to 255
    characters before creating the node.

    Change-Id: Id5c489eb7d6ef555c588207e7f5ba34a55d33000
    Closes-Bug: #1322599

Changed in tripleo:
status: In Progress → Fix Released
Sean Dague (sdague)
Changed in nova:
status: New → Invalid
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.