Skip to content

Error parsing date formatted using RFC3339 with 1 digit subsecond #41633

Closed
@rucciva

Description

@rucciva

Describe the feature:

Elasticsearch version (bin/elasticsearch --version): 7.0.0 (docker)

Plugins installed: []

JVM version (java -version): openjdk version "12" 2019-03-19

OS version (uname -a if on a Unix-like system): 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

Exception when indexing document with certain date value

"Caused byjava.lang.IllegalArgumentExceptionfailed to parse date field [2019-04-26T07:43:02.6Z] with format [strict_date_optional_time||epoch_millis]

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. PUT /test/_doc/1
    {
      "date" : "2015-01-01T12:10:30Z"
    }
    
  2. PUT /test/_doc/1
    {
      "date" : "2015-01-01T12:10:30.2Z"
    }
    

Provide logs (if relevant):

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse field [date] of type [date] in document with id '1'"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse field [date] of type [date] in document with id '1'",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "failed to parse date field [2015-01-01T12:10:30.2Z] with format [strict_date_optional_time||epoch_millis]",
      "caused_by": {
        "type": "date_time_parse_exception",
        "reason": "Failed to parse with all enclosed parsers"
      }
    }
  },
  "status": 400
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Core/Infra/CoreCore issues without another label:Search Foundations/MappingIndex mappings, including merging and defining field typesTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions