uchicago / shibboleth-oidc

OpenID Connect support for the Shibboleth Identity Provider v3
Apache License 2.0
81 stars 19 forks source link

ShibbolethClientRepositoryBootstrapper running into duplicate keys when trying to update client_details #54

Open lhoekenga opened 7 years ago

lhoekenga commented 7 years ago

The ShibbolethClientRepositoryBootstrapper seems to have some issues trying update clients defined oidc-protocol.xml that already exists in the client_details table.

I might suggest that if it exists in oidc-protocol.xml, that that definition should be authoritative?

2017-10-20 16:36:35,758 - WARN [net.shibboleth.idp.oidc.client.ShibbolethClientRepositoryBootstrapper:39] - Could not update client id [client] in the repository
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'client' for key 'client_id'
Error Code: 1062
Call: INSERT INTO client_details (access_token_validity_seconds, allow_introspection, application_type, clear_access_tokens_on_refresh, client_description, client_id, client_name, client_secret, client_uri, code_challenge_method, created_at, default_max_age, device_code_validity_seconds, dynamically_registered, id_token_encrypted_response_alg, id_token_encrypted_response_enc, id_token_signed_response_alg, id_token_validity_seconds, initiate_login_uri, jwks, jwks_uri, logo_uri, policy_uri, refresh_token_validity_seconds, request_object_signing_alg, require_auth_time, reuse_refresh_tokens, sector_identifier_uri, software_id, software_statement, software_version, subject_type, token_endpoint_auth_method, token_endpoint_auth_signing_alg, tos_uri, user_info_encrypted_response_alg, user_info_encrypted_response_enc, user_info_signed_response_alg) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    bind => [38 parameters bound]
Query: InsertObjectQuery(org.mitre.oauth2.model.ClientDetailsEntity@4ef11db9)
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:879)
Caused by: org.eclipse.persistence.exceptions.DatabaseException:
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'client' for key 'client_id'
Error Code: 1062
Call: INSERT INTO client_details (access_token_validity_seconds, allow_introspection, application_type, clear_access_tokens_on_refresh, client_description, client_id, client_name, client_secret, client_uri, code_challenge_method, created_at, default_max_age, device_code_validity_seconds, dynamically_registered, id_token_encrypted_response_alg, id_token_encrypted_response_enc, id_token_signed_response_alg, id_token_validity_seconds, initiate_login_uri, jwks, jwks_uri, logo_uri, policy_uri, refresh_token_validity_seconds, request_object_signing_alg, require_auth_time, reuse_refresh_tokens, sector_identifier_uri, software_id, software_statement, software_version, subject_type, token_endpoint_auth_method, token_endpoint_auth_signing_alg, tos_uri, user_info_encrypted_response_alg, user_info_encrypted_response_enc, user_info_signed_response_alg) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    bind => [38 parameters bound]
Query: InsertObjectQuery(org.mitre.oauth2.model.ClientDetailsEntity@4ef11db9)
    at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'client' for key 'client_id'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)