Skip to content

[ML] Datafeed preview request rejects job configuration containing unknown job_type field #134467

@KodeRad

Description

@KodeRad

Elasticsearch Version

Latest

Installed Plugins

No response

Java Version

bundled

OS Version

Darwin Konrad-elastics-MacBook-Pro 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64

Problem Description

I initially created an issue in Kibana which describes what is happening. Upon further investigation it looks like it might be an elasticsearch problem with schemas and expected fields.

Fields that are causing issues:

job_type,
job_version,
create_time,
finished_time,
model_snapshot_id

Steps to Reproduce

  1. Run this API call in Dev Tools:
GET _ml/datafeeds/_preview
{
  "job_config":{
    "job_id": "",
    "description": "",
    "job_type": "anomaly_detector",
    "groups": [],
    "analysis_config": {
      "bucket_span": "15m",
      "detectors": [
        {
          "function": "count"
        }
      ],
      "influencers": []
    },
    "data_description": {
      "time_field": "@timestamp"
    },
    "custom_settings": {
      "created_by": "advanced-wizard"
    },
    "analysis_limits": {
      "model_memory_limit": "11MB"
    }
  },
  "datafeed_config":{
    "datafeed_id": "",
    "job_id": "",
    "indices": [
      "fq"
    ],
    "query": {
      "bool": {
        "must": [
          {
            "match_all": {}
          }
        ]
      }
    },
    "runtime_mappings": {}
  }
}
  1. Observe the error

Logs (if relevant)

{
  "error": {
    "root_cause": [
      {
        "type": "x_content_parse_exception",
        "reason": "[1:61] [job_details] unknown field [job_type]"
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[1:73] [preview_datafeed_action] failed to parse field [job_config]",
    "caused_by": {
      "type": "x_content_parse_exception",
      "reason": "[1:61] [job_details] unknown field [job_type]"
    }
  },
  "status": 400
}

Metadata

Metadata

Assignees

Labels

:mlMachine learning>bugTeam:MLMeta label for the ML team

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions