You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Jan Grathwohl <ja...@kontrast.de> on 2009/08/06 13:03:30 UTC

How to remove corrupted node from repository?

Hi list,

I have a problem with a corrupted node in a repository workspace, and  
the consistencyCheck/Fix does not solve it. It have set both  
consistencyCheck and consistencyFix to "true" in the PM config, the  
check also runs and outputs some messages, but does not solve this  
particular problem for some reason.

Are there any other ways to get rid of this broken node besides  
consistencyFix? It would solve my problem to either delete the node,  
move it to another repository path (outside of my normal content  
structure) where it may rest in peace, or change some properties on  
the node to make the application ignore it. But all of these options  
do not work because Node's save() and remove() methods both try to  
build the node path internally, so they do not work any more either.

Is there anything that I could do to solve this or remove the node,  
maybe through Jackrabbit API or even direct manipulation of the  
database content? Any ideas are highly appreciated.

The broken node throws an Exception on getPath(), more specifically

2009-08-06 12:04:40,963 ERROR [STDERR]  
javax.jcr.ItemNotFoundException: failed to build path of  
5c4bfc77-4ed2-431b-9659-c9d3f14227b3: c511b2ee-8183-43ea-ae96- 
fabb27badfba: c511b2ee-8183-43ea-ae96-fabb27badfba
2009-08-06 12:04:40,963 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:407)
2009-08-06 12:04:40,963 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.CachingHierarchyManager.getPath(CachingHierarchyManager.java:272)
2009-08-06 12:04:40,963 ERROR [STDERR]  at  
org.apache.jackrabbit.core.ItemImpl.getPrimaryPath(ItemImpl.java:296)

caused by

2009-08-06 12:04:40,965 ERROR [STDERR]  
org.apache.jackrabbit.core.state.NoSuchItemStateException:  
c511b2ee-8183-43ea-ae96-fabb27badfba
2009-08-06 12:04:40,965 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core 
.state 
.SessionItemStateManager.getItemState(SessionItemStateManager.java:189)
2009-08-06 12:04:40,965 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.HierarchyManagerImpl.getItemState(HierarchyManagerImpl.java:188)
2009-08-06 12:04:40,965 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.HierarchyManagerImpl.buildPath(HierarchyManagerImpl.java:325)
2009-08-06 12:04:40,965 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.CachingHierarchyManager.buildPath(CachingHierarchyManager.java: 
162)
2009-08-06 12:04:40,966 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.HierarchyManagerImpl.buildPath(HierarchyManagerImpl.java:327)
2009-08-06 12:04:40,966 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.CachingHierarchyManager.buildPath(CachingHierarchyManager.java: 
162)
2009-08-06 12:04:40,966 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:402)
2009-08-06 12:04:40,966 ERROR [STDERR]  at  
org 
.apache 
.jackrabbit 
.core.CachingHierarchyManager.getPath(CachingHierarchyManager.java:272)

The stack traces are from Jackrabbit 1.4.

Thanks for any help,

Jan



Re: How to remove corrupted node from repository?

Posted by Jan Grathwohl <ja...@kontrast.de>.
Hi Stefan,


>
> hmm, that's not the output of the consistencyCheck/Fix code.
> seems like the consistencyCheck code didn't run.
>
> did you specify the consistencyCheck/Fix option attribute in the
> repository.xml only? you need to specify the option in the
> workspace.xml file.


Yes, it is in the workspace.xml like the following:

     <PersistenceManager  
class="kontrast.datastore.jackrabbit.MySqlPersistenceManager">
        <param name="driver" value="com.mysql.jdbc.Driver"/>
        <param name="url" value="jdbc:mysql://..."/>
            <param name="user" value="..."/>
            <param name="password" value="..."/>
        <param name="schema" value="mysql"/>
        <param name="schemaObjectPrefix" value=""/>
        <param name="externalBLOBs" value="true"/>
                 <param name="blobStorePath" value="/daten/ 
app_data/..."/>
                 <param name="consistencyFix" value="true"/>
                 <param name="consistencyCheck" value="true"/>
    </PersistenceManager>

The custom PersistenceManager class is a subclass of  
BundleDBPersistenceManager, but does not change anything that should  
interfere with the consistency check, it only adds the parameter  
blobStorePath and overrides createLocalFSBlobStore.

So it seems the next time we hit an inconsistency I should better try  
to figure out why the consistencyCheck does not run instead of  
creating ugly hacks ;-)

Thank you for your feedback

Jan



Re: How to remove corrupted node from repository?

Posted by Stefan Guggisberg <st...@gmail.com>.
On Fri, Aug 7, 2009 at 4:54 PM, Jan Grathwohl<ja...@kontrast.de> wrote:
> Hi Stefan,
>
>
>> what's the exact output of the consistencyCheck/Fix? dangling child node
>> entries
>> should be fixable.
>
> The output was :
>
> 2009-08-06 12:01:39,350 ERROR
> [org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager]
> NodeState cd0adbec-b2
> 7d-44b3-900f-d720f705c2e6 references inexistent parent id
> c511b2ee-8183-43ea-ae96-fabb27badfba

hmm, that's not the output of the consistencyCheck/Fix code.
seems like the consistencyCheck code didn't run.

did you specify the consistencyCheck/Fix option attribute in the
repository.xml only? you need to specify the option in the
workspace.xml file.

>
> If I understand the message right, this is a different node that references
> the same inexistent parent as the node causing the problem? At least the
> first UUID ist not mentioned in the exception message...
>
>
>> do you know the path of the corrupted node? are you able to navigate to
>> the node?
>
> No, but getting the node by UUID still works...
>
>>
>>>
>>> Is there anything that I could do to solve this or remove the node, maybe
>>> through Jackrabbit API or even direct manipulation of the database
>>> content?
>>> Any ideas are highly appreciated.
>>
>> if everything fails, you could try to fix that inconsistency
>> programmatically,
>> e.g. by directly reading the troublesome NodeState instance through the
>> pm, fix it and write it back. but you'll have to get your hands dirty...
>
> That's what I did now. Wrote a small program that accesses the workspace
> persistence manager through the JCA handle and RepositoryImpl (partially by
> using Java reflection to call protected methods and fields), and then
> deleted the broken NodeState from the repository. So far that doesn't seem
> to have caused any further problems.

excellent :)

cheers
stefan

>
> Many thanks for the hint!
>
> Regards,
>
> Jan
>
>
>

Re: How to remove corrupted node from repository?

Posted by Jan Grathwohl <ja...@kontrast.de>.
Hi Stefan,


> what's the exact output of the consistencyCheck/Fix? dangling child  
> node entries
> should be fixable.

The output was :

2009-08-06 12:01:39,350 ERROR  
[org 
.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager]  
NodeState cd0adbec-b2
7d-44b3-900f-d720f705c2e6 references inexistent parent id  
c511b2ee-8183-43ea-ae96-fabb27badfba

If I understand the message right, this is a different node that  
references the same inexistent parent as the node causing the problem?  
At least the first UUID ist not mentioned in the exception message...


> do you know the path of the corrupted node? are you able to navigate  
> to
> the node?

No, but getting the node by UUID still works...

>
>>
>> Is there anything that I could do to solve this or remove the node,  
>> maybe
>> through Jackrabbit API or even direct manipulation of the database  
>> content?
>> Any ideas are highly appreciated.
>
> if everything fails, you could try to fix that inconsistency  
> programmatically,
> e.g. by directly reading the troublesome NodeState instance through  
> the
> pm, fix it and write it back. but you'll have to get your hands  
> dirty...

That's what I did now. Wrote a small program that accesses the  
workspace persistence manager through the JCA handle and  
RepositoryImpl (partially by using Java reflection to call protected  
methods and fields), and then deleted the broken NodeState from the  
repository. So far that doesn't seem to have caused any further  
problems.

Many thanks for the hint!

Regards,

Jan



Re: How to remove corrupted node from repository?

Posted by Stefan Guggisberg <st...@gmail.com>.
On Thu, Aug 6, 2009 at 1:03 PM, Jan Grathwohl<ja...@kontrast.de> wrote:
> Hi list,
>
> I have a problem with a corrupted node in a repository workspace, and the
> consistencyCheck/Fix does not solve it. It have set both consistencyCheck
> and consistencyFix to "true" in the PM config, the check also runs and
> outputs some messages, but does not solve this particular problem for some
> reason.

what's the exact output of the consistencyCheck/Fix? dangling child node entries
should be fixable.

>
> Are there any other ways to get rid of this broken node besides
> consistencyFix? It would solve my problem to either delete the node, move it
> to another repository path (outside of my normal content structure) where it
> may rest in peace, or change some properties on the node to make the
> application ignore it. But all of these options do not work because Node's
> save() and remove() methods both try to build the node path internally, so
> they do not work any more either.

do you know the path of the corrupted node? are you able to navigate to
the node?

>
> Is there anything that I could do to solve this or remove the node, maybe
> through Jackrabbit API or even direct manipulation of the database content?
> Any ideas are highly appreciated.

if everything fails, you could try to fix that inconsistency programmatically,
e.g. by directly reading the troublesome NodeState instance through the
pm, fix it and write it back. but you'll have to get your hands dirty...

cheers
stefan

>
> The broken node throws an Exception on getPath(), more specifically
>
> 2009-08-06 12:04:40,963 ERROR [STDERR] javax.jcr.ItemNotFoundException:
> failed to build path of 5c4bfc77-4ed2-431b-9659-c9d3f14227b3:
> c511b2ee-8183-43ea-ae96-fabb27badfba: c511b2ee-8183-43ea-ae96-fabb27badfba
> 2009-08-06 12:04:40,963 ERROR [STDERR]  at
> org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:407)
> 2009-08-06 12:04:40,963 ERROR [STDERR]  at
> org.apache.jackrabbit.core.CachingHierarchyManager.getPath(CachingHierarchyManager.java:272)
> 2009-08-06 12:04:40,963 ERROR [STDERR]  at
> org.apache.jackrabbit.core.ItemImpl.getPrimaryPath(ItemImpl.java:296)
>
> caused by
>
> 2009-08-06 12:04:40,965 ERROR [STDERR]
> org.apache.jackrabbit.core.state.NoSuchItemStateException:
> c511b2ee-8183-43ea-ae96-fabb27badfba
> 2009-08-06 12:04:40,965 ERROR [STDERR]  at
> org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:189)
> 2009-08-06 12:04:40,965 ERROR [STDERR]  at
> org.apache.jackrabbit.core.HierarchyManagerImpl.getItemState(HierarchyManagerImpl.java:188)
> 2009-08-06 12:04:40,965 ERROR [STDERR]  at
> org.apache.jackrabbit.core.HierarchyManagerImpl.buildPath(HierarchyManagerImpl.java:325)
> 2009-08-06 12:04:40,965 ERROR [STDERR]  at
> org.apache.jackrabbit.core.CachingHierarchyManager.buildPath(CachingHierarchyManager.java:162)
> 2009-08-06 12:04:40,966 ERROR [STDERR]  at
> org.apache.jackrabbit.core.HierarchyManagerImpl.buildPath(HierarchyManagerImpl.java:327)
> 2009-08-06 12:04:40,966 ERROR [STDERR]  at
> org.apache.jackrabbit.core.CachingHierarchyManager.buildPath(CachingHierarchyManager.java:162)
> 2009-08-06 12:04:40,966 ERROR [STDERR]  at
> org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:402)
> 2009-08-06 12:04:40,966 ERROR [STDERR]  at
> org.apache.jackrabbit.core.CachingHierarchyManager.getPath(CachingHierarchyManager.java:272)
>
> The stack traces are from Jackrabbit 1.4.
>
> Thanks for any help,
>
> Jan
>
>
>