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

[Search Sessions] cleanup error when navigating away from a loading dashboard without saving the session #104309

Closed
flash1293 opened this issue Jul 5, 2021 · 5 comments
Assignees
Labels
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. loe:medium Medium Level of Effort

Comments

@flash1293
Copy link
Contributor

Kibana version: 7.14

Describe the bug: When navigating away from a dashboard which is currently loading without saving the session first, the document in .async_search gets deleted, but the search session saved object is still around - it will enter error state after a while because the current state can't be polled, then get cleaned up. While doing the cleanup, Kibana attemps to delete the async search which will create an error in the Kibana log

Steps to reproduce:

  1. Go to long loading dashboard (e.g. by using the shard delay agg)
  2. Navigate away before loading finished
  3. Wait for a few mins
  4. Error in the server logs like this:
server    log   [16:31:52.721] [error][dataEnhanced][data_enhanced][plugins] search_sessions_cleanup Error while deleting async_search FkNHNVRkQWotVGlTenNoLTItZFZZdUEcTk5ub3g1elZTQkdPZUd5QW8xeHJxZzo5MzU4OA==: resource_not_found_exception: [resource_not_found_exception] Reason: FkNHNVRkQWotVGlTenNoLTItZFZZdUEcTk5ub3g1elZTQkdPZUd5QW8xeHJxZzo5MzU4OA==

Expected behavior:
No error

Any additional context:
As mentioned above, the async search managed by Elasticsearch and the session saved object managed by Kibana get out of sync. In this scenario the saved object should be deleted as well.

@flash1293 flash1293 added bug Fixes for quality problems that affect the customer experience Team:AppServices labels Jul 5, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@flash1293
Copy link
Contributor Author

Same thing happens when a session gets "stopped" - the async searches are cleaned up, but the session object sticks around.

@lizozom lizozom added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jul 6, 2021
@lizozom lizozom changed the title Search session cleanup error when navigating away from a loading dashboard without saving the session [Search Sessions] cleanup error when navigating away from a loading dashboard without saving the session Jul 6, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Jul 8, 2021
@Dosant
Copy link
Contributor

Dosant commented Jul 12, 2021

Related (possible duplicate): #98698

@Dosant
Copy link
Contributor

Dosant commented Jul 13, 2021

I tried to reproduce, while I see the underlying problem, I wasn't able to see a log in kibana server.
Looks like this log is already muted:

if (e.message !== 'resource_not_found_exception') {
logger.error(
`${SEARCH_SESSIONS_CLEANUP_TASK_TYPE} Error while deleting async_search ${searchInfo.id}: ${e.message}`
);
}

It also should be muted in 7.14, but then I wonder @flash1293, what version have you tested?

Regarding the issue:
I think longer-term we should find a way to avoid getting in an out-of-sync state. This could possibly be addressed with some variation of #99658, which has some unsolved problems with dashboard<->lens session sharing atm.

But for now, I suggest a small improvement, where we stop trying to delete a search if we know it has already errored out: #105434

@Dosant
Copy link
Contributor

Dosant commented Jul 15, 2021

We made an improvement to this by #105434. Also no error log should happen anymore.
Created longer-term ticket where we need to create some structure around canceling searches and changing session state: #105441

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 impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort
Projects
None yet
Development

No branches or pull requests

4 participants