question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bulk action could not parse the date format corrrectly

See original GitHub issue

I have some doc, when I save them one by one,it’s well.

but when I add them to bulk,it shows:

[2018-08-07T20:25:31,827][DEBUG][o.e.a.b.TransportShardBulkAction] [eos_daily_user_statistic][0] failed to execute bulk item (index) BulkShardRequest [[eos_daily_user_statistic][0]] containing [index {[eos_daily_user_statistic][doc][b1_cryptocurrency_contract_RAM-EOS_2018-06-09], source[{"updateTimestamp": "20180609'T'115800.000Z", "turnoverIn": 1192.0, "volumeIn": 8192.0, "code": "RAM-EOS", "volume": 8192.0, "securityId": "cryptocurrency_contract_RAM-EOS", "turnoverOut": 0.0, "userId": "b1", "turnover": 1192.0, "volumeOut": 0.0, "name": "RAM/EOS", "timestamp": "2018-06-09", "id": "b1_cryptocurrency_contract_RAM-EOS_2018-06-09"}]}]
'reason': 'Invalid format: "20180609\'T\'115800.000Z" is malformed at "0609\'T\'115800.000Z"'

I did not set special date format and just use the default,I check:

basic_date_time
A basic formatter that combines a basic date and time, separated by a T: yyyyMMdd'T'HHmmss.SSSZ.

It seems the bulk action behavior is different comparing to one doc saving.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
foolcagecommented, Aug 8, 2018

In fact it’s 20180609’T’121600.000Z ,the 2018-06-09T12:16:00+00:00 is got from es after saving.

Anyway I set the format in Date now, so what exactly the format string should be: I try

format="yyyyMMdd'T'HHmmss.SSS||yyyy-MM-dd||epoch_millis"

the mapping could be saved well,it works just in single doc saving not bulks.

format="yyyyMMddTHHmmss.SSS||yyyy-MM-dd||epoch_millis"

the mapping could not be saved.

After all,I set

timestamp = Date(format="yyyyMMdd HHmmss.SSS||yyyy-MM-dd||epoch_millis")

And just put “20180609 121600.000”,it works both single doc saving or bulks.

So what exactly the basic_date_time should be? just using the string ‘basic_date_time’ but not the format pattern?

0reactions
honzakralcommented, Aug 8, 2018

the basic_date_time is a just a label for the underlying format so it should be literally the same as specifying yyyyMMdd'T'HHmmss.SSSZ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elasticsearch cannot parse date using custom format
Help me to find my error. My mappings had the wrong type stated, so that's why elasticsearch could not map the specified date...
Read more >
How to change date format in Google Sheets and convert date ...
Learn how Google Sheets formats dates and how you can change the date format, create custom formatting and convert dates to numbers and ......
Read more >
Error 'failed to parse date' for Date Time Field with Data Loader
Valid formatting for Date/Time fields in the API are documented in the following resources:Format the 'Date' and 'Date Time' data in a CSV...
Read more >
Common CSV Template Error Messages and How to Fix Them
When creating CSV Templates, you will undoubtedly encounter errors that need to be fixed. These can be caused by problems or edge cases......
Read more >
Modify date and time formats in Zaps - Zapier Help
Formatter: Dates & Times You can use Formatter's Date/Time transform to change dates and times in your Zap. The Date/Time transform...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found