Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG : we got failure during RPT upgrade #1131

Closed
yuriyz opened this issue Aug 8, 2019 · 1 comment
Closed

BUG : we got failure during RPT upgrade #1131

yuriyz opened this issue Aug 8, 2019 · 1 comment
Assignees
Labels
bug bug in code
Milestone

Comments

@yuriyz
Copy link
Contributor

yuriyz commented Aug 8, 2019

Describe the issue

2019-08-08 10:36:51,978 ERROR [qtp804611486-9] [org.gluu.oxauth.uma.service.UmaRptService] (UmaRptService.java:144) - Failed to update entry: oxAuthTokenCode=83a88a2d06638170ec9d6cca963747e8e072c3c4e3a69c32cce0f47c0f138f06,ou=uma_rpt,ou=tokens,o=gluu
org.gluu.persist.exception.EntryPersistenceException: Failed to update entry: oxAuthTokenCode=83a88a2d06638170ec9d6cca963747e8e072c3c4e3a69c32cce0f47c0f138f06,ou=uma_rpt,ou=tokens,o=gluu
	at org.gluu.persist.ldap.impl.LdapEntryManager.merge(LdapEntryManager.java:286) ~[oxcore-persistence-ldap-4.0.0-SNAPSHOT.jar:?]
	at org.gluu.persist.impl.BaseEntryManager.merge(BaseEntryManager.java:215) ~[oxcore-persistence-core-4.0.0-SNAPSHOT.jar:?]
	at org.gluu.persist.ldap.impl.LdapEntryManager.merge(LdapEntryManager.java:117) ~[oxcore-persistence-ldap-4.0.0-SNAPSHOT.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:106) ~[weld-core-impl-3.1.1.Final.jar:3.1.1.Final]
	at org.gluu.persist.EntityManager$PersistenceEntryManager$1948486608$Proxy$_$$_WeldClientProxy.merge(Unknown Source) ~[weld-core-impl-3.1.1.Final.jar:?]
	at org.gluu.oxauth.uma.service.UmaRptService.addPermissionToRPT(UmaRptService.java:141) ~[classes/:?]
	at org.gluu.oxauth.uma.service.UmaRptService.addPermissionToRPT(UmaRptService.java:125) ~[classes/:?]
	at org.gluu.oxauth.uma.service.UmaTokenService.requestRpt(UmaTokenService.java:123) ~[classes/:?]
	at org.gluu.oxauth.token.ws.rs.TokenRestWebServiceImpl.requestAccessToken(TokenRestWebServiceImpl.java:112) ~[classes/:?]
	at org.gluu.oxauth.token.ws.rs.TokenRestWebServiceImpl$Proxy$_$$_WeldClientProxy.requestAccessToken(Unknown Source) ~[classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:510) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:401) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:365) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:361) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:367) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:339) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:312) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:441) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:231) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:137) ~[resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:361) [resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:140) [resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:217) [resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227) [resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.5.1.Final.jar:3.5.1.Final]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [servlet-api-3.1.jar:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215) [websocket-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.gluu.oxserver.filters.AbstractCorsFilter.handleNonCORS(AbstractCorsFilter.java:362) [oxcore-server-4.0.0-SNAPSHOT.jar:?]
	at org.gluu.oxserver.filters.AbstractCorsFilter.doFilter(AbstractCorsFilter.java:139) [oxcore-server-4.0.0-SNAPSHOT.jar:?]
	at org.gluu.oxauth.filter.CorsFilter.doFilter(CorsFilter.java:110) [classes/:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.gluu.oxauth.auth.AuthenticationFilter.processBasicAuth(AuthenticationFilter.java:299) [classes/:?]
	at org.gluu.oxauth.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:135) [classes/:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.gluu.oxauth.audit.debug.ServletLoggingFilter.doFilter(ServletLoggingFilter.java:67) [classes/:?]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.Server.handle(Server.java:503) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) [jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) [jetty-io-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: com.unboundid.ldap.sdk.LDAPException: Entry oxAuthTokenCode=83a88a2d06638170ec9d6cca963747e8e072c3c4e3a69c32cce0f47c0f138f06,ou=uma_rpt,ou=tokens,o=gluu cannot be modified because the change to attribute oxAuthTokenCode would have removed a value used in the RDN
	at com.unboundid.ldap.sdk.LDAPConnection.modify(LDAPConnection.java:2867) ~[unboundid-ldapsdk-4.0.7.jar:4.0.7]
	at com.unboundid.ldap.sdk.AbstractConnectionPool.modify(AbstractConnectionPool.java:1324) ~[unboundid-ldapsdk-4.0.7.jar:4.0.7]
	at org.gluu.persist.ldap.operation.impl.LdapOperationsServiceImpl.modifyEntry(LdapOperationsServiceImpl.java:796) ~[oxcore-persistence-ldap-4.0.0-SNAPSHOT.jar:?]
	at org.gluu.persist.ldap.operation.impl.LdapOperationsServiceImpl.updateEntryImpl(LdapOperationsServiceImpl.java:782) ~[oxcore-persistence-ldap-4.0.0-SNAPSHOT.jar:?]
	at org.gluu.persist.ldap.operation.impl.LdapOperationsServiceImpl.updateEntry(LdapOperationsServiceImpl.java:772) ~[oxcore-persistence-ldap-4.0.0-SNAPSHOT.jar:?]
	at org.gluu.persist.ldap.impl.LdapEntryManager.merge(LdapEntryManager.java:280) ~[oxcore-persistence-ldap-4.0.0-SNAPSHOT.jar:?]
	... 80 more

Steps To Reproduce

Issue is described in support ticket https://support.gluu.org/access-management/7339/uma-step-up-authorization-problem-working-on-316/#at50669

Expected behavior

RPT successfully upgraded

Actual behavior

It failed with exception.

@yuriyz yuriyz added the bug bug in code label Aug 8, 2019
@yuriyz yuriyz added this to the 4.0 milestone Aug 8, 2019
@yuriyz yuriyz self-assigned this Aug 8, 2019
yuriyz added a commit that referenced this issue Aug 8, 2019
…g to ou=tokens. Make sure we never return `upgraded=true` if we got exception during merging. Added assert to fail client test if upgraded=false.

#1131
yuriyz added a commit that referenced this issue Aug 8, 2019
@yuriyz
Copy link
Contributor Author

yuriyz commented Aug 12, 2019

Fixed and test added.

@yuriyz yuriyz closed this as completed Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug in code
Projects
None yet
Development

No branches or pull requests

1 participant