Restoring an inconsistent database
vdepauw Jun 29, 2016 4:46 AMHi everyone,
I have a corrupted database from which I'd like to restore data. It's impossible for me to open it because modeshape is unable to read namespaces and nodeTypes at loading.
So what is the proper way to read the rest of the file ? Is it possible to rebuild a clean system/namespace node ?
I'm working with modeshape 4.6.0.Final.
Here is the complete stack trace:
10:35:47.099 [JTP Slot 2] DEBUG org.infinispan.cache.impl.CacheImpl - Started cache dsdk-repository/system on null
10:35:47.101 [JTP Slot 2] DEBUG o.m.jcr.cache.RepositoryCache - The 'dsdk-repository/system' workspace cache is using the cache configuration: '[I REMOVED THIS LINE TOO LONG...]'
10:35:47.135 [JTP Slot 2] DEBUG o.m.jcr.cache.RepositoryCache - System root: Node e03bade317f1e7/: { "properties" : { "http://www.jcp.org/jcr/1.0" : { "primaryType" : { "$name" : "mode:root" } , "uuid" : "e03bade317f1e7/" } } , "children" : [ { "key" : "e03bade317f1e7jcr:system" , "name" : "jcr:system" } ] , "childrenInfo" : { "count" : 1 } }
10:35:47.138 [JTP Slot 2] DEBUG o.m.jcr.cache.RepositoryCache - jcr:system child reference: jcr:system (key=e03bade317f1e7jcr:system)
10:35:47.139 [JTP Slot 2] DEBUG o.m.jcr.cache.RepositoryCache - System node: Node e03bade317f1e7jcr:system: [I REMOVED THIS LINE TOO LONG...]
10:35:47.139 [JTP Slot 2] DEBUG o.m.jcr.cache.RepositoryCache - Found existing 'system' workspace in repository 'dsdk-repository'
10:35:47.193 [JTP Slot 2] ERROR o.m.jcr.SystemNamespaceRegistry - Node types were read from the system content, and appear to be inconsistent or invalid: dsdk-repository
java.lang.NullPointerException: null
at org.modeshape.jcr.SystemContent.readAllNamespaces(SystemContent.java:941) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.SystemNamespaceRegistry.refreshFromSystem(SystemNamespaceRegistry.java:75) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1153) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:980) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:388) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:653) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:624) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:145) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at com.dooapp.jcr.viewer.model.RepositoryConnection.connect(RepositoryConnection.java:34) [classes/:na]
at com.dooapp.jcr.viewer.service.PersistenceService.doLoadRepository(PersistenceService.java:49) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_51]
at org.jrebirth.af.core.service.ServiceTaskBase.call(ServiceTaskBase.java:156) [core-8.0.4.jar:na]
at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) [jfxrt.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51]
10:35:47.195 [JTP Slot 2] ERROR o.m.jcr.RepositoryNodeTypeManager - Node types were read from the system content, and appear to be inconsistent or invalid: dsdk-repository
java.lang.NullPointerException: null
at org.modeshape.jcr.SystemContent.readAllNodeTypes(SystemContent.java:786) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.RepositoryNodeTypeManager.refreshFromSystem(RepositoryNodeTypeManager.java:743) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1155) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:980) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:388) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:653) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:624) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:145) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at com.dooapp.jcr.viewer.model.RepositoryConnection.connect(RepositoryConnection.java:34) [classes/:na]
at com.dooapp.jcr.viewer.service.PersistenceService.doLoadRepository(PersistenceService.java:49) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_51]
at org.jrebirth.af.core.service.ServiceTaskBase.call(ServiceTaskBase.java:156) [core-8.0.4.jar:na]
at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) [jfxrt.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51]
10:35:47.265 [JTP Slot 2] DEBUG o.m.j.c.d.WritableSessionCache - Attempting to lock keys in Infinispan: [I REMOVED THIS LINE TOO LONG...]
10:35:47.274 [JTP Slot 2] DEBUG o.m.j.c.d.WritableSessionCache - Locked the nodes: [I REMOVED THIS LINE TOO LONG...]
10:35:47.344 [JTP Slot 2] DEBUG o.i.x.s.XSiteStateConsumerImpl - Ending state transfer from null
10:35:47.357 [JTP Slot 2] DEBUG org.infinispan.cache.impl.CacheImpl - Stopping cache dsdk-repository/system on null
10:35:47.359 [JTP Slot 2] DEBUG o.i.t.impl.TransactionTable - Wait for on-going transactions to finish for 30 seconds.
10:35:47.359 [JTP Slot 2] DEBUG o.i.t.impl.TransactionTable - All transactions terminated
10:35:47.361 [JTP Slot 2] DEBUG o.i.manager.DefaultCacheManager - Stopping cache manager ISPN on null
10:35:47.361 [JTP Slot 2] DEBUG o.i.manager.DefaultCacheManager - Stopping cache manager ISPN on null
10:35:47.362 [JTP Slot 2] DEBUG org.infinispan.cache.impl.CacheImpl - Stopping cache persisted-repository on null
10:35:47.363 [JTP Slot 2] DEBUG o.i.t.impl.TransactionTable - Wait for on-going transactions to finish for 30 seconds.
10:35:47.363 [JTP Slot 2] DEBUG o.i.t.impl.TransactionTable - All transactions terminated
10:35:47.364 [JTP Slot 2] ERROR c.d.j.v.service.PersistenceService - Error while starting 'dsdk-repository' repository: e03bade317f1e7/jcr:system/jcr:nodeTypes/nt:base
javax.jcr.RepositoryException: Error while starting 'dsdk-repository' repository: e03bade317f1e7/jcr:system/jcr:nodeTypes/nt:base
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:655) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:624) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:145) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at com.dooapp.jcr.viewer.model.RepositoryConnection.connect(RepositoryConnection.java:34) ~[classes/:na]
at com.dooapp.jcr.viewer.service.PersistenceService.doLoadRepository(PersistenceService.java:49) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_51]
at org.jrebirth.af.core.service.ServiceTaskBase.call(ServiceTaskBase.java:156) [core-8.0.4.jar:na]
at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) [jfxrt.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51]
Caused by: org.modeshape.jcr.cache.DocumentAlreadyExistsException: e03bade317f1e7/jcr:system/jcr:nodeTypes/nt:base
at org.modeshape.jcr.cache.document.WritableSessionCache.persistChanges(WritableSessionCache.java:1343) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:488) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:443) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.SystemContent.save(SystemContent.java:120) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.RepositoryNodeTypeManager.registerNodeTypes(RepositoryNodeTypeManager.java:532) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:1160) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository$RunningState.<init>(JcrRepository.java:980) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.doStart(JcrRepository.java:388) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:653) ~[modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]
... 14 common frames omitted