-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Fix Version/s: 2.4.53
-
Component/s: Web UI
-
Release Notes Summary:Dates are correctly handled by the audit search when language is set to Arabic.
-
Tags:
-
Backlog priority:800
-
Sprint:UI - 2021-08, UI - 2021-09, UI - 2021-10, UI - 2021-11
Steps to reproduce :
- log in to Nuxeo WebUI
- go to the Analytics page
- observe the data are displayed
- in Chrome settings, put Arabic on top on the languages
- go back to the Analytics tab and do a force-reload of the page
- it displays an error with a server side stacktrace
Caused by: org.elasticsearch.client.ResponseException: method [GET], host [http://localhost:9200], URI [/nuxeo-audit/entry/_search], status line [HTTP/1.1 400 Bad Request] {"error":{"root_cause":[{"type":"parse_exception","reason":"failed to parse date field [٢٠٢١-٠٦-٠٩] with format [strict_date_optional_time||epoch_millis]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"nuxeo-audit","node":"X7lj3pz1T9K63VVGQFXteA","reason":{"type":"parse_exception","reason":"failed to parse date field [٢٠٢١-٠٦-٠٩] with format [strict_date_optional_time||epoch_millis]","caused_by":{"type":"illegal_argument_exception","reason":"Parse failure at index [0] of [٢٠٢١-٠٦-٠٩]"}}}]},"status":400}
However the problem comes from WebUI which translates the date from "2021-06-01" to "٢٠٢١-٠٦-٠٩" whereas the dates must not be translated when the _search endpoint is called
Failing query
curl -H 'content-type:application/json' -XGET 'localhost:9200/nuxeo-audit/entry/_search?pretty&search_type=dfs_query_then_fetch' -d '{"query":{"bool":{"must":[{"term":{"eventId":"download"}},{"range":{"eventDate":{"gte":"٢٠٢١-٠٦-٠٩","lte":"٢٠٢١-٠٧-٠٩"}}},{"term":{"extended.downloadReason":"download"}}]}},"aggs":{"by":{"terms":{"field":"docUUID","size":10}}}}'
Successful query
curl -H 'content-type:application/json' -XGET 'localhost:9200/nuxeo-audit/entry/_search?pretty&search_type=dfs_query_then_fetch' -d '{"query":{"bool":{"must":[{"term":{"eventId":"download"}},{"range":{"eventDate":{"gte":"2021-06-01","lte":"2021-07-09"}}},{"term":{"extended.downloadReason":"download"}}]}},"aggs":{"by":{"terms":{"field":"docUUID","size":10}}}}'
This ticket is to request that the dates are not translated when sent as a parameter to the Audit Search endpoint.
- causes
-
WEBUI-708 Fix date input fields in Audit search form
- Resolved
- Is referenced in