Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-11635

When using DB2 repo, read requests with relationship expansion and update requests are not working anymore

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.5.0
    • Fix Version/s: 6.5.0
    • Labels:
    • Environment:
      OpenIDM version "6.5.0-SNAPSHOT" with DB2 repo
    • Target Version/s:
    • Verified Version/s:
    • Story Points:
      2
    • Sprint:
      OpenIDM Sprint 6.5-8

      Description

      When using DB2 repo, read requests with relationship expansion and update requests are not working anymore.
      This regression happened in one of those 2 commits:

      Here is an example of the failure for relationship expansion:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin"  --request GET "curl http://localhost:8080/openidm/managed/user?_queryFilter=userName%20eq%20"bjean"&_fields=reports/*"
      {"code":500,"reason":"Internal Server Error","message":"DB reported failure executing query."}
      

      And we can see that without the expansion (/*) it works OK:

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin"  --request GET "curl http://localhost:8080/openidm/managed/user?_queryFilter=userName%20eq%20"bjean"&_fields=manager"
      {"result":[{"_id":"billyjean","_rev":"0","manager":null}],"resultCount":1,"pagedResultsCookie":null,"totalPagedResultsPolicy":"NONE","totalPagedResults":-1,"remainingPagedResults":-1}
      

      Here are examples of update failures (PATCH and PUT)

      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '[{"operation":"add","field":"mail","value":"change@patch.com"}]' --request PATCH "http://localhost:8080/openidm/managed/user/ricksutter"
      {"code":500,"reason":"Internal Server Error","message":"DB reported failure executing query."}
      
      curl --header "X-OpenIDM-Username: openidm-admin" --header "X-OpenIDM-Password: openidm-admin" --header "Content-Type: application/json" --data '{"userName": "rsutter", "givenName": "rick", "sn": "sutter", "mail": "new@mail.com", "telephoneNumber": "6669876987", "password": "Th3Password", "description": "Just another user"}' --request PUT "http://localhost.localdomain:8080/openidm/managed/user/ricksutter"
      {"code":500,"reason":"Internal Server Error","message":"DB reported failure executing query."}
      

      And here is what we see in the log:

      [877] Sep 03, 2018 11:36:20.851 PM org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3 lambda$handleRequestWithLogging$8
      WARNING: Resource exception: 500 Internal Server Error: "DB reported failure executing query."
      org.forgerock.json.resource.InternalServerErrorException: DB reported failure executing query.
      	at org.forgerock.openidm.managed.ManagedObjectSet.update(ManagedObjectSet.java:745)
      	at org.forgerock.openidm.managed.ManagedObjectSet.patchResource(ManagedObjectSet.java:1430)
      	at org.forgerock.openidm.managed.ManagedObjectSet.patchResourceById(ManagedObjectSet.java:1352)
      	at org.forgerock.openidm.managed.ManagedObjectSet.patchInstance(ManagedObjectSet.java:1329)
      	at org.forgerock.json.resource.InterfaceCollectionInstance.handlePatch(InterfaceCollectionInstance.java:48)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:85)
      	at org.forgerock.json.resource.Resources$CollectionInstanceIdContextFilter.filterPatch(Resources.java:516)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.json.resource.FilterChain.handlePatch(FilterChain.java:244)
      	at org.forgerock.json.resource.Router.handlePatch(Router.java:293)
      	at org.forgerock.openidm.managed.ManagedObjectService$ManagedObjectSetRequestHandler.handlePatch(ManagedObjectService.java:255)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:85)
      	at org.forgerock.openidm.notification.NotificationFilter.filterPatch(NotificationFilter.java:231)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.notification.NotificationFilter.filterPatch(NotificationFilter.java:231)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.json.resource.FilterChain.handlePatch(FilterChain.java:244)
      	at org.forgerock.json.resource.Router.handlePatch(Router.java:293)
      	at org.forgerock.openidm.managed.ManagedObjectService.handlePatch(ManagedObjectService.java:402)
      	at org.forgerock.json.resource.Router.handlePatch(Router.java:293)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:85)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:74)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.lambda$filterPatch$3(DelegatedAdminFilter.java:198)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:258)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:222)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterRequest(DelegatedAdminFilter.java:252)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterPatch(DelegatedAdminFilter.java:198)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:72)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.audit.filter.AuditFilter.lambda$filterPatch$3(AuditFilter.java:131)
      	at org.forgerock.openidm.audit.filter.AuditFilter.logAuditAccessEntry(AuditFilter.java:169)
      	at org.forgerock.openidm.audit.filter.AuditFilter.filterPatch(AuditFilter.java:131)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:72)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.lambda$filterPatch$3(ServletConnectionFactory.java:397)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.handleRequestWithLogging(ServletConnectionFactory.java:436)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.filterPatch(ServletConnectionFactory.java:397)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterPatch(PassthroughFilter.java:60)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterPatch(PassthroughFilter.java:60)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:72)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.json.resource.FilterChain.handlePatch(FilterChain.java:244)
      	at org.forgerock.json.resource.InternalConnection.patchAsync(InternalConnection.java:66)
      	at org.forgerock.json.resource.AbstractConnectionWrapper.patchAsync(AbstractConnectionWrapper.java:155)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.lambda$patchAsync$9(ServletConnectionFactory.java:346)
      	at org.forgerock.openidm.metrics.MetricsCollector.time(MetricsCollector.java:112)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.time(ServletConnectionFactory.java:292)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.patchAsync(ServletConnectionFactory.java:346)
      	at org.forgerock.json.resource.http.RequestRunner.visitPatchRequest(RequestRunner.java:209)
      	at org.forgerock.json.resource.http.RequestRunner.visitPatchRequest(RequestRunner.java:82)
      	at org.forgerock.json.resource.Requests$PatchRequestImpl.accept(Requests.java:358)
      	at org.forgerock.json.resource.http.RequestRunner.handleResult(RequestRunner.java:128)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:258)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:247)
      	at org.forgerock.json.resource.http.HttpAdapter.doRequest(HttpAdapter.java:713)
      	at org.forgerock.json.resource.http.HttpAdapter.doPatch(HttpAdapter.java:510)
      	at org.forgerock.json.resource.http.HttpAdapter.handle(HttpAdapter.java:279)
      	at org.forgerock.http.handler.Handlers$HandlerDescribableAsDescribableHandler.handle(Handlers.java:146)
      	at org.forgerock.http.filter.OptionsFilter.filter(OptionsFilter.java:69)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.routing.Router.handle(Router.java:100)
      	at org.forgerock.http.swagger.OpenApiRequestFilter.filter(OpenApiRequestFilter.java:63)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.openidm.auth.ProfileEnhancementCheckFilter.filter(ProfileEnhancementCheckFilter.java:149)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.openidm.auth.LoginCountFilter.filter(LoginCountFilter.java:63)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.grantAccess(AuthenticationFramework.java:188)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.lambda$onValidateRequestSuccess$1(AuthenticationFramework.java:181)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:258)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:247)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.validateRequest(AuthenticationFramework.java:144)
      	at org.forgerock.caf.authentication.framework.AuthenticationFramework.processMessage(AuthenticationFramework.java:134)
      	at org.forgerock.caf.authentication.framework.AuthenticationFilter.filter(AuthenticationFilter.java:84)
      	at org.forgerock.openidm.auth.AuthFilterWrapper.filter(AuthFilterWrapper.java:87)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.filter.TransactionIdInboundFilter.filter(TransactionIdInboundFilter.java:86)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:252)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      	at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)
      	at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:301)
      	at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:309)
      	at com.sun.proxy.$Proxy69.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:257)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:220)
      	at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:309)
      	at com.sun.proxy.$Proxy69.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:276)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:499)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.forgerock.json.resource.InternalServerErrorException: DB reported failure executing query.
      	at org.forgerock.openidm.repo.jdbc.impl.GraphTableHandler.executeQueryStatement(GraphTableHandler.java:510)
      	at org.forgerock.openidm.repo.jdbc.impl.GraphTableHandler.prepareAndExecuteQuery(GraphTableHandler.java:337)
      	at org.forgerock.openidm.repo.jdbc.impl.GraphTableHandler.read(GraphTableHandler.java:270)
      	at org.forgerock.openidm.repo.jdbc.impl.JDBCRepoService.lambda$handleRead$1(JDBCRepoService.java:256)
      	at org.forgerock.openidm.metrics.MetricsCollector.time(MetricsCollector.java:112)
      	at org.forgerock.openidm.repo.jdbc.impl.JDBCRepoService.handleRead(JDBCRepoService.java:243)
      	at org.forgerock.json.resource.Router.handleRead(Router.java:331)
      	at org.forgerock.json.resource.Router.handleRead(Router.java:331)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:105)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:94)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:103)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:94)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:103)
      	at org.forgerock.openidm.audit.filter.AuditFilter.lambda$filterRead$5(AuditFilter.java:143)
      	at org.forgerock.openidm.audit.filter.AuditFilter.logAuditAccessEntry(AuditFilter.java:169)
      	at org.forgerock.openidm.audit.filter.AuditFilter.filterRead(AuditFilter.java:143)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterRead(MutableFilterDecorator.java:96)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:92)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:103)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.lambda$filterRead$5(ServletConnectionFactory.java:409)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.handleRequestWithLogging(ServletConnectionFactory.java:436)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.filterRead(ServletConnectionFactory.java:409)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:103)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterRead(PassthroughFilter.java:72)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterRead(MutableFilterDecorator.java:96)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterRead(MutableFilterDecorator.java:96)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:103)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:94)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:103)
      	at org.forgerock.json.resource.FilterChain.handleRead(FilterChain.java:256)
      	at org.forgerock.json.resource.InternalConnection.readAsync(InternalConnection.java:81)
      	at org.forgerock.json.resource.AbstractConnectionWrapper.readAsync(AbstractConnectionWrapper.java:203)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.lambda$readAsync$3(ServletConnectionFactory.java:315)
      	at org.forgerock.openidm.metrics.MetricsCollector.time(MetricsCollector.java:112)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.time(ServletConnectionFactory.java:292)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.readAsync(ServletConnectionFactory.java:315)
      	at org.forgerock.json.resource.AbstractConnectionWrapper.readAsync(AbstractConnectionWrapper.java:203)
      	at org.forgerock.openidm.relationship.AugmentingIDMConnectionFactoryProxy$ConnectionRequestHandlerAdaptor.handleRead(AugmentingIDMConnectionFactoryProxy.java:188)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:105)
      	at org.forgerock.openidm.relationship.impl.augmentation.FieldAugmentationFilter.filterRead(FieldAugmentationFilter.java:107)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:92)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:103)
      	at org.forgerock.json.resource.FilterChain.handleRead(FilterChain.java:256)
      	at org.forgerock.openidm.relationship.AugmentingIDMConnectionFactoryProxy$RequestHandlerConnectionAdaptor.readAsync(AugmentingIDMConnectionFactoryProxy.java:258)
      	at org.forgerock.openidm.managed.ManagedObjectSet.update(ManagedObjectSet.java:739)
      	... 124 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jason Jason Lemay
                Reporter:
                laurent.bristiel Laurent Bristiel [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: