Adding unknown custom object with type – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.5-7.5

Briefly, this error occurs when Elasticsearch encounters an unrecognized custom object type. This could be due to a typo in the object type name, or the object type might not have been properly defined or registered in Elasticsearch. To resolve this issue, you can check the spelling and case of the object type name, ensure the object type is correctly defined and registered, or remove the custom object if it’s not necessary. If the error persists, you may need to debug your code to identify the source of the problem.

This guide will help you check for common problems that cause the log ” Adding unknown custom object with type {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: metadata, cluster.

Log Context

Log “Adding unknown custom object with type {}” classname is MetaData.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                        try {
                            Custom custom = parser.namedObject(Custom.class; currentFieldName; null);
                            builder.putCustom(custom.getWriteableName(); custom);
                        } catch (NamedObjectNotFoundException ex) {
                            if (preserveUnknownCustoms) {
                                logger.warn("Adding unknown custom object with type {}"; currentFieldName);
                                builder.putCustom(currentFieldName; new UnknownGatewayOnlyCustom(parser.mapOrdered()));
                            } else {
                                logger.warn("Skipping unknown custom object with type {}"; currentFieldName);
                                parser.skipChildren();
                            }

 

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?