Showing posts with label Endeca Scripts. Show all posts
Showing posts with label Endeca Scripts. Show all posts

Endeca Scripts: Initialize_services.sh Fails With HTTP 404 Error

Problem Statement:

When trying to run initialize services in a newly deployed application the following error is returned
INFO: Provisioning site from prototype...
Jan 11, 2016 3:15:20 PM com.endeca.soleng.eac.toolkit.script.Script runBeanShellScript
SEVERE: Not Found (404):
Occurred while executing line 3 of valid BeanShell script:
[[

1|
2|
3| IFCR.provisionSite();
4| WorkbenchManager.updateWsConfig();
5|
6|
]]


Solution:
This error is thrown when the version of the Deployment Template being used is incompatible with the workbench version. Download the correct version of the deployment template for your version of workbench and redeploy the application.

IFCR PromotionSite Error retrieving content bytes and Site loses all Endeca content - Endeca 3.1.x

Problem: IFCR Throws Below ERRORS and Site loses all Endeca content
++++++++++++++++++++
26.11.2015 01:15:35.779 *ERROR* [New I/O server worker #1-24] com.endeca.ifcr.publish.impl.content.server.PromotionSite Error retrieving content bytes. javax.jcr.RepositoryException: /51/49/9fec56a9409dbc581ca02b80efec/%7bhttp%3a%2f%2fwww.jcp.org%2fjcr%2f1.0%7ddata.0.bin: the specified resource does not exist
at org.apache.jackrabbit.core.value.BLOBInResource.getStream(BLOBInResource.java:111)
at org.apache.jackrabbit.core.value.BLOBInResource.copy(BLOBInResource.java:100)
...
...
Caused by: org.apache.jackrabbit.core.fs.FileSystemException: /opt/app/endeca/ToolsAndFrameworks/3.1.1/server/workspace/state/sling/_ifcr/jackrabbit/workspaces/default/blobs/51/49/9fec56a9409dbc581ca02b80efec/%7bhttp%3a%2f%2fwww.jcp.org%2fjcr%2f1.0%7ddata.0.bin does not denote an existing file

26.11.2015 01:15:46.646 Channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:639)
at org.jboss.net*ERROR* [New I/O server worker #1-26] com.endeca.ifcr.publish.impl.content.server.ContentServer Exception caught in channel handling. java.nio.channels.ClosedChannelException

++++++++++++++++++++

Solution:
Workaround Solution:
Try to execute multiple times promote content script
/opt/app/endeca/apps/APP_NAME/control> promote_content.sh| promote_content.bat

It could be due to:  
1) Increased number of application servers 
2) Increased number of Workbench clients
3) Larger promote_content snapshots
4) Endeca Resource Resolver issue

You can ask for a patch to fix it.

How to gather Server Statistics During the Endeca Baseline? - Endeca Baseline

Run below command before you kick of baseline update.
 top -b -d 60 -n 20 > ServerStats.out
Above command gathers 'top' statistics every 60 seconds for the next 20 mins. 

Promote content from Workbench 3.1.x to a Dgraph breaks the site - Endeca Site Down

Problem Statement:
When you run promote_content.bat|sh script site goes down immediately

Check IFCR Log :
Path: /opt/app/endeca/ToolsAndFrameworks\3.1.x/server/workspace/logs/ifcr.log
 
18.08.2015 19:49:38.641 *ERROR* [172.25.74.131 [1439945378629] GET /ifcr/sites/CRS/thesaurus.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException org.apache.sling.api.SlingException:
  ...
Caused by: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "en"

    at java.net.URLDecoder.decode(URLDecoder.java:173)
    at java.net.URLDecoder.decode(URLDecoder.java:83)
    at org.apache.jsp.apps.endeca.thesaurus.html_jsp._jspService(html_jsp.java:118)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
    ... 61 more


Solution:
Using a non-xml 1.0 safe character in a thesaurus entry causes the thesaurus content publish step within the promote_content process to fail. The rest of the content may succeed to be published, or the publish may fail entirely.

Obtain the following patch for Tools And Frameworks 3.1.x from support.oracle.com:

16863449: XM3.1.1: MDEX 6.4 INVALID XML CHARACTERS USED IN THESAURUS CAUSE PUBLISH FAILURE

Caught an exception while checking provisioning EacCommunicationException - Endeca Provisioning

Problem Statement: 
    While doing Endeca provisioning got below exception
     $ /opt/app/endeca/apps/CRS/control/initialize_services.sh --force 

    Removing existing crawl configuration for crawl CRS-last-mile-crawl (ignore errors if crawl doesn't exist)
com.endeca.itl.cas.cmd.CasCmdException: CRS-last-mile-crawl was not found
Removing Record Store CRS-data (ignore errors if Record Store doesn't exist)
Successfully deleted component: CRS-data
Removing Record Store CRS-dimvals (ignore errors if Record Store doesn't exist)
Successfully deleted component: CRS-dimvals
Removing Dimension Value Id Manager CRS-dimension-value-id-manager (ignore errors if Dimension Value Id Manager doesn't exist)
Removing existing application provisioning...
[08.14.15 12:17:17] INFO: Removing application. Any active components will be forced to stop.
[08.14.15 12:17:17] INFO: Application 'CRS' is not defined.
Creating Dimension Value Id Manager CRS-dimension-value-id-manager
Creating Record Store CRS-data
Successfully created component: CRS-data
Successfully set recordstore configuration.
Creating Record Store CRS-dimvals
Successfully created component: CRS-dimvals
Setting EAC provisioning and performing initial setup...
[08.14.15 12:17:33] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
[08.14.15 12:17:33] INFO: Setting definition for application 'CRS'.
[08.14.15 12:17:33] SEVERE: Caught an exception while checking provisioning.
Caused by com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.application.Application setDefinition - Caught exception while defining application 'CRS'.
Caused by com.endeca.eac.client.EACFault
sun.reflect.NativeConstructorAccessorImpl newInstance0 - null
 

  Solution: 
         1)      Stop the EAC (Endeca HTTP Service)
         2)      Rename the directory  /opt/app/endeca/PlatformServices/workspace/state to state-backup
         3)      Create an empty state directory
         4)      Start the Endeca HTTP Service again
         5)      Now try to provision application using initialize_services.sh --force command

How to Remove the Endeca application? - Endeca

While removing an Endeca application, do not simply remove the Endeca application directories or delete EAC state directories (ENDECA_CONF/state/eac*) from in the file system.
This leaves application artifacts, which can cause naming conflicts when creating a new project with the same name. Clients running Oracle ATG Commerce, having random Endeca application artifacts can interfere with Commerce Reference Store installation and with indexing functionality.
To completely remove an Endeca application follow below steps:

Step 1:  Remove APP using runcommand
              <Endeca-app-dir>\control\runcommand.sh|bat --remove-app
              CRS\control\runcommand.sh|bat --remove-app

Step 2: Drop the corresponding Record stores from CAS
            Check names of application record stores registered in CAS.
             $CAS_ROOT\bin>component-manager-cmd.bat/.sh list-components
Remove the record stores corresponding to your Endeca application.  The record store names will be prefixed with the application name.
For example:
$CAS_ROOT/bin>component-manager-cmd.bat/.sh delete-component -n myAppName_en_data 
$CAS_ROOT/bin>component-manager-cmd.bat/.sh delete-component -n myAppName_en_schema
$CAS_ROOT/bin>component-manager-cmd.bat/.sh delete-component -n myAppName_en_prules
$CAS_ROOT/bin>component-manager-cmd.bat/.sh delete-component -n myAppName_en_dimvals

Step 3: Finally, remove the Endeca application directory from the file system

What can Partial update do and can't do? - Endeca partial Update

What can Partial update do and can't do ? 

Endeca Property: 
 - Change, Remove, Update the property values.
 - Cannot Add, Remove, Change a property itself 

Dimension:
 - Change, Remove, Update dimension values. 
 - Cannot Add, Remove, Change a dimension itself
 - Cannot Add, Remove something in the hierarchy of dimension values

Endeca promote_content.sh script fails with Exception - SEVERE: Caught an exception while invoking method 'run' on object 'PromoteAuthoringToLive'. Releasing locks.

ERROR Message #1: 
/opt/app/endeca/apps/CRS/control]
$ ./promote_content.sh
[08.02.15 11:20:18] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
[08.02.15 11:20:19] INFO: Updating definition for custom component 'IFCR'.
[08.02.15 11:20:19] INFO: Updating provisioning for host 'ITLHost'.
[08.02.15 11:20:19] INFO: Updating definition for host 'ITLHost'.
[08.02.15 11:20:20] INFO: Definition updated.
[08.02.15 11:20:20] INFO: Promoting IFCR content...
[08.02.15 11:20:20] SEVERE: null
Occurred while executing line 3 of valid BeanShell script:
[[

1|
2|
3|    IFCR.promoteFromAuthoringToLive();
4|
5|
]]

[08.02.15 11:20:20] SEVERE: Caught an exception while invoking method 'run' on object 'PromoteAuthoringToLive'. Releasing locks.
Caused by java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl invoke0 - null
Caused by com.endeca.soleng.eac.toolkit.exception.AppControlException
com.endeca.soleng.eac.toolkit.script.Script runBeanShellScript - Error executing valid BeanShell script.
Caused by java.lang.NullPointerException
com.endeca.soleng.eac.toolkit.utility.IFCRUtility extractIfcrErrorMessage - null


Error Message #2:
Running Promote script from Endeca Experience Manager fails
Solution:
Check if workbench admin password got changed. If admin password got changed through Endeca Administrative Console then make sure you update WorkbenchConfig.xml  file with latest password

Ex:  /opt/app/endeca/apps/CRS/config/script/WorkbenchConfig.xml
 <!--
    ########################################################################
    # IFCR - A component that interfaces with the Workbench repository.
  -->
  <custom-component id="IFCR" host-id="ITLHost" class="com.endeca.soleng.eac.toolkit.component.IFCRComponent">
    <properties>
      <property name="repositoryUrl" value="http://localhost:8006/ifcr" />
      <property name="username" value="admin" />
      <property name="password" value="admin123" />

      <property name="numExportBackups" value="3" />
    </properties>
  </custom-component>

ATG-Endeca Site outage: Front End application goes down when baseline_update.bat|sh or promote_content.bat|sh script is triggered (Endeca v3.1.0, Endeca v3.1.1 and Endeca 3.1.2)

Problem Statement: 
ATG-Endeca Site goes down when baseline_update.bat|sh or promote_content.bat|sh script is triggered. This happens on applications which uses Endeca v3.1.0, Endeca v3.1.1 and Endeca 3.1.2 

Solution:
User may not see any error message when baseline_update.bat|sh or promote_content.bat|sh script is triggered but ERROR message will be logged in IFCR log file with failed rule which is created in Experience Manager with a specific location.

Ex: *ERROR*  POST /ifcr/system/endeca/mdexPublisher HTTP/1.1] com.endeca.ifcr.publish.impl.PublishService Unable to publish config documents com.endeca.ifcr.configService.ConfigServiceException: Config service error: Validation failed with 1 error [Unknown DVAL_ID 100972 specified for MERCH_RULE_TRIGGER in rule with id 21. Ignoring this MERCH_RULE element.]
Quick fix will be Correct all invalid rule(s) by modifying the problem rule(s) and set a valid location for each using Experience Manager and re-promote the content using promote_content.bat|sh script

Permanent fix: 
Apply below patch which is strongly recommended by ORACLE.
16761103: PUBLISH ACTION FOR EXPERIENCE MANAGER FAILS ON INVALID DVAL IDS
 OR
upgrading to MDEX 6.4.1.2 or later which contains these fixes 

This patch alters the MDEX behavior so that if an Experience Manager rule is ignored due to a missing dimension value used as the trigger, the MDEX publish action will still proceed with the valid rules and succeeds instead of failing.   After applying the patch, you will need to re-promote the content to the engines so that the MDEX's will end up with a good set of rules/content.

