You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Peter Heß <pe...@gbtec.de> on 2009/01/12 13:42:02 UTC

Problem during removing a node with childNodes

Hello,

I've a problem which is described in serveral postings, but I can't find a
solution 

Situation:

I have a tree with nodes and I want to remove the root node of the tree.
UUID is "a", then an exception occurs ItemNotFoundExecption but the reported
uuid is "b".

I've tested this in a single thread and after an application restart.

I can't get the reported node "b" with an Xpath query or by getNodeByUuid().
So the exception is OK. "b" does not exist, but it was a former child of a
child in the tree of node "a". And so removing of node a aborts.

A lot of postings talk about this similar problems but how to solve this
without reinitializing the repository? We're in a production environment and
import/export via XML is not a possible option. Is there a way to correct
this with some code. 

The hard way to patch Jackrabbit to do not the check looks possible, (ignore
the Exeption...) but I think there will be after this some unknown records
in the database. :-)

Thanks for all help,

Peter





-- 
View this message in context: http://www.nabble.com/Problem-during-removing-a-node-with-childNodes-tp21413671p21413671.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Problem during removing a node with childNodes

Posted by Peter Heß <pe...@gbtec.de>.

I've found a solution, but not the problem

The database was mysql 4.0 and I found an other posting with a similar
problem. So I've made an upgrade to mysql 5.0.67 and the last Test in the
night says "No Problems" . The day before we can reproduce the error after
200-300 transactions. The last run where 10000 Updates with good performance
and no errors.

Switching back to 4.0 the error occurs again. No errors in the databaselog
or elsewhere except the printout I've posted here.

Sending code is complicated

The setup was

- JR 1.4.6
- Spring
- Groovy
- Springmodules for JCR 0.9
- java 1.4.2_10
- mysql 4.0

I'll try to write an reproducer and post it here.

Peter


Peter Heß wrote:
> 
> Some additional information:
> 
> The logfile say:
> 
> This ist a Transaction with 15 putBundle()
> ...
> 2009-01-13 23:32:26,359 DEBUG -
> AbstractBundlePersistenceManager.putBundle(705) | stored bundle
> 73b4cc04-f0a9-4cf8-b487-8064bcee6520
> ...
> ..
> 2009-01-13 23:32:26,687 ERROR - BundleDbPersistenceManager.store(531) |
> 73b4cc04-f0a9-4cf8-b487-8064bcee6520
> ...
> 
> org.apache.jackrabbit.core.state.NoSuchItemStateException:
> 73b4cc04-f0a9-4cf8-b487-8064bcee6520
> 	at
> org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.store(AbstractBundlePersistenceManager.java:577)
> 	at
> org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:526)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:704)
> 	at
> org.apache.jackrabbit.core.state.XAItemStateManager.commit(XAItemStateManager.java:164)
> 	at
> org.apache.jackrabbit.core.TransactionContext.commit(TransactionContext.java:189)
> 	at
> org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:339)
> ...
> This is everything I can find in logs.
> 
> The error happens here:
> 
> AbstractBundleDbPersisitenceManager:
> 
>  NodeId nodeId = id.getParentId();
>                 NodePropBundle bundle = (NodePropBundle)
> modified.get(nodeId);
>                 if (bundle == null) {
>                     bundle = getBundle(nodeId);
>                     if (bundle == null) {
>                         throw new
> NoSuchItemStateException(nodeId.toString());
>                     }
>                     modified.put(nodeId, bundle);
>                 }
>                 bundle.addProperty((PropertyState) state);
>             }
> 
> 
> 
>  I've checked that the session is the same and this happens in one
> transaction.
> 
> 
> 
> 
> Peter Heß wrote:
>> 
>> I've tried this before I send the posting. Nothing changes. I've set this
>> als default in workspace.xml. No info in the logfile. I've tested to
>> remove the Index (which offen helps) but in this case, the system crashes
>> in the startup during the index build.
>> 
>> I'm checking why this all happen. Maybe there is something strange in the
>> BundleManager and the myisam tables. I will activate innodb now for
>> testing. I've seen in the log, that there is an Exception from the
>> bundleManager. But the causing exception is not logged. So I'll make a
>> test now with a patched BundleManager. (This solves not the reported
>> problem, but maybe it will help in the future.
>> 
>> 
>> 
>> Alexander Klimetschek wrote:
>>> 
>>> On Tue, Jan 13, 2009 at 3:51 PM, Peter Heß <pe...@gbtec.de> wrote:
>>>> This will fail:
>>>>
>>>>                Node node = getSession(false).getNodeByUUID(uuid);
>>>>                node.remove();
>>>>
>>>> with an ItemNotExistException during the node.remove(), but the given
>>>> UUID
>>>> in the exception ist not the UUID of the node.
>>>>
>>>> Can anyone explain this? I think the repository is corrupted, but ist
>>>> there
>>>> an programitic way to solve this?
>>> 
>>> There is a consistencyCheck option in the bundle persistence managers
>>> that might solve your issue (and a consistencyFix option that will try
>>> to fix those issues). The process requires to change the persistence
>>> manager configuration (in the appropriate workspace.xml), ie. the
>>> param consistencyCheck=true, restart the repository and inspect
>>> Jackrabbit's log. The check (and the fix) will only run on startup.
>>> 
>>> http://issues.apache.org/jira/browse/JCR-1428
>>> 
>>> http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html
>>> 
>>> Regards,
>>> Alex
>>> 
>>> -- 
>>> Alexander Klimetschek
>>> alexander.klimetschek@day.com
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-during-removing-a-node-with-childNodes-tp21413671p21487421.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Problem during removing a node with childNodes

Posted by Marcel Reutegger <ma...@gmx.net>.
Can you please post the code that creates the nodes?

thanks

regards
 marcel

Peter Heß wrote:
> Some additional information:
> 
> The logfile say:
> 
> This ist a Transaction with 15 putBundle()
> ...
> 2009-01-13 23:32:26,359 DEBUG -
> AbstractBundlePersistenceManager.putBundle(705) | stored bundle
> 73b4cc04-f0a9-4cf8-b487-8064bcee6520
> ...
> ..
> 2009-01-13 23:32:26,687 ERROR - BundleDbPersistenceManager.store(531) |
> 73b4cc04-f0a9-4cf8-b487-8064bcee6520
> ...
> 
> org.apache.jackrabbit.core.state.NoSuchItemStateException:
> 73b4cc04-f0a9-4cf8-b487-8064bcee6520
> 	at
> org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.store(AbstractBundlePersistenceManager.java:577)
> 	at
> org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:526)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:704)
> 	at
> org.apache.jackrabbit.core.state.XAItemStateManager.commit(XAItemStateManager.java:164)
> 	at
> org.apache.jackrabbit.core.TransactionContext.commit(TransactionContext.java:189)
> 	at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:339)
> ...
> This is everything I can find in logs.
> 
> The error happens here:
> 
> AbstractBundleDbPersisitenceManager:
> 
>  NodeId nodeId = id.getParentId();
>                 NodePropBundle bundle = (NodePropBundle)
> modified.get(nodeId);
>                 if (bundle == null) {
>                     bundle = getBundle(nodeId);
>                     if (bundle == null) {
>                         throw new
> NoSuchItemStateException(nodeId.toString());
>                     }
>                     modified.put(nodeId, bundle);
>                 }
>                 bundle.addProperty((PropertyState) state);
>             }
> 
> 
> 
>  I've checked that the session is the same and this happens in one
> transaction.
> 
> 
> 
> 
> Peter Heß wrote:
>> I've tried this before I send the posting. Nothing changes. I've set this
>> als default in workspace.xml. No info in the logfile. I've tested to
>> remove the Index (which offen helps) but in this case, the system crashes
>> in the startup during the index build.
>>
>> I'm checking why this all happen. Maybe there is something strange in the
>> BundleManager and the myisam tables. I will activate innodb now for
>> testing. I've seen in the log, that there is an Exception from the
>> bundleManager. But the causing exception is not logged. So I'll make a
>> test now with a patched BundleManager. (This solves not the reported
>> problem, but maybe it will help in the future.
>>
>>
>>
>> Alexander Klimetschek wrote:
>>> On Tue, Jan 13, 2009 at 3:51 PM, Peter Heß <pe...@gbtec.de> wrote:
>>>> This will fail:
>>>>
>>>>                Node node = getSession(false).getNodeByUUID(uuid);
>>>>                node.remove();
>>>>
>>>> with an ItemNotExistException during the node.remove(), but the given
>>>> UUID
>>>> in the exception ist not the UUID of the node.
>>>>
>>>> Can anyone explain this? I think the repository is corrupted, but ist
>>>> there
>>>> an programitic way to solve this?
>>> There is a consistencyCheck option in the bundle persistence managers
>>> that might solve your issue (and a consistencyFix option that will try
>>> to fix those issues). The process requires to change the persistence
>>> manager configuration (in the appropriate workspace.xml), ie. the
>>> param consistencyCheck=true, restart the repository and inspect
>>> Jackrabbit's log. The check (and the fix) will only run on startup.
>>>
>>> http://issues.apache.org/jira/browse/JCR-1428
>>>
>>> http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html
>>>
>>> Regards,
>>> Alex
>>>
>>> -- 
>>> Alexander Klimetschek
>>> alexander.klimetschek@day.com
>>>
>>>
>>
> 


Re: Problem during removing a node with childNodes

Posted by Peter Heß <pe...@gbtec.de>.
Some additional information:

The logfile say:

This ist a Transaction with 15 putBundle()
...
2009-01-13 23:32:26,359 DEBUG -
AbstractBundlePersistenceManager.putBundle(705) | stored bundle
73b4cc04-f0a9-4cf8-b487-8064bcee6520
...
..
2009-01-13 23:32:26,687 ERROR - BundleDbPersistenceManager.store(531) |
73b4cc04-f0a9-4cf8-b487-8064bcee6520
...

org.apache.jackrabbit.core.state.NoSuchItemStateException:
73b4cc04-f0a9-4cf8-b487-8064bcee6520
	at
org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.store(AbstractBundlePersistenceManager.java:577)
	at
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.store(BundleDbPersistenceManager.java:526)
	at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:704)
	at
org.apache.jackrabbit.core.state.XAItemStateManager.commit(XAItemStateManager.java:164)
	at
org.apache.jackrabbit.core.TransactionContext.commit(TransactionContext.java:189)
	at org.apache.jackrabbit.core.XASessionImpl.commit(XASessionImpl.java:339)
...
This is everything I can find in logs.

The error happens here:

AbstractBundleDbPersisitenceManager:

 NodeId nodeId = id.getParentId();
                NodePropBundle bundle = (NodePropBundle)
modified.get(nodeId);
                if (bundle == null) {
                    bundle = getBundle(nodeId);
                    if (bundle == null) {
                        throw new
NoSuchItemStateException(nodeId.toString());
                    }
                    modified.put(nodeId, bundle);
                }
                bundle.addProperty((PropertyState) state);
            }



 I've checked that the session is the same and this happens in one
transaction.




Peter Heß wrote:
> 
> I've tried this before I send the posting. Nothing changes. I've set this
> als default in workspace.xml. No info in the logfile. I've tested to
> remove the Index (which offen helps) but in this case, the system crashes
> in the startup during the index build.
> 
> I'm checking why this all happen. Maybe there is something strange in the
> BundleManager and the myisam tables. I will activate innodb now for
> testing. I've seen in the log, that there is an Exception from the
> bundleManager. But the causing exception is not logged. So I'll make a
> test now with a patched BundleManager. (This solves not the reported
> problem, but maybe it will help in the future.
> 
> 
> 
> Alexander Klimetschek wrote:
>> 
>> On Tue, Jan 13, 2009 at 3:51 PM, Peter Heß <pe...@gbtec.de> wrote:
>>> This will fail:
>>>
>>>                Node node = getSession(false).getNodeByUUID(uuid);
>>>                node.remove();
>>>
>>> with an ItemNotExistException during the node.remove(), but the given
>>> UUID
>>> in the exception ist not the UUID of the node.
>>>
>>> Can anyone explain this? I think the repository is corrupted, but ist
>>> there
>>> an programitic way to solve this?
>> 
>> There is a consistencyCheck option in the bundle persistence managers
>> that might solve your issue (and a consistencyFix option that will try
>> to fix those issues). The process requires to change the persistence
>> manager configuration (in the appropriate workspace.xml), ie. the
>> param consistencyCheck=true, restart the repository and inspect
>> Jackrabbit's log. The check (and the fix) will only run on startup.
>> 
>> http://issues.apache.org/jira/browse/JCR-1428
>> 
>> http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html
>> 
>> Regards,
>> Alex
>> 
>> -- 
>> Alexander Klimetschek
>> alexander.klimetschek@day.com
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-during-removing-a-node-with-childNodes-tp21413671p21446620.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Problem during removing a node with childNodes

Posted by Peter Heß <pe...@gbtec.de>.
I've tried this before I send the posting. Nothing changes. I've set this als
default in workspace.xml. No info in the logfile. I've tested to remove the
Index (which offen helps) but in this case, the system crashes in the
startup during the index build.

I'm checking why this all happen. Maybe there is something strange in the
BundleManager and the myisam tables. I will activate innodb now for testing.
I've seen in the log, that there is an Exception from the bundleManager. But
the causing exception is not logged. So I'll make a test now with a patched
BundleManager. (This solves not the reported problem, but maybe it will help
in the future.



Alexander Klimetschek wrote:
> 
> On Tue, Jan 13, 2009 at 3:51 PM, Peter Heß <pe...@gbtec.de> wrote:
>> This will fail:
>>
>>                Node node = getSession(false).getNodeByUUID(uuid);
>>                node.remove();
>>
>> with an ItemNotExistException during the node.remove(), but the given
>> UUID
>> in the exception ist not the UUID of the node.
>>
>> Can anyone explain this? I think the repository is corrupted, but ist
>> there
>> an programitic way to solve this?
> 
> There is a consistencyCheck option in the bundle persistence managers
> that might solve your issue (and a consistencyFix option that will try
> to fix those issues). The process requires to change the persistence
> manager configuration (in the appropriate workspace.xml), ie. the
> param consistencyCheck=true, restart the repository and inspect
> Jackrabbit's log. The check (and the fix) will only run on startup.
> 
> http://issues.apache.org/jira/browse/JCR-1428
> 
> http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html
> 
> Regards,
> Alex
> 
> -- 
> Alexander Klimetschek
> alexander.klimetschek@day.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-during-removing-a-node-with-childNodes-tp21413671p21442563.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: Problem during removing a node with childNodes

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Jan 13, 2009 at 3:51 PM, Peter Heß <pe...@gbtec.de> wrote:
> This will fail:
>
>                Node node = getSession(false).getNodeByUUID(uuid);
>                node.remove();
>
> with an ItemNotExistException during the node.remove(), but the given UUID
> in the exception ist not the UUID of the node.
>
> Can anyone explain this? I think the repository is corrupted, but ist there
> an programitic way to solve this?

There is a consistencyCheck option in the bundle persistence managers
that might solve your issue (and a consistencyFix option that will try
to fix those issues). The process requires to change the persistence
manager configuration (in the appropriate workspace.xml), ie. the
param consistencyCheck=true, restart the repository and inspect
Jackrabbit's log. The check (and the fix) will only run on startup.

http://issues.apache.org/jira/browse/JCR-1428

http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Problem during removing a node with childNodes

Posted by Peter Heß <pe...@gbtec.de>.

This will fail:

		Node node = getSession(false).getNodeByUUID(uuid);
		node.remove();

with an ItemNotExistException during the node.remove(), but the given UUID
in the exception ist not the UUID of the node.

Can anyone explain this? I think the repository is corrupted, but ist there
an programitic way to solve this?

Peter
-- 
View this message in context: http://www.nabble.com/Problem-during-removing-a-node-with-childNodes-tp21413671p21437226.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.