-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 9.10-HF04
-
Component/s: Web UI
-
Release Notes Summary:The analytics dashboards in Web UI, 'Documents Created Per Week' and 'Documents Modified Per Week', use the correct format when filtering documents by date.
-
Tags:
-
Sprint:nxGang Sprint 10.2.4
-
Story Points:2
Currently the admin analytics dashboard in WebUI is not able to fetch data to display the 2 histogram "Document created and modified per week". (see screenshot)
Indeed there is a bug on the nuxeo-aggregate-data-behavior component that specify the following date format to query in ES : yyyy-MM-dd https://github.com/nuxeo/nuxeo-dataviz-elements/blob/master/nuxeo-aggregate-data-behavior.html#L114
But the date format used in the date range filter contains the date with the timestamp and timezone like: 2018-03-12T07:00:00.000Z
Therefore the following query fails :
curl 'http://localhost:8080/nuxeo/site/es/_all/_search' -H 'Accept: application/json' --data-binary '{"query":{"bool":{"must":[{"range":{"dc:created":{"gte":"2018-03-12T07:00:00.000Z","lte":"2018-04-13T07:00:00.000Z"}}}]}},"aggs":{"by":{"date_histogram":{"field":"dc:created","interval":"week","format":"yyyy-MM-dd","min_doc_count":0,"extended_bounds":{"min":"2018-03-12T07:00:00.000Z","max":"2018-04-13T07:00:00.000Z"}}}}}' --compressed
Here is the response payload (although it returns a 200 there is actually a 400 returned from ES see NXP-24763):
{"error":{"root_cause":[{"type":"parse_exception","reason":"failed to parse date field [2018-03-12T07:00:00.000Z] with format [yyyy-MM-dd]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"nuxeo","node":"3KTG7wL2QJCez4oAQvrfYQ","reason":{"type":"parse_exception","reason":"failed to parse date field [2018-03-12T07:00:00.000Z] with format [yyyy-MM-dd]","caused_by":{"type":"illegal_argument_exception","reason":"Unrecognized chars at the end of [2018-03-12T07:00:00.000Z]: [T07:00:00.000Z]"}}}]},"status":400}
Possible solution:
- Either the nuxeo-aggregate-data-behavior use the correct pattern (or maybe not even needed to send a default one yyyy-MM-dd to ES)
- Or https://github.com/nuxeo/nuxeo-web-ui/blob/master/elements/nuxeo-admin/nuxeo-repository-analytics.html#L175 should specify somehow to the aggregate the correct pattern to use
- is duplicated by
-
NXP-25022 Fix the date format used in Analytics
- Resolved