Skip to content

[Reporting] Using migrated saved search for CSV Export throws errors #43230

@tsullivan

Description

@tsullivan

Kibana version: 8.0/master

Elasticsearch version: 8.0/master

Server OS version: Darwin

Browser version: Chrome

Browser OS version: Darwin

Original install method (e.g. download page, yum, from source, etc.): source / dev mode

Describe the bug:
Appears that the data model for saved search objects changed in 7.4.0. Exporting CSV from a saved search ID had to be fixed in #42964. But if we use a saved search that came from an upgrade, or has the older data model, a similar still incompatibility exists as the original bug.

Steps to reproduce:

  1. Create a saved search and dashboard that has a saved search panel in Kibana 7.3.0
  2. Upgrade the stack to 7.4.0 and retain Kibana saved objects
  3. Follow the instructions in [Feature/Reporting] Export Saved Search CSV as Dashboard Panel Action #34571 and add
    xpack.reporting.csv.enablePanelActionDownload: true in the kibana.yml.
  4. Open the dashboard
  5. Click Download CSV in the saved search panel

Expected behavior:
Download the CSV

Screenshots (if relevant):

Screen Shot 2019-08-13 at 2 51 09 PM

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

server    log   [14:47:55.045] [error][reporting][savedobject-csv] Generate CSV Error! [x_content_parse_exception] [1:580] [field_sort] failed to parse field [order] :: {"path":"/babynames/_search","query":{"scroll":"30s","size":500},"body":"{\"_source\":{\"includes\":[\"date\",\"_source\"]},\"docvalue_fields\":[\"date\"],\"query\":{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_time\",\"gte\":\"1974-01-01T00:00:00-07:00\",\"lte\":\"2019-08-13T14:47:54-07:00\"}}},{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_optional_time\",\"gte\":\"1974-01-01T07:00:00.000Z\",\"lte\":\"2019-08-13T21:47:54.926Z\"}}}],\"should\":[],\"must_not\":[]}}],\"should\":[],\"must_not\":[]}},\"script_fields\":{},\"sort\":[{\"date\":{\"order\":\"desc\",\"unmapped_type\":\"boolean\"}},{\"d\":{\"order\":\"a\"}},{\"d\":{\"order\":\"e\"}}]}","statusCode":400,"response":"{\"error\":{\"root_cause\":[{\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\"}],\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"No enum constant org.elasticsearch.search.sort.SortOrder.A\"}},\"status\":400}"}
server   error  [14:47:54.940]  [x_content_parse_exception] [1:580] [field_sort] failed to parse field [order] :: {"path":"/babynames/_search","query":{"scroll":"30s","size":500},"body":"{\"_source\":{\"includes\":[\"date\",\"_source\"]},\"docvalue_fields\":[\"date\"],\"query\":{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_time\",\"gte\":\"1974-01-01T00:00:00-07:00\",\"lte\":\"2019-08-13T14:47:54-07:00\"}}},{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_optional_time\",\"gte\":\"1974-01-01T07:00:00.000Z\",\"lte\":\"2019-08-13T21:47:54.926Z\"}}}],\"should\":[],\"must_not\":[]}}],\"should\":[],\"must_not\":[]}},\"script_fields\":{},\"sort\":[{\"date\":{\"order\":\"desc\",\"unmapped_type\":\"boolean\"}},{\"d\":{\"order\":\"a\"}},{\"d\":{\"order\":\"e\"}}]}","statusCode":400,"response":"{\"error\":{\"root_cause\":[{\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\"}],\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"No enum constant org.elasticsearch.search.sort.SortOrder.A\"}},\"status\":400}"}
    at respond (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/src/lib/transport.js:315:15)
    at checkRespForFailure (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/src/lib/transport.js:274:7)
    at HttpConnector.<anonymous> (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:166:7)
    at IncomingMessage.wrapper (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
server    log   [14:51:07.852] [error][reporting][savedobject-csv] Generate CSV Error! [x_content_parse_exception] [1:580] [field_sort] failed to parse field [order] :: {"path":"/babynames/_search","query":{"scroll":"30s","size":500},"body":"{\"_source\":{\"includes\":[\"date\",\"_source\"]},\"docvalue_fields\":[\"date\"],\"query\":{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_time\",\"gte\":\"1974-01-01T00:00:00-07:00\",\"lte\":\"2019-08-13T14:51:07-07:00\"}}},{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_optional_time\",\"gte\":\"1974-01-01T07:00:00.000Z\",\"lte\":\"2019-08-13T21:51:07.742Z\"}}}],\"should\":[],\"must_not\":[]}}],\"should\":[],\"must_not\":[]}},\"script_fields\":{},\"sort\":[{\"date\":{\"order\":\"desc\",\"unmapped_type\":\"boolean\"}},{\"d\":{\"order\":\"a\"}},{\"d\":{\"order\":\"e\"}}]}","statusCode":400,"response":"{\"error\":{\"root_cause\":[{\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\"}],\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"No enum constant org.elasticsearch.search.sort.SortOrder.A\"}},\"status\":400}"}
server   error  [14:51:07.763]  [x_content_parse_exception] [1:580] [field_sort] failed to parse field [order] :: {"path":"/babynames/_search","query":{"scroll":"30s","size":500},"body":"{\"_source\":{\"includes\":[\"date\",\"_source\"]},\"docvalue_fields\":[\"date\"],\"query\":{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_time\",\"gte\":\"1974-01-01T00:00:00-07:00\",\"lte\":\"2019-08-13T14:51:07-07:00\"}}},{\"bool\":{\"must\":[],\"filter\":[{\"match_all\":{}},{\"match_all\":{}},{\"range\":{\"date\":{\"format\":\"strict_date_optional_time\",\"gte\":\"1974-01-01T07:00:00.000Z\",\"lte\":\"2019-08-13T21:51:07.742Z\"}}}],\"should\":[],\"must_not\":[]}}],\"should\":[],\"must_not\":[]}},\"script_fields\":{},\"sort\":[{\"date\":{\"order\":\"desc\",\"unmapped_type\":\"boolean\"}},{\"d\":{\"order\":\"a\"}},{\"d\":{\"order\":\"e\"}}]}","statusCode":400,"response":"{\"error\":{\"root_cause\":[{\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\"}],\"type\":\"x_content_parse_exception\",\"reason\":\"[1:580] [field_sort] failed to parse field [order]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"No enum constant org.elasticsearch.search.sort.SortOrder.A\"}},\"status\":400}"}
    at respond (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/src/lib/transport.js:315:15)
    at checkRespForFailure (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/src/lib/transport.js:274:7)
    at HttpConnector.<anonymous> (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:166:7)
    at IncomingMessage.wrapper (/Users/tsullivan/elastic/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1103:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugFixes for quality problems that affect the customer experiencezDeprecated Feature:ReportingUse Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions