[MGNLDAM-970] Sub-app jcrDetail fails to start on DataStoreException - Record does not exist Created: 21/May/21  Updated: 19/May/22  Resolved: 21/May/21

Status: Closed
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Unassigned
Resolution: Workaround exists Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File full-stack-trace.txt    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

In cases where the binary is missing from the data store then the detail subApp fails to start normally. See full-stack-trace.txt.

2021-05-21 15:12:28,104 ERROR agnolia.ui.framework.app.AppInstanceControllerImpl: 
Sub-app [jcrDetail] of app [dam] failed to start
com.machinezoo.noexception.WrappedException: org.apache.jackrabbit.core.data.DataStoreException: 
Record 1973a5c3c21db3b70e903236d33a526709a49646ea6ad1d34eed094f2565819f does not exist
...
Caused by: org.apache.jackrabbit.core.data.DataStoreException: 
Record 1973a5c3c21db3b70e903236d33a526709a49646ea6ad1d34eed094f2565819f does not exist
...
...
2021-05-21 15:13:37,775 WARN  org.apache.jackrabbit.core.value.BLOBInDataStore  : 
getSize for 1973a5c3c21db3b70e903236d33a526709a49646ea6ad1d34eed094f2565819f failed
org.apache.jackrabbit.core.data.DataStoreException: 
Record 1973a5c3c21db3b70e903236d33a526709a49646ea6ad1d34eed094f2565819f does not exist
...
...
2021-05-21 15:14:02,330 ERROR info.magnolia.ui.framework.ContextProperty$Impl   : 
Failed to dispatch context property change: Invocation of method selectionChange in com.vaadin.ui.components.grid.MultiSelectionModel$$Lambda$1358/1748390998 failed.
com.vaadin.event.ListenerMethod$MethodException: 
Invocation of method selectionChange in com.vaadin.ui.components.grid.MultiSelectionModel$$Lambda$1358/1748390998 failed.
...
Caused by: java.lang.NullPointerException

Workaround

  • Using the record id printed in the log try to retrieve the binary from backup. The beginning characters in the id indicate the folder locations of the record. Copy it from backup into live.
  • If repairing the lost binary is not possible then the node should be deleted using the browser.

To check for other missing binaries use the following script.

// check for missing binaries in the datastore
 
import org.apache.jackrabbit.core.RepositoryImpl;
import info.magnolia.jcr.predicate.NodeTypePredicate;
 
workspace = 'dam';
nodeType = "mgnl:asset"
  
session = ctx.getJCRSession(workspace);
dataStore = ((RepositoryImpl)session.getRepository()).getRepositoryContext().getDataStore();
 
collection = (NodeUtil.collectAllChildren(session.getRootNode(), new NodeTypePredicate(nodeType))).iterator();
while (collection.hasNext()) {
    node = collection.next();
    binary = node.getNode("jcr:content").getProperty("jcr:data").getBinary();
    dataRecord = dataStore.getRecordIfStored(binary.getDataIdentifier());
     
    if (dataRecord == null) {
        print node;
        print ' ';
        println binary;
        print '\n';
    }
}

Generated at Mon Feb 12 05:05:05 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.