nova-manage create/admin functions doesn't check if objects already exists in database
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
# nova-manage user create foobar
2011-02-06 21:45:53,701 AUDIT nova.auth.manager [-] Created user foobar (admin: False)
export EC2_ACCESS_
export EC2_SECRET_
# nova-manage user create foobar
2011-02-06 21:45:55,567 ERROR nova.exception [-] DB exception wrapped
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: return f(*args, **kwargs)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: self._flush(
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: flush_context.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: rec.execute(self)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: uow
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: execute(statement, params)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: params)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: return self.__
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: cursor.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: self.errorhandl
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: raise errorclass, errorvalue
(nova.exception): TRACE: IntegrityError: (IntegrityError) (1062, "Duplicate entry 'foobar' for key 1") 'INSERT INTO users (created_at, updated_at, deleted_at, deleted, id, name, access_key, secret_key, is_admin) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.
(nova.exception): TRACE:
(IntegrityError) (1062, "Duplicate entry 'foobar' for key 1") 'INSERT INTO users (created_at, updated_at, deleted_at, deleted, id, name, access_key, secret_key, is_admin) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.
The above error may show that the database has not been created.
Please create a database using nova-manage sync db before running this command.
# nova-manage user admin narf
2011-02-06 21:46:52,737 AUDIT nova.auth.manager [-] Created user narf (admin: True)
export EC2_ACCESS_
export EC2_SECRET_
# nova-manage user admin narf
2011-02-06 21:46:54,428 ERROR nova.exception [-] DB exception wrapped
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: return f(*args, **kwargs)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: self._flush(
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: flush_context.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: rec.execute(self)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: uow
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: execute(statement, params)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: params)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: return self.__
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: cursor.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: self.errorhandl
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: raise errorclass, errorvalue
(nova.exception): TRACE: IntegrityError: (IntegrityError) (1062, "Duplicate entry 'narf' for key 1") 'INSERT INTO users (created_at, updated_at, deleted_at, deleted, id, name, access_key, secret_key, is_admin) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.
(nova.exception): TRACE:
(IntegrityError) (1062, "Duplicate entry 'narf' for key 1") 'INSERT INTO users (created_at, updated_at, deleted_at, deleted, id, name, access_key, secret_key, is_admin) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.
The above error may show that the database has not been created.
Please create a database using nova-manage sync db before running this command.
Changed in nova: | |
status: | Confirmed → In Progress |
Changed in nova: | |
status: | In Progress → Triaged |
Looks like the other create functions in nova-manage doesn't check for existing entries, too. Please check all create functions.
# nova-manage project create testing admin python2. 6/site- packages/ nova/exception. py", line 105, in _wrap python2. 6/site- packages/ sqlalchemy/ orm/session. py", line 1397, in flush objects) python2. 6/site- packages/ sqlalchemy/ orm/session. py", line 1478, in _flush execute( ) python2. 6/site- packages/ sqlalchemy/ orm/unitofwork. py", line 304, in execute python2. 6/site- packages/ sqlalchemy/ orm/unitofwork. py", line 448, in execute python2. 6/site- packages/ sqlalchemy/ orm/mapper. py", line 1872, in _save_obj python2. 6/site- packages/ sqlalchemy/ engine/ base.py" , line 1191, in execute python2. 6/site- packages/ sqlalchemy/ engine/ base.py" , line 1271, in _execute_ clauseelement execute_ context( context) python2. 6/site- packages/ sqlalchemy/ engine/ base.py" , line 1302, in __execute_context parameters[ 0], context=context) python2. 6/site- packages/ sqlalchemy/ engine/ base.py" , line 1401, in _cursor_execute python2. 6/site- packages/ sqlalchemy/ engine/ base.py" , line 1394, in _cursor_execute python2. 6/site- packages/ sqlalchemy/ engine/ default. py", line 299, in do_execute execute( statement, parameters) python2. 6/site- packages/ MySQLdb/ cursors. py", line 166, in execute er(self, exc, value) python2. 6/site- packages/ MySQLdb/ connections. py", line 35, in defaulterrorhandler datetime( 2011, 2, 6, 20, 50, 21, 180352), None, None, False, 'testing', 'testing', 'testing', 'admin')
2011-02-06 21:50:21,181 ERROR nova.exception [-] DB exception wrapped
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: return f(*args, **kwargs)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: self._flush(
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: flush_context.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: rec.execute(self)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: uow
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: execute(statement, params)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: params)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: return self.__
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: cursor.
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: self.errorhandl
(nova.exception): TRACE: File "/usr/lib64/
(nova.exception): TRACE: raise errorclass, errorvalue
(nova.exception): TRACE: IntegrityError: (IntegrityError) (1062, "Duplicate entry 'testing' for key 1") 'INSERT INTO projects (created_at, updated_at, deleted_at, deleted, id, name, description, project_manager) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)' (datetime.
(nova.exception): TRACE:
2011-02-06 21:50:21,186 CRITICAL nova.root [-] (IntegrityError) (1062, "Duplicate e...