wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
748 stars 729 forks source link

[ Migration IS 7.0.0 ] - Error while publishing the event: POST_ADD_EXTERNAL_CLAIM #20114

Closed aaujayasena closed 8 months ago

aaujayasena commented 8 months ago

Describe the issue: Error when claim mapping.

https://github.com/wso2/product-is/assets/39077751/36f64df0-b025-471f-8185-023122c28207

[2024-03-28 11:32:22,961] [d56f6be5-30af-46c9-b8c1-dc7d2fd64f2a] ERROR {org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataEventPublisherProxy} - Error while publishing the event: POST_ADD_EXTERNAL_CLAIM. org.wso2.carbon.identity.event.IdentityEventException: An error occurred while adding the external claim attribute1
    at org.wso2.carbon.identity.organization.management.application.handler.OrgClaimMgtHandler.handleAddExternalClaim(OrgClaimMgtHandler.java:395)
    at org.wso2.carbon.identity.organization.management.application.handler.OrgClaimMgtHandler.handleEvent(OrgClaimMgtHandler.java:93)
    at org.wso2.carbon.identity.event.services.IdentityEventServiceImpl.handleEvent(IdentityEventServiceImpl.java:56)
    at org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataEventPublisherProxy.doPublishEvent(ClaimMetadataEventPublisherProxy.java:257)
    at org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataEventPublisherProxy.publishPostAddExternalClaim(ClaimMetadataEventPublisherProxy.java:194)
    at org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementServiceImpl.addExternalClaim(ClaimMetadataManagementServiceImpl.java:380)
    at org.wso2.carbon.identity.organization.management.application.handler.OrgClaimMgtHandler.handleAddExternalClaim(OrgClaimMgtHandler.java:381)
    at org.wso2.carbon.identity.organization.management.application.handler.OrgClaimMgtHandler.handleEvent(OrgClaimMgtHandler.java:93)
    at org.wso2.carbon.identity.event.services.IdentityEventServiceImpl.handleEvent(IdentityEventServiceImpl.java:56)
    at org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataEventPublisherProxy.doPublishEvent(ClaimMetadataEventPublisherProxy.java:257)
    at org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataEventPublisherProxy.publishPostAddExternalClaim(ClaimMetadataEventPublisherProxy.java:194)
    at org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementServiceImpl.addExternalClaim(ClaimMetadataManagementServiceImpl.java:380)
    at org.wso2.carbon.identity.rest.api.server.claim.management.v1.core.ServerClaimManagementService.addExternalClaim(ServerClaimManagementService.java:720)
    at org.wso2.carbon.identity.rest.api.server.claim.management.v1.impl.ClaimManagementApiServiceImpl.addExternalClaim(ClaimManagementApiServiceImpl.java:59)
    at org.wso2.carbon.identity.rest.api.server.claim.management.v1.ClaimManagementApi.addExternalClaim(ClaimManagementApi.java:100)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:304)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:555)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:279)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:661)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:425)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:357)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:294)
    at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:147)
    at org.wso2.carbon.identity.context.rewrite.valve.OrganizationContextRewriteValve.invoke(OrganizationContextRewriteValve.java:123)
    at org.wso2.carbon.tomcat.ext.valves.SameSiteCookieValve.invoke(SameSiteCookieValve.java:38)
    at org.wso2.carbon.identity.cors.valve.CORSValve.invoke(CORSValve.java:83)
    at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:183)
    at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:144)
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:110)
    at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:71)
    at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:152)
    at org.wso2.carbon.extension.identity.x509Certificate.valve.X509CertificateAuthenticationValve.invoke(X509CertificateAuthenticationValve.java:59)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670)
    at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:63)
    at org.wso2.carbon.tomcat.ext.valves.RequestEncodingValve.invoke(RequestEncodingValve.java:49)
    at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:137)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.wso2.carbon.identity.claim.metadata.mgt.exception.ClaimMetadataClientException: Claim URI : attribute1 already exists for claim dialect : attribute1
    at org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementServiceImpl.addExternalClaim(ClaimMetadataManagementServiceImpl.java:362)
    at org.wso2.carbon.identity.organization.management.application.handler.OrgClaimMgtHandler.handleAddExternalClaim(OrgClaimMgtHandler.java:381)
    ... 70 more

How to reproduce: Environment

  1. In the old IS version, no specific data was created initially. The process involved pointing to the database and starting the server.
  2. After the completion of the initial setup, the migration documentation configurations were followed for new setup.
  3. The migration process included pointing to the same database and starting the server again.
  4. Upon Custom Attribute Mapping after the migration, errors were encountered. migration docs 7.0.0 up to Step 4. Running the migration client

Expected behavior: No error should be happend

Environment information (Please complete the following information; remove any unnecessary fields) :


Optional Fields

Related issues:

Suggested labels:

aaujayasena commented 8 months ago

This issue moved to a another repo. Hence closing the issue.