How to print all Endeca components status? - Endeca EAC

Displaying the status of Endeca application components.

1) Go to Endeca APP control directory
Example: /opt/app/endeca/apps/CRS/control

2)  Use runcommand to print status of all Endeca components 
$ ./runcommand.sh --print-status
Status of components defined in AppConfig.xml.
  AuthoringDgraph: Running
  DgraphA1: Failed
  LogServer: Running
  WeeklyReportGenerator: NotRunning
  DailyReportGenerator: NotRunning
  DaySoFarReportGenerator: NotRunning
  WeeklyHtmlReportGenerator: NotRunning
  DailyHtmlReportGenerator: NotRunning
  DaySoFarHtmlReportGenerator: NotRunning
  ConfigurationGeneratorForge: NotRunning
  Forge: NotRunning
  PartialForge: NotRunning
  Dgidx: NotRunning

How to check the Endeca locks acquired and release them? - Endeca Scripts

1) Go to below directory
         /opt/app/endeca/PlatformServices/11.1.0/bin

2) To check all the flags acquired run below command
         ./eaccmd.sh list-flags --app CRS
         
Flag Examples: baseline_data_ready
                            update_lock


3) Depending on the output you can remove any flags acquired. Here is the command to remove flags one by one:
           ./eaccmd.sh remove-flag --app CRS--flag baseline_data_ready

4) you can remove all flags at once by using below command:
            ./eaccmd.sh remove-all-flags --app CRS

FYI - CRS is Endeca application name

Creating the Endeca EAC Application via Scripts - Deployment Template

How to create the Endeca EAC application?
  1. On the machine where Oracle Commerce Guided Search with Experience Manager is installed, create the directory where the EAC application will reside
    Example: /opt/app/endeca/apps 

  2. Copy the <ATG11dir>/CommerceReferenceStore/Store/Storefront/deploy directory to a temporary location on the machine where Oracle Commerce Guided Search with Experience Manager is installed.
    Example: /opt/app/ATGtemp

  3. Execute the deploy script. 
    Example:
    /opt/app/endeca/ToolsAndFrameworks/11.1.0/deployment_template/bin >./deploy.sh --app /opt/app/ATGtemp/deploy/deploy.xml

  4. Press Enter to continue with the install
  5. Enter the following information for the script prompts:
    • Enter N to install a base deployment.

    • Enter CRS for the name of the application.

    • Enter the full path to the Apps directory, 
      Example: /opt/app/endeca/apps 
    • Enter the EAC port (default is 8888)

    • Workbench port number [8006]

    • Dgraph1 (Live Dgraph) port (default is 15000)

    • Authoring Dgraph port (default is 15002)

    • LogServer port (default is 15010)

    • Enter the CAS install directory using UNIX-style forward slashes, even if on Windows. 
      Example:/opt/app/endeca/CAS/11.1.0

    • Enter the CAS version number (default is 11.1.0).

    • Enter the CAS hostname (default is localhost).

    • Enter the CAS port (default is 8500).

    • Enter the language code (default is en).

    • Enter the fully-qualified Workbench hostname (localhost)

    • Production application server host name. This is the host where the ATGProduction server will be running. [localhost]

    • Production application server HTTP port number. 
      IMPORTANT: If you are following the instructions in this guide, these values are 7003 for WebLogic, 8080 for JBoss and Tomcat, and 9081 for WebSphere.

    • Preview host name [localhost]

    • Preview port number.

      If you are following the instructions in this guide, these values are 7003 for WebLogic, 8080 for JBoss and Tomcat, and 9081 for WebSphere.

    • Context root of the preview application [crs]

    • Host name of the user segment server. This is the server that will respond to Experience Manager requests for Business Control Center user segment data. Oracle recommends using the Content Adminstration server (also called the ATGPublishing server in this guide). [localhost]

    • HTTP port of the user segment server.  
      IMPORTANT: If you are following the instructions in this guide, these values are 7003 for WebLogic, 8080 for JBoss and Tomcat, and 9081 for WebSphere

    • Path for the Oracle Wallet jps-config.xml file
      Example:  /opt/app/endeca/ToolsAndFrameworks/11.1.0/server/workspace/credential_store/jps-config.xml
    • Application configuration archive path. This is the location where content promoted using the file-based method is stored,
      Example, /opt/app/endeca/apps/CRS/data/workbench/application_export_archive 
    You see a message that says “Application successfully deployed” when the deployment is finished. 

  6. Change directories to the EAC applications directory, 
    Example: /opt/app/endeca/apps 
    The CRS application directory is added as child of the /apps directory.

