-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Reporting/CSV Export] issues with high search latency in ES #129524
Comments
The solution we went with was to stream the output data to the client as the search results are compiled into CSV Fixed in #123067 |
Sorry - I just realized that this issue was filed against 8.1, which includes that change I linked to. |
@llermaly Can you provide a HAR file of the dashboard app, so we can see the network requests and what is happening with them? If not, maybe just a screenshot of the network panel of the browser, showing the request to download the CSV? |
Pinging @elastic/kibana-app-services (Team:AppServicesUx) |
Hello @tsullivan , the download times out before finishing: If you wait until the end the red toast mentioning time out appears. Moment of failure |
@llermaly a few more questions to understand the line where things go wrong:
Thanks very much for the screenshots, these were super helpful. |
Thanks! , will be posting here after some tests. |
@llermaly I'm unsure about this. I will have to experiment with test data to try to reproduce the issue. |
Curl request output: curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2) |
Hi @llermaly I started looking into this issue in an Elastic Cloud deployment (v8.1.3). I loaded 450K documents into an index and put a saved search to that index in a dashboard. When I downloaded CSV from there, I received a file that was 10MB by default. I increased the It looks like you are working with an export that is 400MB, but there's a known issue in Elastic Cloud making the largest export available (currently) set to 52MB. Questions:
|
@tsullivan Curl is also failing in my side: Curl request output: curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2) The browser failing is different though, my browser does not show that message, only the request fails. |
Related: #135274 |
I was able to come up with a test case that breaks the "Download CSV" feature by adding 30 seconds of latency to the initial request for the data over scan/scroll. At that level of latency, increasing the
I ran tests to download 5000 documents from a saved search, using a dev instance of Kibana that connected to Elasticsearch through a simple node proxy, which intercepted requests and responses to Elasticsearch, and slowed down the response for Download CSV data. What I found is that Download CSV can handle the latency of Elasticsearch data only when latency is lower than 30 seconds for the first request. When it is 30 seconds or higher, the ES client connection times out and logs an These logs show the search timeout error happening when generating a CSV report in Discover:
These logs show the errors when attempting to use "Download CSV" in Dashboard:
This server-side client timeout doesn't have a workaround. Theoretically, When using curl, the download request will fail with In Chrome, the network panel will show the request for If the end-user accesses Kibana through a proxy or in a Cloud instance of Kibana, the error as seen in the client will be different, as it is a response crafted by the proxy. The status of the response may be 502 or 504, instead of "empty response." The workaround is to address performance and search latency on the Elasticsearch side. Other issues I discovered during this investigation: |
A proper long-term fix for this will be to use asynchronous search for CSV export, so we don't depend on keeping a connection open for a long time in NodeJS. A decent band-aid will be to add louder warnings in the logs and in the report job itself, telling the user / administrator that the results are incomplete. Similar to #136445 |
I'm going to keep this issue open, and put it back on the backlog. Long-running connections don't work well in Cloud environments, regardless of any timeout settings we can try to apply. CSV export needs an async search implementation. |
An issue has come up where troubleshooting could have gone much faster if we pass on the shard failure warnings from the search response, and add them to the warnings of the report job. Rather than filing a separate issue, this needs to be a consideration as part of this issue effort to improve CSV export. |
Will be closed by #143144 |
I want to close the loop on this issue. With the investigation that has come from this issue, and the latest changes made from #143144, there are certain things we know can be supported, and certain things that can not.
[1] It should be noted that retries can be controlled on our side, but that wasn't part of my research. I'm closing this issue, as I believe we've done all we can to make CSV export robust and stable. There are known problems where latency in ES can cause problems with CSV export. However, in my research on this, I found that is true of many features that run in the background in the Kibana server and (for now) the best thing to do may be to scale up ES with more memory or nodes, so that search is not slow. |
Kibana version:
8.1.2
Elasticsearch version:
8.1.2
Server OS version:
Elastic Cloud
Browser version:
Latest Chrome
Browser OS version:
Original install method (e.g. download page, yum, from source, etc.):
Cloud
Describe the bug:
Exporting large saved searches will show a toast saying your download will be ready shortly. And never finishes, no way to see the export progress. I understand this export options are for summarized tables so few seconds after exporting the download should start.
This is not the case with large saved searches where the export will take minutes and may fail. This kind of large searches should be saved as reports in the report section.
Steps to reproduce:
Expected behavior:
Large saved search CSV exports running as a Report for progress tracking
The text was updated successfully, but these errors were encountered: