org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4 org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4

Apache's JIRA Issue Tracker | Stefan Egli | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    We've seen race-conditions, where the repository refuses to delete a node, with the following exception: {code} 16.07.2014 14:58:59.134 *ERROR* [pool-5-thread-5] org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler checkView: encountered a persistence exception during view check: org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4 org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4 at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:491) at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.delete(ResourceResolverImpl.java:1044) at org.apache.sling.discovery.impl.cluster.voting.VotingHandler.promote(VotingHandler.java:314) at org.apache.sling.discovery.impl.cluster.voting.VotingHandler.analyzeVotings(VotingHandler.java:141) at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.doCheckView(HeartbeatHandler.java:299) at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.checkView(HeartbeatHandler.java:277) at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.run(HeartbeatHandler.java:153) at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:105) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: javax.jcr.ItemNotFoundException: 4f06dc87-401d-44b6-b6da-2e0bff2e2bb6 at org.apache.jackrabbit.core.ItemManager.getItemData(ItemManager.java:384) at org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:669) at org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:696) at org.apache.jackrabbit.core.NodeImpl.removeChildNode(NodeImpl.java:624) at org.apache.jackrabbit.core.ItemRemoveOperation.perform(ItemRemoveOperation.java:78) at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216) at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91) at org.apache.jackrabbit.core.ItemImpl.remove(ItemImpl.java:322) at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:486) ... 11 more {code} While this needs to be treated at the repository level, the discovery.impl can help work around this issue by following a tested workaround: * when delete fails, try to rename the 'previousview' node to 'previousview_trash_${UUID}'

    Apache's JIRA Issue Tracker | 3 years ago | Stefan Egli
    org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4 org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4

    Root Cause Analysis

    1. javax.jcr.ItemNotFoundException

      4f06dc87-401d-44b6-b6da-2e0bff2e2bb6

      at org.apache.jackrabbit.core.ItemManager.getItemData()
    2. Jackrabbit Core
      ItemImpl.remove
      1. org.apache.jackrabbit.core.ItemManager.getItemData(ItemManager.java:384)
      2. org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:669)
      3. org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:696)
      4. org.apache.jackrabbit.core.NodeImpl.removeChildNode(NodeImpl.java:624)
      5. org.apache.jackrabbit.core.ItemRemoveOperation.perform(ItemRemoveOperation.java:78)
      6. org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
      7. org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
      8. org.apache.jackrabbit.core.ItemImpl.remove(ItemImpl.java:322)
      8 frames
    3. org.apache.sling
      QuartzJobExecutor.execute
      1. org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:486)
      2. org.apache.sling.resourceresolver.impl.ResourceResolverImpl.delete(ResourceResolverImpl.java:1044)
      3. org.apache.sling.discovery.impl.cluster.voting.VotingHandler.promote(VotingHandler.java:314)
      4. org.apache.sling.discovery.impl.cluster.voting.VotingHandler.analyzeVotings(VotingHandler.java:141)
      5. org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.doCheckView(HeartbeatHandler.java:299)
      6. org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.checkView(HeartbeatHandler.java:277)
      7. org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.run(HeartbeatHandler.java:153)
      8. org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:105)
      8 frames
    4. quartz
      JobRunShell.run
      1. org.quartz.core.JobRunShell.run(JobRunShell.java:207)
      1 frame
    5. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      3. java.lang.Thread.run(Unknown Source)
      3 frames