Skip to content

Transforms fails due to invalid year field when using a particular date #66602

Closed
@djaswal

Description

@djaswal

Elasticsearch version (bin/elasticsearch --version): 7.9.1

Plugins installed: [] - None

JVM version (java -version): 1.8.0_222-ea

OS version (uname -a if on a Unix-like system): Ubuntu 18.04

Description of the problem including expected versus actual behavior:
Transform should succeed for any dates instead of failing with the following message:

Preview of field's value: '-7948800000']; nested: DateTimeException[Invalid value for Year (valid values -999999999 - 999999999): -7948800000];

Steps to reproduce:

Please include a minimal but complete recreation of the problem,
including (e.g.) index creation, mappings, settings, query etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.

  1. Create index
PUT test_date_transform
  {
  "mappings": {
    "properties": {
      "date":    { "type": "date" }
    }
  }
  }
  1. Add the specific datetime to the index
POST test_date_transform/_doc
{
  "date": "1969-10-01T00:00:00",
  "value": "test2"
}
  1. Create the transform
PUT _transform/testtransform
{
  "source": {
    "index": [
      "test*"
    ]
  },
  "pivot": {
    "group_by": {
      "date": {
        "date_histogram": {
          "field": "date",
          "calendar_interval": "1m"
        }
      }
    },
    "aggregations": {
      "value.keyword.cardinality": {
        "cardinality": {
          "field": "value.keyword"
        }
      }
    }
  },
  "dest": {
    "index": "transform_destination"
  }
}
  1. Start the transform and it will fail.

Provide logs (if relevant):
Failed to index documents into destination index due to permanent error: [BulkIndexingException[Bulk index experienced [1] failures and at least 1 irrecoverable [TransformException[Destination index mappings are incompatible with the transform configuration.]; nested: MapperParsingException[failed to parse field [date] of type [date] in document with id '_2vj-jAZwoUNV8WjDqeWhPQAAAAAAAAA'. Preview of field's value: '-7948800000']; nested: DateTimeException[Invalid value for Year (valid values -999999999 - 999999999): -7948800000];; MapperParsingException[failed to parse field [date] of type [date] in document with id '_2vj-jAZwoUNV8WjDqeWhPQAAAAAAAAA'. Preview of field's value: '-7948800000']; nested: DateTimeException[Invalid value for Year (valid values -999999999 - 999999999): -7948800000];; java.time.DateTimeException: Invalid value for Year (valid values -999999999 - 999999999): -7948800000]. Other failures: ]; nested: TransformException[Destination index mappings are incompatible with the transform configuration.]; nested: MapperParsingException[failed to parse field [date] of type [date] in document with id '_2vj-jAZwoUNV8WjDqeWhPQAAAAAAAAA'. Preview of field's value: '-7948800000']; nested: DateTimeException[Invalid value for Year (valid values -999999999 - 999999999): -7948800000];; TransformException[Destination index mappings are incompatible with the transform configuration.]; nested: MapperParsingException[failed to parse field [date] of type [date] in document with id '_2vj-jAZwoUNV8WjDqeWhPQAAAAAAAAA'. Preview of field's value: '-7948800000']; nested: DateTimeException[Invalid value for Year (valid values -999999999 - 999999999): -7948800000];; MapperParsingException[failed to parse field [date] of type [date] in document with id '_2vj-jAZwoUNV8WjDqeWhPQAAAAAAAAA'. Preview of field's value: '-7948800000']; nested: DateTimeException[Invalid value for Year (valid values -999999999 - 999999999): -7948800000];; java.time.DateTimeException: Invalid value for Year (valid values -999999999 - 999999999): -7948800000]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions