[ZED][Kyestone][Application_credentials] Conflict occurred attempting to store application_credential - Duplicate entry found
Vish Mudemela
vmudemela at gmail.com
Tue Jan 31 22:23:17 UTC 2023
Hello all,
1. I have created application credentials with the name "sa_capacity" as
role - reader.
2. I have deleted application credentials , I wanted to add some access
rules.
3. verified by command - *openstack application credential show sa_capacity*
got output as *"**No application credential with a name or ID of
'sa_capacity' exists."*
4.verified using *openstack application credential list *, confirmed there
is no application credential with name "sa_capacity"
5. no application creds on my username too *"openstack application
credential list --user <<username>> --user-domain <<domain_name>>"*
6. Trying to recreate application credentials with the *same
name(sa_capacity) *with a role reader and added some access rules. I got an
error* "Conflict occurred attempting to store application_credential -
Duplicate entry found with name sa_capacity. (HTTP 409) (Request-ID:
req-0e58b336-a59b-490d-b946-30c28ca44777)"*
*7.* I even tried with a different name that's never been configured*
"sa_capcity_1"* but it says *Conflict occurred attempting to store
application_credential - Duplicate entry found with name sa_capacity_1.
(HTTP 409)*
Any idea what's wrong here?
Below are the keystone logs.
*keystone logs:*
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/common/manager.py",
line 115, in wrapped
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application
__ret_val = __f(*args, **kwargs)
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/application_credential/core.py",
line 137, in create_application_credential
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application ref
= self.driver.create_application_credential(
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/common/sql/core.py",
line 563, in wrapper
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application
raise exception.Conflict(type=conflict_type,
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application
keystone.exception.Conflict: Conflict occurred attempting to store
application_credential - Duplicate entry found with name sa_capacity.
2023-01-31 21:51:07.193 670 ERROR keystone.server.flask.application
2023-01-31 21:53:10.461 669 INFO keystone.token.token_formatters [None
req-75dc9499-18aa-4f55-8a63-633b9ef316c5
910a75448974f088b01f96e09db0667737b84a5663dbaa2a142c4648187f40de
e68db2302b1d44beb5d62c6a6268ab26 - - e025affd9237457a9d7036fb10a9b626
e025affd9237457a9d7036fb10a9b626] Fernet token created with length of 268
characters, which exceeds 255 characters
2023-01-31 21:53:14.131 673 INFO keystone.token.token_formatters [None
req-66aa818c-754e-46bf-a393-6115eb14b2d3
910a75448974f088b01f96e09db0667737b84a5663dbaa2a142c4648187f40de
e68db2302b1d44beb5d62c6a6268ab26 - - e025affd9237457a9d7036fb10a9b626
e025affd9237457a9d7036fb10a9b626] Fernet token created with length of 268
characters, which exceeds 255 characters
2023-01-31 21:53:55.977 671 WARNING py.warnings [None
req-0e58b336-a59b-490d-b946-30c28ca44777
fba6720038a31a4c1cf2e001022466a504d6d78ec9b10ac1a8adbfd7b8902fdc
e68db2302b1d44beb5d62c6a6268ab26 - - e025affd9237457a9d7036fb10a9b626
e025affd9237457a9d7036fb10a9b626]
/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/application_credential/backends/sql.py:144:
SAWarning: New instance <ApplicationCredentialAccessRuleModel at
0x7f714f74c910> with identity key (<class
'keystone.application_credential.backends.sql.ApplicationCredentialAccessRuleModel'>,
(96, 249), None) conflicts with persistent instance
<ApplicationCredentialAccessRuleModel at 0x7f714f74ec80>
external_id=access_rule['id']).first()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application [None
req-0e58b336-a59b-490d-b946-30c28ca44777
fba6720038a31a4c1cf2e001022466a504d6d78ec9b10ac1a8adbfd7b8902fdc
e68db2302b1d44beb5d62c6a6268ab26 - - e025affd9237457a9d7036fb10a9b626
e025affd9237457a9d7036fb10a9b626] Conflict occurred attempting to store
application_credential - Duplicate entry found with name sa_capacity.:
keystone.exception.Conflict: Conflict occurred attempting to store
application_credential - Duplicate entry found with name sa_capacity.
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
Traceback (most recent call last):
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py",
line 1900, in _execute_context
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
self.dialect.do_execute(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py",
line 732, in do_execute
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
cursor.execute(statement, parameters)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/cursors.py", line
148, in execute
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
result = self._query(query)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/cursors.py", line
310, in _query
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
conn.query(q)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 548, in query
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 775, in _read_query_result
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
result.read()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 1156, in read
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
first_packet = self.connection._read_packet()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 725, in _read_packet
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
packet.raise_for_error()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/protocol.py",
line 221, in raise_for_error
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
err.raise_mysql_exception(self._data)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/err.py", line
143, in raise_mysql_exception
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
raise errorclass(errno, errval)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
pymysql.err.IntegrityError: (1062, "Duplicate entry '96-249' for key
'PRIMARY'")
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application The
above exception was the direct cause of the following exception:
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
Traceback (most recent call last):
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/common/sql/core.py",
line 528, in wrapper
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
return method(*args, **kwargs)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/application_credential/backends/sql.py",
line 144, in create_application_credential
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
external_id=access_rule['id']).first()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/query.py",
line 2823, in first
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
return self.limit(1)._iter().first()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/query.py",
line 2907, in _iter
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
result = self.session.execute(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py",
line 1660, in execute
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application ) =
compile_state_cls.orm_pre_session_exec(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/context.py",
line 316, in orm_pre_session_exec
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
session._autoflush()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py",
line 2246, in _autoflush
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
self.flush()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py",
line 3383, in flush
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
self._flush(objects)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py",
line 3522, in _flush
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
with util.safe_reraise():
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py",
line 70, in __exit__
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
compat.raise_(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py",
line 208, in raise_
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
raise exception
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py",
line 3483, in _flush
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
flush_context.execute()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py",
line 456, in execute
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
rec.execute(self)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py",
line 630, in execute
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
util.preloaded.orm_persistence.save_obj(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py",
line 245, in save_obj
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
_emit_insert_statements(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py",
line 1097, in _emit_insert_statements
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application c =
connection._execute_20(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py",
line 1705, in _execute_20
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
return meth(self, args_10style, kwargs_10style, execution_options)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/sql/elements.py",
line 333, in _execute_on_connection
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
return connection._execute_clauseelement(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py",
line 1572, in _execute_clauseelement
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application ret
= self._execute_context(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py",
line 1943, in _execute_context
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
self._handle_dbapi_exception(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py",
line 2122, in _handle_dbapi_exception
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
util.raise_(newraise, with_traceback=exc_info[2], from_=e)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/util/compat.py",
line 208, in raise_
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
raise exception
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py",
line 1900, in _execute_context
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
self.dialect.do_execute(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py",
line 732, in do_execute
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
cursor.execute(statement, parameters)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/cursors.py", line
148, in execute
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
result = self._query(query)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/cursors.py", line
310, in _query
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
conn.query(q)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 548, in query
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 775, in _read_query_result
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
result.read()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 1156, in read
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
first_packet = self.connection._read_packet()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/connections.py",
line 725, in _read_packet
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
packet.raise_for_error()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/protocol.py",
line 221, in raise_for_error
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
err.raise_mysql_exception(self._data)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/pymysql/err.py", line
143, in raise_mysql_exception
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
raise errorclass(errno, errval)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
oslo_db.exception.DBDuplicateEntry: (pymysql.err.IntegrityError) (1062,
"Duplicate entry '96-249' for key 'PRIMARY'")
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application [SQL:
INSERT INTO application_credential_access_rule (application_credential_id,
access_rule_id) VALUES (%(application_credential_id)s, %(access_rule_id)s)]
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
[parameters: {'application_credential_id': 96, 'access_rule_id': 249}]
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
(Background on this error at: https://sqlalche.me/e/14/gkpj)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application During
handling of the above exception, another exception occurred:
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
Traceback (most recent call last):
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/flask/app.py", line 1820,
in full_dispatch_request
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application rv
= self.dispatch_request()
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/flask/app.py", line 1796,
in dispatch_request
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/flask_restful/__init__.py",
line 467, in wrapper
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
resp = resource(*args, **kwargs)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/flask/views.py", line
107, in view
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/flask_restful/__init__.py",
line 582, in dispatch_request
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
resp = meth(*args, **kwargs)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/api/users.py",
line 669, in post
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application ref
= app_cred_api.create_application_credential(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/common/manager.py",
line 115, in wrapped
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
__ret_val = __f(*args, **kwargs)
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/application_credential/core.py",
line 137, in create_application_credential
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application ref
= self.driver.create_application_credential(
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application File
"/var/lib/kolla/venv/lib/python3.10/site-packages/keystone/common/sql/core.py",
line 563, in wrapper
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
raise exception.Conflict(type=conflict_type,
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
keystone.exception.Conflict: Conflict occurred attempting to store
application_credential - Duplicate entry found with name sa_capacity.
2023-01-31 21:53:55.981 671 ERROR keystone.server.flask.application
Thanks
Vish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.openstack.org/pipermail/openstack-discuss/attachments/20230131/0c39f6b3/attachment-0001.htm>
More information about the openstack-discuss
mailing list