Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Failed to generate reports if index patterns are used in saved searches #249

Closed
f3n9 opened this issue Dec 15, 2020 · 7 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@f3n9
Copy link

f3n9 commented Dec 15, 2020

Report source is "Saved search"
File Format is "CSV"
Trigger Type is "On demand"
The index pattern used in the saved search is "prod-idx-event-*".

Here are the kibana log messages:

===============================================
{"type":"log","@timestamp":"2020-12-15T12:01:05Z","tags":["error","plugins","opendistroReportsKibana"],"pid":31465,"message":"Failed to generate report from reportDefinition id ibVFZnYB1gN8UFs84_td : TypeError: Cannot read property 'settings' of undefined"}

{"type":"log","@timestamp":"2020-12-15T12:01:05Z","tags":["error","plugins","opendistroReportsKibana"],"pid":31465,"message":"TypeError: Cannot read property 'settings' of undefined\n at getMaxResultSize (/usr/share/kibana/plugins/opendistroReportsKibana/server/routes/utils/savedSearchReportHelper.ts:163:35)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}

{"type":"error","@timestamp":"2020-12-15T12:01:04Z","tags":[],"pid":31465,"level":"error","error":{"message":"Internal Server Error","name":"Error","stack":"Error: Internal Server Error\n at HapiResponseAdapter.toError (/usr/share/kibana/src/core/server/http/router/response_adapter.js:132:19)\n at HapiResponseAdapter.toHapiResponse (/usr/share/kibana/src/core/server/http/router/response_adapter.js:86:19)\n at HapiResponseAdapter.handle (/usr/share/kibana/src/core/server/http/router/response_adapter.js:81:17)\n at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:164:34)\n at process._tickCallback (internal/process/next_tick.js:68:7)"},"url":{"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":"?timezone=Asia%2FShanghai","query":{"timezone":"Asia/Shanghai"},"pathname":"/api/reporting/generateReport/ibVFZnYB1gN8UFs84_td","path":"/api/reporting/generateReport/ibVFZnYB1gN8UFs84_td?timezone=Asia%2FShanghai","href":"/api/reporting/generateReport/ibVFZnYB1gN8UFs84_td?timezone=Asia%2FShanghai"},"message":"Internal Server Error"}

{"type":"response","@timestamp":"2020-12-15T12:01:04Z","tags":[],"pid":31465,"method":"post","statusCode":500,"req":{"url":"/api/reporting/generateReport/ibVFZnYB1gN8UFs84_td?timezone=Asia%2FShanghai","method":"post","headers":{"host":"log.prod1.bj.xxxxx.net","kbn-version":"7.10.0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36","content-type":"application/json","accept":"/","origin":"https://log.prod1.bj.xxxxx.net","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://log.prod1.bj.xxxxx.net/app/opendistro_kibana_reports","accept-encoding":"gzip, deflate, br","accept-language":"en,zh-CN;q=0.9,zh;q=0.8,en-US;q=0.7,zh-TW;q=0.6","x-forwarded-for":"10.192.9.39","x-forwarded-host":"log.prod1.bj.xxxxx.net","x-forwarded-server":"log.prod1.bj.xxxxx.net","connection":"Keep-Alive","content-length":"0","securitytenant":""},"remoteAddress":"10.192.9.51","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36","referer":"https://log.prod1.bj.xxxxx.net/app/opendistro_kibana_reports"},"res":{"statusCode":500,"responseTime":463,"contentLength":9},"message":"POST /api/reporting/generateReport/ibVFZnYB1gN8UFs84_td?timezone=Asia%2FShanghai 500 463ms - 9.0B"}

@f3n9
Copy link
Author

f3n9 commented Dec 15, 2020

If I change the index pattern to a specific index name like 'prod-idx-event-2020.12.15', reports can be generated and downloaded successfully.

@e100
Copy link

e100 commented Dec 16, 2020

I have this same error

@zhongnansu
Copy link
Member

Hi I am able to reproduce this issue, seems like the csv logic doesn't apply to saved search with index pattern. It sounds like something important that we missed. We'll look into that.

@abhishekjiitr
Copy link

Facing the same issue

@f3n9
Copy link
Author

f3n9 commented Dec 19, 2020

Thanks for looking into it and for the prompt fix.
I merged the diff into my installation and confirm that the report generating issue with wildcard index patterns has been fixed.
Great work!

@abhishekjiitr
Copy link

@zhongnansu are there any plans to release this fix as a part of a patch release, or do we have to wait for the next minor release of ODFE?

@zhongnansu zhongnansu self-assigned this Jan 6, 2021
@anirudha
Copy link
Contributor

anirudha commented Jan 8, 2021

This should be part of the next release in early feb.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants