create identity endpoints failing with pymysql.err.IntegrityError

Bug #1778023 reported by kirandevraaj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Expired
Undecided
Unassigned

Bug Description

create identity endpoints failing with openstack master branch (Rocky).

2018-06-21 08:15:53.181 11762 WARNING keystone.middleware.auth [-] The use of the '[DEFAULT] admin_token' configurationoption presents a significant security risk and should not be set. This
 option is deprecated in favor of using 'keystone-manage bootstrap' and will be removed in a future release.
2018-06-21 08:15:53.182 11762 DEBUG keystone.middleware.auth [req-cb443a65-b75c-424a-a47d-45017215967f - - - - -] RBAC: auth_context: {} fill_context /opt/mhos/openstack/keystone/lib/python2
.7/site-packages/keystone/middleware/auth.py:247
2018-06-21 08:15:53.183 11762 DEBUG keystone.server.flask.application [req-cb443a65-b75c-424a-a47d-45017215967f - - - - -] Dispatching request to legacy mapper: /v3/endpoints __call__ /opt/m
hos/openstack/keystone/lib/python2.7/site-packages/keystone/server/flask/application.py:120
2018-06-21 08:15:53.184 11762 DEBUG keystone.server.flask.application [req-cb443a65-b75c-424a-a47d-45017215967f - - - - -] SCRIPT_NAME: `/v3`, PATH_INFO: `/endpoints` __call__ /opt/mhos/open
stack/keystone/lib/python2.7/site-packages/keystone/server/flask/application.py:182
2018-06-21 08:15:53.257 11762 INFO keystone.common.wsgi [req-cb443a65-b75c-424a-a47d-45017215967f - - - - -] POST http://192.168.7.7:35357/v3/endpoints
2018-06-21 08:15:53.257 11762 WARNING keystone.common.controller [req-cb443a65-b75c-424a-a47d-45017215967f - - - - -] RBAC: Bypassing authorization
2018-06-21 08:15:53.291 11762 DEBUG oslo_db.sqlalchemy.engines [req-cb443a65-b75c-424a-a47d-45017215967f - - - - -] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_
DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /opt/mhos/openstack/keystone/lib/python2.7/site-packages/oslo_db
/sqlalchemy/engines.py:308
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi [req-cb443a65-b75c-424a-a47d-45017215967f - - - - -] (pymysql.err.IntegrityError) (1452, u'Cannot add or update a child row: a foreig
n key constraint fails (`keystone`.`endpoint`, CONSTRAINT `fk_endpoint_region_id` FOREIGN KEY (`region_id`) REFERENCES `region` (`id`))') [SQL: u'INSERT INTO endpoint (id, legacy_endpoint_id
, interface, region_id, service_id, url, enabled, extra) VALUES (%(id)s, %(legacy_endpoint_id)s, %(interface)s, %(region_id)s, %(service_id)s, %(url)s, %(enabled)s, %(extra)s)'] [parameters:
 {'region_id': u'SC2', 'extra': '{}', 'url': u'http://192.168.7.10:5000/v3', 'enabled': 1, 'legacy_endpoint_id': None, 'interface': u'public', 'service_id': u'a12dce51d3304bcfa39706394f7376d
6', 'id': '6cc0281f646149feb71d9033c122a1e3'}] (Background on this error at: http://sqlalche.me/e/gkpj): DBReferenceError: (pymysql.err.IntegrityError) (1452, u'Cannot add or update a child
row: a foreign key constraint fails (`keystone`.`endpoint`, CONSTRAINT `fk_endpoint_region_id` FOREIGN KEY (`region_id`) REFERENCES `region` (`id`))') [SQL: u'INSERT INTO endpoint (id, legac
y_endpoint_id, interface, region_id, service_id, url, enabled, extra) VALUES (%(id)s, %(legacy_endpoint_id)s, %(interface)s, %(region_id)s, %(service_id)s, %(url)s, %(enabled)s, %(extra)s)']
 [parameters: {'region_id': u'SC2', 'extra': '{}', 'url': u'http://192.168.7.10:5000/v3', 'enabled': 1, 'legacy_endpoint_id': None, 'interface': u'public', 'service_id': u'a12dce51d3304bcfa3
9706394f7376d6', 'id': '6cc0281f646149feb71d9033c122a1e3'}] (Background on this error at: http://sqlalche.me/e/gkpj)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi Traceback (most recent call last):
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/keystone/common/wsgi.py", line 211, in __call__
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi result = method(req, **params)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/keystone/common/controller.py", line 58, in inner
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi return f(self, request, *args, **kwargs)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/keystone/catalog/controllers.py", line 196, in create_endpoint
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi ref['id'], ref, initiator=request.audit_initiator
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/keystone/common/manager.py", line 116, in wrapped
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi __ret_val = __f(*args, **kwargs)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/keystone/catalog/core.py", line 182, in create_endpoint
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi ref = self.driver.create_endpoint(endpoint_id, endpoint_ref)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/keystone/catalog/backends/sql.py", line 226, in create_endpoint
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi return endpoint_ref.to_dict()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/contextlib.py", line 24, in __exit__
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self.gen.next()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1042, in _transaction_scop
e
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi yield resource
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/contextlib.py", line 24, in __exit__
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self.gen.next()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 652, in _session
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self.session.rollback()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self.force_reraise()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi six.reraise(self.type_, self.value, self.tb)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 649, in _session
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self._end_session_transaction(self.session)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 677, in _end_session_trans
action
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi session.commit()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 943, in commit
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self.transaction.commit()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 467, in commit
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self._prepare_impl()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 447, in _prepare_impl
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self.session.flush()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2254, in flush
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self._flush(objects)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2380, in _flush
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi transaction.rollback(_capture_exception=True)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi compat.reraise(exc_type, exc_value, exc_tb)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2344, in _flush
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi flush_context.execute()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 391, in execute
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi rec.execute(self)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 556, in execute
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi uow
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 181, in save_obj
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi mapper, table, insert)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 830, in _emit_insert_statements
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi execute(statement, multiparams)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi return meth(self, multiparams, params)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi return connection._execute_clauseelement(self, multiparams, params)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi compiled_sql, distilled_params
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi context)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1409, in _handle_dbapi_exception
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi util.raise_from_cause(newraise, exc_info)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi reraise(type(exception), exception, tb=exc_tb, cause=cause)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi context)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/openstack/keystone/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 508, in do_execute
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi cursor.execute(statement, parameters)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi result = self._query(query)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi conn.query(q)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/connections.py", line 893, in query
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/connections.py", line 1103, in _read_query_result
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi result.read()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/connections.py", line 1396, in read
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi first_packet = self.connection._read_packet()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/connections.py", line 1059, in _read_packet
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi packet.check_error()
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi err.raise_mysql_exception(self._data)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi File "/opt/mhos/python/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi raise errorclass(errno, errval)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi DBReferenceError: (pymysql.err.IntegrityError) (1452, u'Cannot add or update a child row: a foreign key constraint fails (`keystone`.`endpoint`, CONSTRAINT `fk_endpoint_region_id` FOREIGN KEY (`region_id`) REFERENCES `region` (`id`))') [SQL: u'INSERT INTO endpoint (id, legacy_endpoint_id, interface, region_id, service_id, url, enabled, extra) VALUES (%(id)s, %(legacy_endpoint_id)s, %(interface)s, %(region_id)s, %(service_id)s, %(url)s, %(enabled)s, %(extra)s)'] [parameters: {'region_id': u'SC2', 'extra': '{}', 'url': u'http://192.168.7.10:5000/v3', 'enabled': 1, 'legacy_endpoint_id': None, 'interface': u'public', 'service_id': u'a12dce51d3304bcfa39706394f7376d6', 'id': '6cc0281f646149feb71d9033c122a1e3'}] (Background on this error at: http://sqlalche.me/e/gkpj)
2018-06-21 08:15:53.358 11762 ERROR keystone.common.wsgi
[pid: 11762|app: 0|req: 1/4] 192.168.1.177 () {40 vars in 524 bytes} [Thu Jun 21 08:15:53 2018] POST /v3/endpoints => generated 143 bytes in 191 msecs (HTTP/1.1 500) 4 headers in 177 bytes (1 switches on core 0)

Revision history for this message
Lance Bragstad (lbragstad) wrote :

I'm not able to recreate this without more information. Are you able to share some information about your deployment? What database are you running? What does the request look like?

Changed in keystone:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Identity (keystone) because there has been no activity for 60 days.]

Changed in keystone:
status: Incomplete → Expired
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.