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

[ML] Machine Learning plugin links redirecting to Kibana home #67365

Closed
LucaWintergerst opened this issue May 26, 2020 · 9 comments · Fixed by #70074
Closed

[ML] Machine Learning plugin links redirecting to Kibana home #67365

LucaWintergerst opened this issue May 26, 2020 · 9 comments · Fixed by #70074
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Anomaly Detection ML anomaly detection :ml v7.9.0

Comments

@LucaWintergerst
Copy link
Contributor

Kibana version: 7.7.0

Elasticsearch version: 7.7.0

Server OS version: Mac, Elastic Cloud

Browser version: Chrome 83.0.4103.61 (latest as of May 26, 2020)

Browser OS version: MacOs Catalina 10.15.3

Original install method (e.g. download page, yum, from source, etc.): targz (but also fails in Elastic Cloud)

Describe the bug:

When trying to open a single metric job in a new tab, Kibana sometimes redirects to the Kibana home http://localhost:5601/app/kibana#/home

Steps to reproduce:

  1. Dowload Kibana / Elasticsearch 7.7
  2. Start Kibana, ES
  3. Load sample data logs
  4. Start trial license
  5. create ML Job, choose default log sample data jobs
  6. open Job results, go to single metric viewer
  7. select time range sometime in the past
  8. copy link from your Browser, e.g. something like:
    http://localhost:5601/app/ml#/timeseriesexplorer?_a=%28mlTimeSeriesExplorer%3A%28zoom%3A%28from%3A%272020-06-14T14%3A45%3A23.723Z%27%2Cto%3A%272020-06-18T06%3A23%3A29.309Z%27%29%29%29&_g=%28ml%3A%28jobIds%3A%21%28low_request_rate%29%29%2CrefreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%2Ctime%3A%28from%3A%272020-05-17T00%3A39%3A02.912Z%27%2Cmode%3Aabsolute%2Cto%3A%272020-07-16T21%3A45%3A26.749Z%27%29%29
  9. open a new tab (I suggest using hotkeys) paste, press enter
  10. repeat 9 a LOT. It reproduces more often if you do it quickly and open the next tab before the previous tab loaded

Expected behavior:

Open timeseries job on selected timerange

Screenshots (if relevant):

Errors in browser console (if relevant):

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

Any additional context:

@myasonik myasonik added the :ml label May 26, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson peteharverson added Feature:Anomaly Detection ML anomaly detection bug Fixes for quality problems that affect the customer experience v7.9.0 labels May 27, 2020
@LucaWintergerst
Copy link
Contributor Author

This issue is also present in 7.8, using a BC build in Cloud done on "build_date" : "2020-05-27T09:36:46.769033Z",

@LucaWintergerst
Copy link
Contributor Author

The same issue also happens for the Anomaly Explorer, so it's not just tied to single metric views

@LucaWintergerst
Copy link
Contributor Author

In fact, it even happens for the jobs view, so it affects all of ML. Linking to a specific job is impossible in some cases

https://mykibana.elastic.dev/app/ml#/jobs?_g=%28refreshInterval%3A%28pause%3A%21f%2Cvalue%3A30000%29%29

@LucaWintergerst
Copy link
Contributor Author

The following links also don't work
/app/ml => that's what Kibana loads when clicking the ML icon
/app/ml#/overview => then it changes to this
/app/ml#/overview?_g=%28refreshInterval%3A%28pause%3A%21t%2Cvalue%3A0%29%29 => then to this

but none of these work if opened in a separate tab

@pheyos
Copy link
Member

pheyos commented Jun 5, 2020

FWIW: I've also noticed this when opening the Create new ML job in a new tab after file data visualizer import (7.8.0-bc5).

image

@walterra
Copy link
Contributor

walterra commented Jun 24, 2020

I'm investigating the issue and can reproduce it on Cloud. So far I wasn't able to reproduce it on a local install regardless of it being a dev environment or installed from a released version.

24.06.2020, some more investigation:

  • Could reproduce it on a 7.8 cloud instance
  • Could reproduce it on a 7.7. cloud instance
  • Cannot reproduce on local dev master branch
  • Cannot reproduce on local dev 7.7 branch
  • Cannot reproduce on local release build of 7.7

25.06.2020, could reproduce it on a local installation (7.7 release build):

  • go to anomaly jobs list
  • option-click (not sure if option or alt on windows) a lot of times on one of the "Open in Anomaly Explorer" buttons of one job so you open a lot of tabs with that same link
  • some random tabs then might redirect to Kibana home. Also confirmed you end up on the spaces-picker page if there's more than one space.

@walterra walterra changed the title [ML] Single Metric Viewer links redirecting to kibana home [ML] Machine Learning plugin links redirecting to Kibana home Jun 25, 2020
@walterra
Copy link
Contributor

25.06.2020, testing with Kibana's 7.7 branch:

  • Cannot reproduce the issue when running Kibana via yarn start (dev start with optimize/watcher)
  • But I can reproduce the issue when running Kibana via node scripts/kibana

I cannot reproduce in a way to proof the following 100%, but I have one suspicion:

The PR #59275 changed how the plugin initializes licensing information in 7.7 (The issue doesn't occur pre 7.7). Looking at the code, I think there is a chance of a race condition happening with the licensing setup using an observable (https://github.com/elastic/kibana/blob/master/x-pack/plugins/ml/common/license/ml_license.ts#L34) - the update via the observable could be missed and would trigger a redirect.

Further testing/debuggin plan:

  • Test with a basic license, then a redirect should happen to the data visualizer page, this would proof that it's license related

@walterra
Copy link
Contributor

I could verify that the race-condition-theory from the previous comment is indeed the root cause:

  • The bug triggered a redirect to Kibana Home which also refreshed the web developer console, so we couldn't see any console output before the redirect
  • I created a version that avoids the redirect and just outputs console logs.
  • When the page loads successfully, we get the following output:
MlLicense.setup() called, subscribing to license updates.              ml_license.ts:37
license$.subscribe() triggered, initialized license information.       ml_license.ts:54
  • When the error occurs, we get the following:
MlLicense.setup() called, subscribing to license updates.              :5601/bundles/plugin/ml/ml.plugin.js:1515
call to redirectToKibana()                                             :5601/bundles/plugin/ml/1.plugin.js:77988
license$.subscribe() triggered, initialized license information.       :5601/bundles/plugin/ml/ml.plugin.js:1532
  • We can now see that there's a call to redirectToKibana() because the license information hasn't been initialized.

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 Feature:Anomaly Detection ML anomaly detection :ml v7.9.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants