Highlighted

javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/fetch123

Avatar

Avatar

Anil_Jagtap

Avatar

Anil_Jagtap

Anil_Jagtap

10-10-2017

Hi All,

I kept files in drop box and I created one cloud service and fetching metadata of files from drop box. While fetching file getting following exception in log javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/fetch123. But its able to fetch metadata successfully. How can I resolve this exception? What I have to do?

Replies

Highlighted

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

(val/1000)?string[".0"]}K

Likes

891

Correct Answer

(val/1000)?string[".0"]}K

Avatar

Jörg_Hoh

Employee

Total Posts

(val/1000)?string[".0"]}K

Likes

891

Correct Answer

(val/1000)?string[".0"]}K
Jörg_Hoh
Employee

10-10-2017

Hi,

You get this exception when 2 threads concurrently try to write to the same location. Does your code do this?

Highlighted

Avatar

Avatar

Anil_Jagtap

Avatar

Anil_Jagtap

Anil_Jagtap

10-10-2017

Hi,

I'm not sure whether 2 threads concurrently try to write to the same location.

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

(val/1000)?string[".0"]}K

Likes

(val/1000)?string[".0"]}K

Correct Answer

(val/1000)?string[".0"]}K

Avatar

smacdonald2008

Total Posts

(val/1000)?string[".0"]}K

Likes

(val/1000)?string[".0"]}K

Correct Answer

(val/1000)?string[".0"]}K
smacdonald2008

11-10-2017

As Joerg suggests - looks like these threads are attempting to write to the same JCR location.

Highlighted

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

(val/1000)?string[".0"]}K

Likes

891

Correct Answer

(val/1000)?string[".0"]}K

Avatar

Jörg_Hoh

Employee

Total Posts

(val/1000)?string[".0"]}K

Likes

891

Correct Answer

(val/1000)?string[".0"]}K
Jörg_Hoh
Employee

11-10-2017

Can you share the complete stacktrace? It will indicate one thread, which participates in this situation. The other might be much harder to spot.

If you can recreate this situation, you should enable loglevel trace on org.apache.jackrabbit.oak.jcr.operations.write; this will log every write activity to the repository including the threadname, which does this action. This together with the exception will clearly indicate which threads are causing this situation.

Jörg

Highlighted

Avatar

Avatar

Anil_Jagtap

Avatar

Anil_Jagtap

Anil_Jagtap

13-10-2017

javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/fetch123

at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:237)

at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:212)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:670)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:496)

at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:419)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:274)

at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:416)

at com.abc.googledrive.core.importer.Importer.importData(Importer.java:169)

at com.day.cq.polling.importer.impl.PollingImporterImpl.importData(PollingImporterImpl.java:520)

at com.day.cq.polling.importer.impl.PollingImporterImpl.access$000(PollingImporterImpl.java:68)

at com.day.cq.polling.importer.impl.PollingImporterImpl$1.run(PollingImporterImpl.java:422)

at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:118)

at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

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: org.apache.jackrabbit.oak.api.CommitFailedException: OakState0001: Unresolved conflicts in /content/dam/copy12345

at org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.failOnMergeConflict(ConflictValidator.java:115)

at org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.propertyAdded(ConflictValidator.java:84)

at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.propertyAdded(CompositeEditor.java:83)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.propertyAdded(EditorDiff.java:82)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareProperties(SegmentNodeState.java:592)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:456)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.MapRecord.compare(MapRecord.java:414)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:583)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.MapRecord.compare(MapRecord.java:414)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:583)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

at org.apache.jackrabbit.oak.plugins.segment.MapRecord.compare(MapRecord.java:414)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:583)

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52)

at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:54)

at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:61)

at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:61)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore$Commit.prepare(SegmentNodeStore.java:496)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore$Commit.optimisticMerge(SegmentNodeStore.java:519)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore$Commit.execute(SegmentNodeStore.java:575)

at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore.merge(SegmentNodeStore.java:238)

at org.apache.jackrabbit.oak.spi.state.ProxyNodeStore.merge(ProxyNodeStore.java:43)

at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:247)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:347)

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:494)

... 12 more

Highlighted

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

(val/1000)?string[".0"]}K

Likes

891

Correct Answer

(val/1000)?string[".0"]}K

Avatar

Jörg_Hoh

Employee

Total Posts

(val/1000)?string[".0"]}K

Likes

891

Correct Answer

(val/1000)?string[".0"]}K
Jörg_Hoh
Employee

13-10-2017

Hi,

at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:416)

at com.abc.googledrive.core.importer.Importer.importData(Importer.java:169)

at com.day.cq.polling.importer.impl.PollingImporterImpl.importData(PollingImporterImpl.java: 520)

at com.day.cq.polling.importer.impl.PollingImporterImpl.access$000(PollingImporterImpl.java: 68)

Ok, you are importing data to this location. Can you enable trace logging on the package "org.jackrabbit.oak.jcr.operations.write" and find out what thread is writing to that location as well?

Do you importers run in parallel?

Highlighted

Avatar

Avatar

navinkaushal

Avatar

navinkaushal

navinkaushal

16-05-2019

How to address it?

Highlighted

Avatar

Avatar

Bharath_valse

Avatar

Bharath_valse

Bharath_valse

16-05-2019

Long running sessions might also be the cause for such conflicts as mentioned in [0], Please add debug level logs to the package mentioned by Joerg and additionally add debug level logging around the below packages. This will give more details into the conflict

  • org.apache.jackrabbit.oak.plugins.commit.MergingNodeStateDiff
  • org.apache.jackrabbit.oak.plugins.commit.ConflictValidator
  • org.apache.jackrabbit.oak.api
  • org.apache.jackrabbit.oak.spi.commit
  • org.apache.jackrabbit.oak.jcr.session

[0]

AEM anti pattern: Long running sessions | Things on a content management system

Highlighted

Avatar

Avatar

navinkaushal

Avatar

navinkaushal

navinkaushal

17-05-2019

Hi @Bharath

This issue we are facing while creating a translation job (with language copies) it should create launch however the launch is not being created.

Will check with debug log.

Thanks

-Navin