How to provision the EAC application?
  1. In a UNIX shell, change directories to your EAC application’s /control directory,
    Example: /opt/app/endeca/apps/CRS/control

  2. Execute the initialize_services.sh script.
    ./initialize_services.sh

Endeca Forge process completed but fails at Dgidx process - Endeca Tips

Problem Statement:
Forge process completed but fails at Dgidx process

$ ./baseline_update.sh
 BASELINE SCRIPT STARTED
[07.12.15 19:37:32] INFO: Released lock 'update_lock'.
 Copy crawl files to incoming and processing folder
[07.12.15 19:37:33] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
[07.12.15 19:37:34] INFO: Definition has not changed.
[07.12.15 19:37:34] INFO: Starting baseline update script.
[07.12.15 19:37:34] INFO: Acquired lock 'update_lock'.
[07.12.15 19:37:34] INFO: [ITLHost] Starting shell utility 'cleanDir_processing'.
[07.12.15 19:37:35] INFO: [ITLHost] Starting shell utility 'move_-_to_processing'.
[07.12.15 19:37:37] INFO: [ITLHost] Starting copy utility 'fetch_config_to_input_for_forge_Forge'.
[07.12.15 19:37:38] INFO: [ITLHost] Starting backup utility 'backup_log_dir_for_component_ConfigurationGeneratorForge'.
[07.12.15 19:37:39] INFO: [ITLHost] Starting component 'ConfigurationGeneratorForge'.
[07.12.15 19:38:08] INFO: [ITLHost] Starting backup utility 'backup_log_dir_for_component_Forge'.
[07.12.15 19:38:10] INFO: [ITLHost] Starting component 'Forge'.
[07.12.15 19:38:24] INFO: [ITLHost] Starting backup utility 'backup_log_dir_for_component_Dgidx'.
[07.12.15 19:38:25] INFO: [ITLHost] Starting component 'Dgidx'.
[07.12.15 19:38:27] SEVERE: Batch component  'Dgidx' failed. Refer to component logs in /opt/app/endeca/apps/APP_NAME/./logs/dgidxs/Dgidx on host ITLHost.
Occurred while executing line 26 of valid BeanShell script:[[

23|        Forge.archiveLogDir();
24|        Forge.run();
25|        Dgidx.archiveLogDir();
26|        Dgidx.run();
27|
28|        // distributed index, update Dgraphs
29|        DistributeIndexAndApply.run();]][07.12.15 19:38:27] SEVERE: Caught an exception while invoking method 'run' on object 'BaselineUpdate'. Releasing locks.Caused by java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl invoke0 - null
Caused by com.endeca.soleng.eac.toolkit.exception.AppControlException
com.endeca.soleng.eac.toolkit.script.Script runBeanShellScript - Error executing valid BeanShell script.
Caused by com.endeca.soleng.eac.toolkit.exception.EacComponentControlException
com.endeca.soleng.eac.toolkit.component.BatchComponent run - Batch component  'Dgidx' failed. Refer to component logs in /opt/app/endeca/apps/APP_NAME/./logs/dgidxs/Dgidx on host ITLHost.

[07.12.15 19:38:27] INFO: Released lock 'update_lock'.

Solution:
Look at below log location
/opt/app/endeca/apps/APP_NAME/logs/dgidxs/Dgidx/Dgidx.log
FATAL   07/13/15 00:38:26.899 UTC (1436747906899)       DGIDX   {dgidx,baseline}        ENE Indexer: Error processing records file.
WARN    07/13/15 00:38:26.899 UTC (1436747906899)       DGIDX   {dgidx,baseline}        Lexer/OLT log: level=-1: 2015/07/12 19:38:26 | INFO    | Disabling log callback


