← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1486041] [NEW] IntegrityError: NOT NULL constraint failed: tags.resource_id during instance_tag_set

 

Public bug reported:

Steps to reproduce:

 1. create instance
 2. set ['tag1', 'tag2'] to the instance
 3. set ['tag1'] to the instance

Expected result:
    tags were added.

Actual result:

    2015-08-18 16:26:36,601 ERROR [oslo_db.sqlalchemy.exc_filters] DBAPIError exception wrapped from (sqlite3.IntegrityError) NOT NULL constraint failed: tags.resource_id [SQL: u'INSERT INTO tags DEFAULT VALUES']
    Traceback (most recent call last):
      File "/opt/stack/nova/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
        context)
      File "/opt/stack/nova/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
        cursor.execute(statement, parameters)
    IntegrityError: NOT NULL constraint failed: tags.resource_id

It happens because list 'to_add' in method 'instance_tag_set' is empty
in second case. It's empty because on step 3 must delete one tag and
create zero tags. So to fix bug we must check list to_add.

** Affects: nova
     Importance: Low
     Assignee: Sergey Nikitin (snikitin)
         Status: In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1486041

Title:
  IntegrityError: NOT NULL constraint failed: tags.resource_id during
  instance_tag_set

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  Steps to reproduce:

   1. create instance
   2. set ['tag1', 'tag2'] to the instance
   3. set ['tag1'] to the instance

  Expected result:
      tags were added.

  Actual result:

      2015-08-18 16:26:36,601 ERROR [oslo_db.sqlalchemy.exc_filters] DBAPIError exception wrapped from (sqlite3.IntegrityError) NOT NULL constraint failed: tags.resource_id [SQL: u'INSERT INTO tags DEFAULT VALUES']
      Traceback (most recent call last):
        File "/opt/stack/nova/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
          context)
        File "/opt/stack/nova/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
          cursor.execute(statement, parameters)
      IntegrityError: NOT NULL constraint failed: tags.resource_id

  It happens because list 'to_add' in method 'instance_tag_set' is empty
  in second case. It's empty because on step 3 must delete one tag and
  create zero tags. So to fix bug we must check list to_add.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1486041/+subscriptions


Follow ups