ATG-Endeca Site Crashed due to Endeca content repository Corruption - v3.1.1

Problem Statement:
Site got crashed and not able to import backed-up Experience Manager rules.

Error when you Import rules:
Nov 5, 2015 3:25:32 PM com.endeca.soleng.eac.toolkit.utility.IFCRUtility importNode
INFO: Uploading contents to: http://localhost:8006/ifcr/sites/APP_NAME/configuration/tools/xmgr
Nov 5, 2015 3:25:33 PM com.endeca.soleng.eac.toolkit.utility.IFCRUtility importNode
INFO: Finished uploading contents.
Caused by: com.endeca.soleng.eac.toolkit.utility.IFCRUtility$HttpStatusException: Internal Server Error (500): javax.jcr.ItemNotFoundException: 731f7677-dc43-47d3-968e-3d1
6c49970c2/{}contentCollectionReferences

        at com.endeca.soleng.eac.toolkit.utility.IFCRUtility.execute(IFCRUtility.java:724)
        at com.endeca.soleng.eac.toolkit.utility.IFCRUtility.httpPost(IFCRUtility.java:671)
        at com.endeca.soleng.eac.toolkit.utility.IFCRUtility.httpPost(IFCRUtility.java:653)
        at com.endeca.soleng.eac.toolkit.utility.IFCRUtility.deleteNode(IFCRUtility.java:261)
        at com.endeca.soleng.eac.toolkit.component.IFCRComponent.importXml(IFCRComponent.java:195)
        at com.endeca.soleng.eac.toolkit.component.IFCRComponent.importXmlWithPrompt(IFCRComponent.java:144)
        ... 7 more


Solution:
1) Make sure you have a good copy of content repository export. To do this, execute export_site on an working environment.
 Ex: /opt/app/endeca/APP_NAME/control>./export_site.sh  XMRules.xml
2) Stop workbench.
3) Go to $ENDECA_TOOLS_CONF/state/
4) Rename sling and jackrabbit directory in here to anything other than sling and jackrabbit, or back them up to a different directory.
5) Restart workbench, this will cause the sling IFCR repository to be cleaned up.
   Note: If you have multiple apps, then all of them will be cleaned up. In this situation, run 6) and 7) below for each app.
6) Then run initialize_services./sh|bat --force from the app

         Ex: /opt/app/endeca/APP_NAME/control>./initialize_services./sh|bat --force 
7) Then import_site <export file>
       Ex: /opt/app/endeca/APP_NAME/control>./import_site.sh XMRules.xml
8) Execute a baseline_update from dyn/admin followed by a promote_content

5 comments:

  1. I wanted to add that, workbench users are lost after renaming sling and jackrabbit. Its better to backup users as per instructions in migration guide

    ReplyDelete
    Replies
    1. Thanks Vijai for your comment. Migrating on version 3.1.0 and 3.1.1 is not possible but yes it is possible on 3.1.2 and 11.x

      Delete
  2. sir , I follwed your solution but at 7th step -->
    root@localhost control]# ./import_site.sh XMRules.xml
    [07.27.16 05:59:23] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
    [07.27.16 05:59:25] INFO: Definition has not changed.
    [07.27.16 05:59:25] SEVERE: Caught an exception while invoking method 'importXmlWithPrompt' on object 'IFCR'. Releasing locks.

    Caused by java.lang.reflect.InvocationTargetException
    sun.reflect.NativeMethodAccessorImpl invoke0 - null
    Caused by java.io.FileNotFoundException
    com.endeca.soleng.eac.toolkit.component.IFCRComponent createImportFileClone - XMRules.xml was not Found.

    [root@localhost control]#


    what should I do now?

    ReplyDelete
  3. Hi Ravi, During import_site in windows environment, I am getting errors as follows:-
    C:\Endeca\apps\discover\control>import_site C:\KPNA_2018\discover-endeca-xm-site.xml
    [05.28.19 12:19:13] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
    [05.28.19 12:19:16] INFO: Definition has not changed.
    Application 'discover' already exists in IFCR. Delete existing content and continue? [Y/N]:
    Y
    [05.28.19 12:19:23] INFO: Upgrading xml file...
    [05.28.19 12:19:23] INFO: Backing up export file...
    [05.28.19 12:19:23] INFO: Creating upgraded export file...
    [05.28.19 12:19:23] INFO: Removing backup file...
    [05.28.19 12:19:23] INFO: Backing up existing content to: http://USWIIS002:8006/ifcr/tmp/discover_2019-05-28_12-19-23
    [05.28.19 12:19:25] INFO: Deleting old content: http://USWIIS002:8006/ifcr/sites/discover
    [05.28.19 12:19:26] INFO: Importing new content...
    [05.28.19 12:19:31] SEVERE: Import failed. Restoring from backup...

    Caused by com.endeca.soleng.eac.toolkit.utility.IFCRUtility$HttpStatusException
    com.endeca.soleng.eac.toolkit.utility.IFCRUtility execute - Internal Server Error (500): javax.jcr.RepositoryException: java.io.IOException: The handle is invalid

    [05.28.19 12:19:32] INFO: Deleting temporary node.
    [05.28.19 12:19:33] INFO: Finished importing content.

    the localhost and machine details are correct as per all XML present in endeca.

    ReplyDelete