Malformed content; after first object; either the type field – Elasticsearch Error How To Solve Related Issues

Malformed content; after first object; either the type field – Elasticsearch Error How To Solve Related Issues

Updated: July-20

Elasticsearch Version: 1.7-8.0

This guide will help you check for common problems that cause the error message”Malformed content; after first object; either the type field”. To understand what might cause it to appear, read bellow frequent issues related to the Elasticsearch concepts: index.

Advanced users might want to skip right to trying out the Elasticsearch Error Check-Up, which analyses ES to discover the cause of many errors to provide actionable recommendations (JSON based, no fee and just 2 minutes to complete).

Log Context

Log”Malformed content; after first object; either the type field”classname  is DocumentParser.java
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

final XContentParser.Token token = parser.nextToken();
  if (token == XContentParser.Token.END_OBJECT) {
  // empty doc; we can handle it...
  return true;
  } else if (token != XContentParser.Token.FIELD_NAME) {
  throw new MapperParsingException("Malformed content; after first object; either the type field"
  + " or the actual properties should exist");
  }
  }
  return false;
  }

Related issues to this log

We have gathered selected Q&A from the community and issues from Github, that can help fix related issues please review the following for further information :

1 Displaying better error message than "No JSON object could be decoded" -views 274,805 ,score 128

GSON – JsonSyntaxException – Expected name at line 7 column 4 -views   41,803,score 13

 

 

About Opster

Opster detects, prevents, optimizes and automates everything needed to run mission-critical Elasticsearch

Find Configuration Errors

Analyze Now