If you see above FATAL ERROR in Dgidx log that means forge process completed successfully but without producing output for dgidx process to index and hence dgidx process failed.

Refer below blog for more details:
http://ravihonakamble.blogspot.com/2015/06/how-to-read-data-from-endeca-cas-record.html

How to update Endeca configurations using runcommand? - Endeca Tips

If you update AppConfig.xml or any file in /opt/app/endeca/apps/APP_NAME/config/script folder you need to update your configuration for your changes to be applied.

/opt/app/endeca/apps/APP_NAME/control$>./runcommand.sh --update-definition
[07.12.15 19:14:43] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
[07.12.15 19:14:44] INFO: Updating provisioning for component 'Dgidx'.
[07.12.15 19:14:44] INFO: Updating definition for component 'Dgidx'.
[07.12.15 19:14:45] INFO: Definition updated.
 

Endeca Baseline Update Script - WARNING: Failed to obtain lock - Endeca Tips

If baseline update process is killed while running then it puts lock and it will not get released. Any subsequent baseline update process will fail.

Here is the message when you try to run baseline update when lock is acquired:
$ ./baseline_update.sh
 BASELINE SCRIPT STARTED
 Copy crawl files to incoming and processing folder
[07.12.15 18:47:26] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
[07.12.15 18:47:27] INFO: Definition has not changed.
[07.12.15 18:47:27] INFO: Starting baseline update script.
[07.12.15 18:47:27] WARNING: Failed to obtain lock.
It took 0 minutes and 3seconds


Solution:
1) User can release lock manually using below OOTB script
 /opt/app/endeca/apps/APP_NAME/control>$ ./release_update_locks.sh
 
2) Add release_update_locks.sh script as part of baseline process. Every baseline update will remove the lock acquired and then get the new lock.
Ex:
WORKING_DIR=`dirname ${0} 2>/dev/null`
. "${WORKING_DIR}/../config/script/set_environment.sh"
. "${WORKING_DIR}/release_update_locks.sh"

"${WORKING_DIR}/runcommand.sh" BaselineUpdate run 2>&1
 

Component 'Forge' is already started - Endeca FORGE

Problem Statement:

When you try to run endeca baseline update you will see message as below:

 BASELINE SCRIPT STARTED
[07.11.15 11:38:32] INFO: Released lock 'update_lock'.
 Copy crawl files to incoming and processing folder
[07.11.15 11:38:33] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
[07.11.15 11:38:34] INFO: Definition has not changed.
[07.11.15 11:38:34] INFO: Starting baseline update script.
[07.11.15 11:38:34] INFO: Acquired lock 'update_lock'.
[07.11.15 11:38:34] INFO: [ITLHost] Starting shell utility 'cleanDir_processing'.
[07.11.15 11:38:35] INFO: [ITLHost] Starting shell utility 'cleanDir_forge-output'.
[07.11.15 11:38:36] INFO: [ITLHost] Starting shell utility 'cleanDir_temp'.
[07.11.15 11:38:38] INFO: [ITLHost] Starting shell utility 'move_-_to_processing'.
[07.11.15 11:38:39] INFO: [ITLHost] Starting copy utility 'fetch_config_to_input_for_forge_Forge'.
[07.11.15 11:38:39] INFO: [ITLHost] Starting backup utility 'backup_log_dir_for_component_ConfigurationGeneratorForge'.
[07.11.15 11:38:40] INFO: [ITLHost] Starting component 'ConfigurationGeneratorForge'.
[07.11.15 11:39:10] INFO: [ITLHost] Starting backup utility 'backup_log_dir_for_component_Forge'.
[07.11.15 11:39:11] INFO: [ITLHost] Starting component 'Forge'.
[07.11.15 11:39:11] INFO: Component 'Forge' is already started.


Solution:
It will happen if someone killed baseline update process while forge is running. Easy way to release or kill process is to get into Endeca experience manager and stop Forge process.