← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1358147] Re: ProgrammingError: You have an error in your SQL syntax 'INSERT INTO meteringlabels'

 

Fwiw, I agree with enikanorov's assessment.  It looks like the first
value (tenant_id) is mistakenly a python dict instead of the expected
simple string.

Having stared at the relevant piece of havana-eol code
(neutron.db.metering.metering_db.MeteringDbMixin.create_metering_label())
and traced the value of tenant_id backwards several callers, this value
is whatever the user passed in the 'tenant_id' json key in the
create_metering_label REST API request.

This functions is restricted to admin only, so you're probably looking
for either a neutron cli tool or heat bug, or perhaps some local admin
(mis)using neutronclient or the API directly.

Since it has only happened once, I think this is as far as we're going
to go - if you see this recur, then we need more information about
who/what made the relevant REST call.

** Changed in: neutron
       Status: Incomplete => Invalid

** Changed in: neutron (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1358147

Title:
  ProgrammingError: You have an error in your SQL syntax 'INSERT INTO
  meteringlabels'

Status in Ubuntu Cloud Archive:
  Won't Fix
Status in OpenStack Neutron (virtual network service):
  Invalid
Status in neutron package in Ubuntu:
  Invalid

Bug description:
  Installation works about few months, got this message in logstash.
  Happens once, there is no surrounding activity (no requests to API).

  Havanna, ubuntu-cloud-archive, 2013.2.3-0ubuntu1.1

  Aug 17 21:48:59 api1 neutron.openstack.common.db.sqlalchemy.session[12400]:    ERROR DB exception wrapped.
  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/neutron/openstack/common/db/sqlalchemy/session.py", line 524, in _wrap
      return f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/neutron/openstack/common/db/sqlalchemy/session.py", line 718, in flush
      return super(Session, self).flush(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1818, in flush
      self._flush(objects)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1936, in _flush
      transaction.rollback(_capture_exception=True)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 58, in __exit__
      compat.reraise(exc_type, exc_value, exc_tb)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1900, in _flush
      flush_context.execute()
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
      rec.execute(self)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 525, in execute
      uow
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 64, in save_obj
      table, insert)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 541, in _emit_insert_statements
      execute(statement, multiparams)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662, in execute
      params)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
      compiled_sql, distilled_params
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
  exc_info
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 195, in raise_from_cause
      reraise(type(exception), exception, tb=exc_tb)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 867, in _execute_context

      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 324, in do_execute
      cursor.execute(statement, parameters)
    File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
      self.errorhandler(self, exc, value)
    File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
      raise errorclass, errorvalue

  ProgrammingError: (ProgrammingError) (1064, 'You have an error in your
  SQL syntax; check the manual that corresponds to your MySQL server
  version for the right syntax to use near \':
  "\'eaa6e8e248ce4f3784282b0c3f51384a\'", u\'created_at\':
  "\'2014-08-05T06:34:28+00:\' at line 1') 'INSERT INTO meteringlabels
  (tenant_id, id, name, description) VALUES (%s, %s, %s, %s)'
  ({u'keystone_tenant_id': u'eaa6e8e248ce4f3784282b0c3f51384a',
  u'created_at': u'2014-08-05T06:34:28+00:00', u'updated_at':
  u'2014-08-05T06:34:28+00:00', u'admin_blocked': False, u'id': 817,
  u'blocked': False}, '81070432-d514-4606-b564-e7f76138d985',
  'billable', '')

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1358147/+subscriptions


References