Custom metadata field does not contain a valid long Actual value – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch attempts to read a custom metadata field expecting a long integer, but the actual value is not a valid long. This could be due to incorrect data type or format. To resolve this issue, you can: 1) Check the data input and ensure it’s a valid long integer. 2) Modify the mapping of the index to correctly define the data type of the field. 3) Use a script or ingest pipeline to transform the data into the correct format before indexing.

This guide will help you check for common problems that cause the log ” Custom metadata field [{}] does not contain a valid long. Actual value: [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, metadata, long.

Log Context

Log “Custom metadata field [{}] does not contain a valid long. Actual value: [{}]” class name is LifecycleExecutionState.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 }
 if (customData.containsKey(INDEX_CREATION_DATE)) {
 try {
 builder.setIndexCreationDate(Long.parseLong(customData.get(INDEX_CREATION_DATE)));
 } catch (NumberFormatException e) {
 throw new ElasticsearchException("Custom metadata field [{}] does not contain a valid long. Actual value: [{}]";
 e; INDEX_CREATION_DATE; customData.get(INDEX_CREATION_DATE));
 }
 }
 if (customData.containsKey(PHASE_TIME)) {
 try {

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?