Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for exception at discover context view using date_nanos #41353

Merged
merged 3 commits into from
Jul 18, 2019

Conversation

kertal
Copy link
Member

@kertal kertal commented Jul 17, 2019

Summary

Fix exception for Elasticsearch records with date_nanos fields that contain dates without seconds.
So now context view works with dates like 2014-01-01.

Fixes #41348

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

- [ ] This was checked for cross-browser compatibility, including a check against IE11
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [ ] Documentation was added for features that require explanation or tutorials

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately
- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately

@elasticmachine
Copy link
Contributor

💔 Build Failed

@jbudz
Copy link
Member

jbudz commented Jul 17, 2019

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kertal kertal requested a review from TinaHeiligers July 17, 2019 19:42
test('extract nanos of 2014-01-01T12:12:12.234123321Z', function() {
expect(extractNanos('2014-01-01T12:12:12.234123321Z')).toBe('234123321');
});
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a new test catching the bug

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled in the code and ran locally in Chrome. I followed the reproducibility described in 41348 and getting an error with the date being parsed as before epoch time.
Screen Shot 2019-07-18 at 8 54 18 AM

"reason":"date[1967-10-29T08:30:00Z] is before the epoch in 1970 and cannot be stored in nanosecond resolution"

:
Screen Shot 2019-07-18 at 8 44 24 AM

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After setting mu OSS timezone to Vienna Europe, the fix works as expected:
Screen Shot 2019-07-18 at 8 17 42 PM

However, using my local timezone (Arizona) in my OSS or Setting that to Pretoria, South Africa, causes a time parsing problem where the time is parsed as a negative offset to the current time. It looks like the date is being parsed in negative years.
Screen Shot 2019-07-18 at 7 21 18 PM

@kertal kertal merged commit 8cfe265 into elastic:master Jul 18, 2019
kertal added a commit to kertal/kibana that referenced this pull request Jul 19, 2019
…ic#41353)

* Fix extracting nanos of timestamps with only dates

* Add jest test catching it
kertal added a commit to kertal/kibana that referenced this pull request Jul 19, 2019
…ic#41353)

* Fix extracting nanos of timestamps with only dates

* Add jest test catching it
kertal added a commit that referenced this pull request Jul 19, 2019
… (#41555)

* Fix extracting nanos of timestamps with only dates

* Add jest test catching it
kertal added a commit that referenced this pull request Jul 19, 2019
… (#41554)

* Fix extracting nanos of timestamps with only dates

* Add jest test catching it
@manakulkarni
Copy link

Hi! The exact same error being faced for someone accessing it in India. Fails with the above error. But does not give that error when in America/Phoenix timezone. I am running ES 7.4.2 version.

I am not clear about the fix here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log context view error "timeFieldValue.split(...)[1] is undefined" when using date_nanos
5 participants