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

[Bug] Discover document query timeout - 8.12.0 #175216

Closed
aarju opened this issue Jan 22, 2024 · 8 comments
Closed

[Bug] Discover document query timeout - 8.12.0 #175216

aarju opened this issue Jan 22, 2024 · 8 comments
Labels
blocked bug Fixes for quality problems that affect the customer experience impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. upstream

Comments

@aarju
Copy link

aarju commented Jan 22, 2024

Kibana version:
8.12.0

Elasticsearch version:
8.12.0

Describe the bug:
When running a wildcard query on our AWS Integration data view the Kibana data query will return quickly and update the timeline view, but the document view will take a long time to populate and sometimes will timeout.

While testing this in the dev tools console I found that by removing the highlight section of the query that is added in discover the query will return quickly as expected.

Steps to reproduce:

  1. Run an async query on the aws cloudtrail integration:
POST /logs-aws.cloudtrail*/_async_search?batched_reduce_size=64&ccs_minimize_roundtrips=true&wait_for_completion_timeout=200ms&keep_on_completion=true&keep_alive=60000ms&ignore_unavailable=true&preference=1705924391493
{
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "query_string": {
            "query": "*192.168.1.1*"
          }
        },
        {
          "range": {
            "@timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2024-01-21T14:00:00.000Z",
              "lte": "2024-01-22T14:29:45.693Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  },
  "highlight": {
    "pre_tags": [
      "@kibana-highlighted-field@"
    ],
    "post_tags": [
      "@/kibana-highlighted-field@"
    ],
    "fields": {
      "*": {}
    },
    "fragment_size": 2147483647
  }
}

In our cluster this query will timeout and not return results.

  1. Remove the "highlight" element from the json and re-run the query
POST /logs-aws.cloudtrail*/_async_search?batched_reduce_size=64&ccs_minimize_roundtrips=true&wait_for_completion_timeout=200ms&keep_on_completion=true&keep_alive=60000ms&ignore_unavailable=true&preference=1705924391493
{
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "query_string": {
            "query": "*192.168.1.1*"
          }
        },
        {
          "range": {
            "@timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2024-01-21T14:00:00.000Z",
              "lte": "2024-01-22T14:29:45.693Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}

In our cluster this query returns results in 14s

Expected behavior:

Screenshots (if relevant):
Screenshot 2024-01-22 160336

Screenshot 2024-01-22 155446

Errors in browser console (if relevant):

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

Any additional context:

@aarju aarju added the bug Fixes for quality problems that affect the customer experience label Jan 22, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 22, 2024
@nreese nreese added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Jan 22, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 22, 2024
@davismcphee
Copy link
Contributor

@aarju Thanks for reporting! Can you confirm if any of the fields in the index mapping are of type match_only_text?

Linking a couple of likely related issues for our future reference:

@aarju
Copy link
Author

aarju commented Jan 23, 2024

This data view is from the AWS Cloudtrail integration. In the docs they mention 10 fields that are mapped as match_only_text. I don't have permissions on this cluster to view the data view mapping, but we generally stick to the defaults for these integrations so it is likely that they are mapped that way.

@aarju
Copy link
Author

aarju commented Jan 23, 2024

@christophercutajar just confirmed that the fields such as error.message are mapped as match_only_text.

{
  ".ds-logs-aws.cloudtrail-ecmaster-2024.01.22-000149": {
    "mappings": {
      "error.message": {
        "full_name": "error.message",
        "mapping": {
          "message": {
            "type": "match_only_text"
          }
        }
      }
    }
  }
} 

@kertal
Copy link
Member

kertal commented Jan 26, 2024

like @davismcphee mentioned, this is high likely this issue in ES, elastic/elasticsearch#103298 so currently in Kibana we can't fix this, setting the issue to blocked

@kertal kertal added the impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. label Feb 15, 2024
@kertal
Copy link
Member

kertal commented Sep 10, 2024

@aarju it's been a while and elastic/elasticsearch#103298 was merged 8.14.0, 8.13.1 could you evaluate if the issue is still present? many thx!

@aarju
Copy link
Author

aarju commented Sep 11, 2024

@kertal it looks like this bug is no longer present and this issue can be closed. Thanks!

@aarju aarju closed this as completed Sep 11, 2024
@kertal
Copy link
Member

kertal commented Sep 11, 2024

@aarju thx, great to hear! FYI @lukasolson @davismcphee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Fixes for quality problems that affect the customer experience impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. upstream
Projects
None yet
Development

No branches or pull requests

5 participants