Error Identification and Handling in Data Hub Processing
The topic describes where to look, what to look for, and hints about addressing data processing errors.
How do I handle data processing errors?
- When processing errors occur, they affect the status of the data item. Using the techniques and tools listed in the following table, you can identify the specific processing that is causing the problem. Then you can:
- Use one of the Data Hub processes to DELETE the item - Deleting Canonical Items by Raw Item for example
- Design a custom extension (data handler) to address the issue permanently, for example composition or publication - Composition Handlers or Handlers (Advanced)
- Ensure good data from the source system - – Pre-Installation Planning Guide –
- When processing errors occur, they affect the status of the data processing process. The Data Hub log file is your very best tool for identifying process errors. Processing errors are driven by data errors, but that statement is not always true. For example, resource issues, connectivity issues, and configuration issues are also potential culprits.
Where are Data Hub errors listed?
Within Data Hub, errors are made available through the following:
| Error Source | Example |
|---|---|
| Data Hub UI | Within Data Hub Backoffice, there is The Backoffice Data Hub Cockpit Errors and Failures Menu Option. The menu option provides detailed access to the errors that occur during Load, Compose, and Publish. By detailed, we mean error listings down to the individual item level. |
| Data Hub REST API | The document Using the REST API to Gather Transactional Information gives many examples of how you can use the Data Hub REST API to mine information, including error, from the database. |
| The Data Hub log file | Data Hub logging configuration is defined in the logback.xml file. The default logging configuration provides a wealth of information, but the Logging document also provides hints for making logging even more comprehensive. |
| JMX notifications and queries | MBeans linked with a Data Hub event, for example CompositionCompletion and TargetSystemPublicationCompletion. Using JMX for Operations or in Extension Development |
| Direct database queries | You could query the CanonicalItem or PublicationError tables for example. However, such queries are recommended only as a last resort. |
| Data Hub Monitoring | Review the topics in Monitoring. |
How can I Identify Errors in the logfile?
Errors in the logfile are called out with a SEVERE, ERROR, or WARNING heading. The other heading appearing in the logfile is INFO. It is informative but not a marker of problems.
Data Hub Fails to Start
There are multiple things that can cause Data Hub not to start. Review the WARN and ERRORS. It's a given that a SEVERE problem must be addressed.
Apr 17, 2017 1:05:24 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/datahub-webapp] startup failed due to previous errors
In this example, you would have to refer back to previous error statements in the logfile. You would then identify which error or combination of errors was keeping Data Hub from starting.
Extensions do not Load Properly
2017-04-18 10:37:21,162 [ERROR] [c.h.d.e.l.i.DependencyResolvingExtensionOrderResolver] Extension missing-dependency has a dependency on extension a-missing-extension that has not been loaded. 2017-04-18 10:37:21,162 [ERROR] [c.h.d.e.l.i.DependencyResolvingExtensionOrderResolver] Extension circular-dependency-A has a circular dependency on extension circular-dependency-B
If the extension is improperly designed or misconfigured, Data Hub prints a stack trace and throws the MalformedExtensionException to indicate the problem. Unfortunately, Data Hub does not provide an API that would allow you to see which extensions are loaded.
Database is not Running
Some databases stop running and do not retart properly even when they are configured to start at system restart. If your database is not running when you try to start Data Hub, the error message is not completely clear cut. You get, for example,
2017-04-17 13:05:24,368 [ERROR] [o.s.w.c.ContextLoader] Context initialization failed Followed by lots of other information and ending with Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Unidentified Data Hub Encryption Key
Data Hub has a default encryption key. The key is saved in a file, and you reference the default encryption key file from the local.properties file.
2017-04-17 13:42:36,447 [ERROR] [c.h.d.s.i.DefaultEncryptionKeyRetrievalStrategy] Error trying to load encryption key from file
Database not Properly Defined
Notice in the last line of the codeblock that the database driver is defined as com.mysq.jdbc.jdbc2.optional.MysqlDataSource. It should be com.mysql.jdbc.jdbc2.optional.MysqlDataSource
2017-04-17 13:29:41,675 [WARN] [c.h.d.s.ExtensionEnabledXmlWebApplicationContext] Exception encountered during context initialization - canceling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/hybris/datahub/persistence/jpa/config/HibernateJpaConfig.class]: Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysq.jdbc.jdbc2.optional.MysqlDataSource
Querying Your Database
- Open your database.
- For composition errors, from the prompt in your database query editor, enter the following SQL query:
SELECT * from CanonicalItem WHERE status = 'FAILURE';
- For publication errors from the target system only, from the prompt in your database query editor, enter the following SQL query:
SELECT * FROM PublicationError;