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

User cannot generate a csv report while adding(& saving) or deleting (& saving) filters on an index pattern. #63366

Closed
bhavyarm opened this issue Apr 13, 2020 · 5 comments · Fixed by #63623
Assignees
Labels
bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:Discover Discover Application Feature:Filters regression Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@bhavyarm
Copy link
Contributor

bhavyarm commented Apr 13, 2020

Kibana version: 7.7.0 BC5 (latest snapshot from apr 13th)

Elasticsearch version: 7.7.0 BC5 (latest snapshot from apr 13th)

Server OS version: darwin_x86_64

Browser version: chrome latest

Browser OS version: os x

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

Describe the bug: If user adds a filter or deletes a filter - on an index pattern - even after saving - Kibana doesn't let her generate csv report in discover. Instead it keeps displaying the message - please save your work.

Please note - if you switch the index pattern and then open the saved search on the previous index pattern with/without filter on which you were trying to generate report - then Kibana lets you generate the CSV report without any issues.

Steps to reproduce:

  1. Add a filter on any of the sample data in Kibana in discover
  2. Save the state as saved search
  3. Go to share - click on CSV report - Kibana tells the user to save the work.
  4. Delete the filter and save it - click on share and csv report - Kibana tells the user to save the work
  5. Click on new - Kibana switches the index pattern to default
  6. Click open and open the saved search from step 2 or step 4 - you can successfully generate a CSV report.

Screenshots (if relevant):
Screen Shot 2020-04-13 at 11 44 34 AM

Errors in browser console (if relevant):
While saving the discover state with .keyword filter:

kbn-ui-shared-deps.js:334 TypeError: Cannot read property 'change' of undefined
    at 22.bundle.js:3
    at c.$digest (kbn-ui-shared-deps.js:334)
    at kbn-ui-shared-deps.js:334
    at Yr.completeTask (kbn-ui-shared-deps.js:334)
    at kbn-ui-shared-deps.js:334
(anonymous) @ kbn-ui-shared-deps.js:334
(anonymous) @ kbn-ui-shared-deps.js:334
$digest @ kbn-ui-shared-deps.js:334
(anonymous) @ kbn-ui-shared-deps.js:334
Yr.completeTask @ kbn-ui-shared-deps.js:334
(anonymous) @ kbn-ui-shared-deps.js:334
setTimeout (async)
o.defer @ kbn-ui-shared-deps.js:334
$evalAsync @ kbn-ui-shared-deps.js:334
_callee10$ @ 22.bundle.js:3
l @ kbn-ui-shared-deps.js:288
(anonymous) @ kbn-ui-shared-deps.js:288
forEach.e.<computed> @ kbn-ui-shared-deps.js:288
asyncGeneratorStep @ 22.bundle.js:3
_next @ 22.bundle.js:3
Promise.then (async)
asyncGeneratorStep @ 22.bundle.js:3
_next @ 22.bundle.js:3
Promise.then (async)
asyncGeneratorStep @ 22.bundle.js:3
_next @ 22.bundle.js:3
(anonymous) @ 22.bundle.js:3
(anonymous) @ 22.bundle.js:3
_saveDataSource @ 22.bundle.js:3
saveDataSource @ 22.bundle.js:3
onSave @ 22.bundle.js:3
_callee$ @ commons.bundle.js:3
l @ kbn-ui-shared-deps.js:288
(anonymous) @ kbn-ui-shared-deps.js:288
forEach.e.<computed> @ kbn-ui-shared-deps.js:288
asyncGeneratorStep @ commons.bundle.js:3
_next @ commons.bundle.js:3
(anonymous) @ commons.bundle.js:3
(anonymous) @ commons.bundle.js:3
onSaveConfirmed @ commons.bundle.js:3
_callee$ @ commons.bundle.js:3
l @ kbn-ui-shared-deps.js:288
(anonymous) @ kbn-ui-shared-deps.js:288
forEach.e.<computed> @ kbn-ui-shared-deps.js:288
asyncGeneratorStep @ commons.bundle.js:3
_next @ commons.bundle.js:3
(anonymous) @ commons.bundle.js:3
(anonymous) @ commons.bundle.js:3
(anonymous) @ commons.bundle.js:3
m @ kbn-ui-shared-deps.js:342
w @ kbn-ui-shared-deps.js:342
(anonymous) @ kbn-ui-shared-deps.js:342
x @ kbn-ui-shared-deps.js:342
L @ kbn-ui-shared-deps.js:342
T @ kbn-ui-shared-deps.js:342
O @ kbn-ui-shared-deps.js:342
Cn @ kbn-ui-shared-deps.js:342
ce @ kbn-ui-shared-deps.js:342
Ln @ kbn-ui-shared-deps.js:342
Dn @ kbn-ui-shared-deps.js:342
On @ kbn-ui-shared-deps.js:342
t.unstable_runWithPriority @ kbn-ui-shared-deps.js:350
Hi @ kbn-ui-shared-deps.js:342
se @ kbn-ui-shared-deps.js:342
Tn @ kbn-ui-shared-deps.js:342
Show 27 more frames
@bhavyarm bhavyarm added bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application regression (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:Visualizations Visualization editors, elastic-charts and infrastructure :Filters labels Apr 13, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@bhavyarm
Copy link
Contributor Author

Please note this is a regression from 7.6.2

@bhavyarm bhavyarm changed the title User cannot generate a csv report while there are filters on .keyword in discover User cannot generate a csv report while adding(& saving) or deleting (& saving) on an index pattern. Apr 13, 2020
@bhavyarm bhavyarm changed the title User cannot generate a csv report while adding(& saving) or deleting (& saving) on an index pattern. User cannot generate a csv report while adding(& saving) or deleting (& saving) filters on an index pattern. Apr 13, 2020
@flash1293
Copy link
Contributor

flash1293 commented Apr 14, 2020

Seems like the problem is that https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js#L60 is always undefined. https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js#L772 should actually be chrome.docTitle.

I'm not sure how exactly this broke after 7.6.2 - will prepare a fix though.

There is a workaround - the saving works, but after this an error is preventing discover to inform the share popover. If you open the saved search via the flyout again, it takes another path through the code and the button becomes clickable.

@flash1293
Copy link
Contributor

flash1293 commented Apr 15, 2020

OK, I investigated this further and it seems like there is another underlying problem as well.

The check whether the current state is dirty is comparing to the initialState: https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover_state.ts#L175

Even if you saved your search, it would still recognize this as dirty and there is no mechanism to update this initalState variable as far as I can tell.

@kertal I think you worked on the state management here recently, could you have a look please?

@kertal
Copy link
Member

kertal commented Apr 15, 2020

@flash1293 thx, taking over

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:Discover Discover Application Feature:Filters regression Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants