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

Make deletion of user meta data tolerate missing meta fields

    XMLWordPrintable

    Details

    • Target Version/s:
    • Verified Version/s:
    • Story Points:
      2
    • Sprint:
      2020.05 - IDM, 2020.06 - IDM, 2020.07 - IDM

      Description

      This NPE was observed in some PIT test logs:

      WARNING: Resource exception: 500 Internal Server Error: "Internal Server Error"
      org.forgerock.json.resource.InternalServerErrorException: Internal Server Error
      	at org.forgerock.openidm.managed.ManagedObjectSet.deleteInstance(ManagedObjectSet.java:1291)
      	at org.forgerock.json.resource.InterfaceCollectionInstance.handleDelete(InterfaceCollectionInstance.java:46)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:74)
      	at org.forgerock.json.resource.Resources$CollectionInstanceIdContextFilter.filterDelete(Resources.java:538)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.FilterChain.handleDelete(FilterChain.java:237)
      	at org.forgerock.json.resource.Router.handleDelete(Router.java:279)
      	at org.forgerock.openidm.managed.ManagedObjectService$ManagedObjectSetRequestHandler.handleDelete(ManagedObjectService.java:286)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:74)
      	at org.forgerock.openidm.notification.NotificationFilter.filterDelete(NotificationFilter.java:234)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.notification.NotificationFilter.filterDelete(NotificationFilter.java:234)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.FilterChain.handleDelete(FilterChain.java:237)
      	at org.forgerock.json.resource.Router.handleDelete(Router.java:279)
      	at org.forgerock.openidm.managed.ManagedObjectService.handleDelete(ManagedObjectService.java:483)
      	at org.forgerock.json.resource.Router.handleDelete(Router.java:279)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:74)
      	at org.forgerock.openidm.selfservice.impl.HashKbaFilter.filterDelete(HashKbaFilter.java:110)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.ResourceApiVersionRoutingFilter.filterDelete(ResourceApiVersionRoutingFilter.java:55)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.FilterChain.handleDelete(FilterChain.java:237)
      	at org.forgerock.json.resource.Router.handleDelete(Router.java:279)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:74)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.lambda$filterDelete$2(DelegatedAdminFilter.java:248)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:227)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterRequest(DelegatedAdminFilter.java:299)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterDelete(DelegatedAdminFilter.java:247)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:64)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.lambda$filterDelete$2(DelegatedAdminFilter.java:248)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:227)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterRequest(DelegatedAdminFilter.java:299)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterDelete(DelegatedAdminFilter.java:247)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:64)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:64)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.audit.filter.AuditFilter.lambda$filterDelete$2(AuditFilter.java:127)
      	at org.forgerock.openidm.audit.filter.AuditFilter.logAuditAccessEntry(AuditFilter.java:171)
      	at org.forgerock.openidm.audit.filter.AuditFilter.filterDelete(AuditFilter.java:127)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.servlet.internal.ResourceFilters$3.lambda$filterDelete$2(ResourceFilters.java:182)
      	at org.forgerock.openidm.servlet.internal.ResourceFilters$3.handleRequestWithLogging(ResourceFilters.java:222)
      	at org.forgerock.openidm.servlet.internal.ResourceFilters$3.filterDelete(ResourceFilters.java:182)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.filter.QueryIdToQueryFilterTransformFilter.filterDelete(QueryIdToQueryFilterTransformFilter.java:166)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterDelete(PassthroughFilter.java:54)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterDelete(PassthroughFilter.java:54)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterDelete(MutableFilterDecorator.java:78)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.openidm.servlet.internal.ResourceFilters$2.filterDelete(ResourceFilters.java:107)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterDelete(Filters.java:62)
      	at org.forgerock.json.resource.FilterChain$Cursor.handleDelete(FilterChain.java:72)
      	at org.forgerock.json.resource.FilterChain.handleDelete(FilterChain.java:237)
      	at org.forgerock.json.resource.InternalConnection.deleteAsync(InternalConnection.java:47)
      	at org.forgerock.json.resource.AbstractConnectionWrapper.deleteAsync(AbstractConnectionWrapper.java:119)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.lambda$deleteAsync$7(ServletConnectionFactory.java:306)
      	at org.forgerock.openidm.metrics.MetricsCollector.time(MetricsCollector.java:112)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.time(ServletConnectionFactory.java:263)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.deleteAsync(ServletConnectionFactory.java:306)
      	at org.forgerock.json.resource.http.RequestRunner.visitDeleteRequest(RequestRunner.java:200)
      	at org.forgerock.json.resource.http.RequestRunner.visitDeleteRequest(RequestRunner.java:85)
      	at org.forgerock.json.resource.Requests$DeleteRequestImpl.accept(Requests.java:313)
      	at org.forgerock.json.resource.http.RequestRunner.handleResult(RequestRunner.java:137)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:252)
      	at org.forgerock.json.resource.http.HttpAdapter.doRequest(HttpAdapter.java:747)
      	at org.forgerock.json.resource.http.HttpAdapter.doDelete(HttpAdapter.java:353)
      	at org.forgerock.json.resource.http.HttpAdapter.handle(HttpAdapter.java:309)
      	at org.forgerock.http.handler.Handlers$HandlerDescribableAsDescribableHandler.handle(Handlers.java:147)
      	at org.forgerock.http.filter.OptionsFilter.filter(OptionsFilter.java:69)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:54)
      	at org.forgerock.openidm.auth.ProfileEnhancementCheckFilter.filter(ProfileEnhancementCheckFilter.java:145)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:54)
      	at org.forgerock.openidm.auth.LoginCountFilter.filter(LoginCountFilter.java:75)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:54)
      	at org.forgerock.http.oauth2.ResourceServerFilter.ensureSufficientScopes(ResourceServerFilter.java:190)
      	at org.forgerock.http.oauth2.ResourceServerFilter.lambda$onResolverSuccess$1(ResourceServerFilter.java:177)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:252)
      	at org.forgerock.http.oauth2.ResourceServerFilter.lambda$onResolverSuccess$3(ResourceServerFilter.java:177)
      	at org.forgerock.util.promise.PromiseImpl$1.executeCallback(PromiseImpl.java:434)
      	at org.forgerock.util.promise.PromiseImpl$1.handleStateChange(PromiseImpl.java:422)
      	at org.forgerock.util.promise.PromiseImpl.handleCompletion(PromiseImpl.java:538)
      	at org.forgerock.util.promise.PromiseImpl.addOrFireListener(PromiseImpl.java:526)
      	at org.forgerock.util.promise.PromiseImpl.thenAsync(PromiseImpl.java:416)
      	at org.forgerock.util.promise.PromiseImpl.thenAsync(PromiseImpl.java:407)
      	at org.forgerock.http.oauth2.ResourceServerFilter.filter(ResourceServerFilter.java:159)
      	at org.forgerock.openidm.util.Filters.lambda$conditionalFilter$0(Filters.java:31)
      	at org.forgerock.openidm.auth.AuthFilterWrapper.filter(AuthFilterWrapper.java:85)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:54)
      	at org.forgerock.http.routing.Router.handle(Router.java:100)
      	at org.forgerock.http.filter.TransactionIdInboundFilter.filter(TransactionIdInboundFilter.java:86)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:54)
      	at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:261)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1386)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
      	at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:50)
      	at jdk.internal.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:327)
      	at com.sun.proxy.$Proxy62.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.forgerock.openidm.jetty.LargePayloadServletFilter.doFilter(LargePayloadServletFilter.java:64)
      	at jdk.internal.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:327)
      	at com.sun.proxy.$Proxy61.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:310)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:264)
      	at jdk.internal.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      	at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:327)
      	at com.sun.proxy.$Proxy62.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
      	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:590)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1607)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
      	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:290)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
      	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.gzip.GzipHandler.handle(GzipHandler.java:717)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      	at org.eclipse.jetty.server.Server.handle(Server.java:500)
      	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
      	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
      	at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
      	at org.forgerock.openidm.meta.impl.MetaBehaviorImpl.lambda$getDeleteObjectMetaBehavior$9(MetaBehaviorImpl.java:206)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:227)
      	at org.forgerock.openidm.meta.impl.MetaBehaviorImpl.lambda$getDeleteObjectMetaBehavior$12(MetaBehaviorImpl.java:205)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:263)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:227)
      	at org.forgerock.openidm.managed.ManagedObjectSet.deleteInstance(ManagedObjectSet.java:1258)
      	... 171 more 

       

      Not sure what causes this, nor able to reproduce this issue, but from the call stack we can deduce that the _ref field under the object's _meta field was missing or null.  This may mean that there was no metadata object or the relationship wiring was off.  In either case, we should not fail with a large stacktrace.  Suggest gracefully ignoring the meta-delete as we cannot, but should let the object delete succeed.

        Attachments

          Activity

            People

            Assignee:
            brmiller Brendan Miller
            Reporter:
            brmiller Brendan Miller
            QA Assignee:
            Jon Branch Jon Branch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: