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

WIP. Strawman for doing setup in plugin#start #62709

Closed

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Apr 6, 2020

While the Ingest Manager and Fleet routes need to be run from Kibana / the browser due to required user information, I don't believe that means they must be called from a specific view.

I'd like to see if we can move the setup calls to the plugin's start lifecycle. I want to test with Endpoint as an example consumer plugin.

I'm not sure about the isInitialized return value. That's just to use show a value being passed from IM to a dependency.

Still get failures while accessing certain urls. Not sure if it's the first time or while some other logic.

Errors like 'No admin user configured', 'No default output', 'unable to authenticate user [fleet_enroll] for REST request [/_security/api_key]', etc
@jfsiii
Copy link
Contributor Author

jfsiii commented Apr 6, 2020

@nchaulet Can you take a look at this and leave your thoughts a) about the idea (calling setup logic in plugin lifecycle vs view) and b) about the errors that I mentioned?

public start(core: CoreStart) {}
public async start(core: CoreStart): Promise<IngestManagerStart> {
const config = this.config;
core.http.post('/api/ingest_manager/setup');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably missing an await here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! I think this was the cause of the errors but will confirm

@nchaulet
Copy link
Member

nchaulet commented Apr 6, 2020

I understand we want to hide the creation of the default config,
But I think for the fleet setup should be done by a user action as you are delegating your permissions to create API keys and to agent to send data to ES.

For the errors can you give more context on how you get them?

@jfsiii
Copy link
Contributor Author

jfsiii commented Apr 6, 2020

@nchaulet thanks for the quick and helpful comments

I understand we want to hide the creation of the default config,
But I think for the fleet setup should be done by a user action as you are delegating your permissions to create API keys and to agent to send data to ES.

Yeah, that's totally reasonable. I can revert that part and we can always change later if we need to.

@@ -61,7 +63,11 @@ export class IngestManagerPlugin
});
}

public start(core: CoreStart) {}
public async start(core: CoreStart): Promise<IngestManagerStart> {
const { isInitialized } = await core.http.post('/api/ingest_manager/setup');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious on how the app is going to react if this call throw an error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally. I will explicitly handle it and return false for now and we can talk more about other options (retry then, later, etc)

@kibanamachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/machine_learning/feature_controls/ml_security·ts.machine learning feature controls security machine_learning_user and global all shows ML navlink

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: machine learning
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ debg creating role ml_source
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_source]
[00:00:00]             │ debg creating role ml_dest
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_dest]
[00:00:00]             │ debg creating role ml_dest_readonly
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_dest_readonly]
[00:00:00]             │ debg creating role ml_ui_extras
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_ui_extras]
[00:00:00]             │ debg creating user ml_poweruser
[00:00:00]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [ml_poweruser]
[00:00:00]             │ debg created user ml_poweruser
[00:00:00]             │ debg creating user ml_viewer
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [ml_viewer]
[00:00:01]             │ debg created user ml_viewer
[00:00:01]             │ debg creating user ml_unauthorized
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [ml_unauthorized]
[00:00:01]             │ debg created user ml_unauthorized
[00:00:01]           └-: feature controls
[00:00:01]             └-> "before all" hook
[00:00:01]             └-: security
[00:00:01]               └-> "before all" hook
[00:00:01]               └-> "before all" hook
[00:00:01]                 │ info [empty_kibana] Loading "mappings.json"
[00:00:01]                 │ info [empty_kibana] Loading "data.json.gz"
[00:00:01]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_1/GN16tJwQSomM6INMs8gQ8Q] deleting index
[00:00:01]                 │ info [empty_kibana] Deleted existing index [".kibana_1"]
[00:00:01]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:01]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:01]                 │ info [empty_kibana] Created index ".kibana"
[00:00:01]                 │ debg [empty_kibana] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:00:01]                 │ info [empty_kibana] Indexed 2 docs into ".kibana"
[00:00:01]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana/YpiZZeH6RWOwDQuAFGlo7g] update_mapping [_doc]
[00:00:01]                 │ debg Migrating saved objects
[00:00:01]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana/YpiZZeH6RWOwDQuAFGlo7g] update_mapping [_doc]
[00:00:02]                 │ proc [kibana]   log   [20:59:54.899] [info][savedobjects-service] Creating index .kibana_2.
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:02]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] updating number_of_replicas to [0] for indices [.kibana_2]
[00:00:02]                 │ proc [kibana]   log   [20:59:55.036] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:02]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] updating number_of_replicas to [0] for indices [.kibana_1]
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.tasks] creating index, cause [auto(task api)], templates [], shards [1]/[1], mappings [_doc]
[00:00:02]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] updating number_of_replicas to [0] for indices [.tasks]
[00:00:03]                 │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] 1172 finished with response BulkByScrollResponse[took=62.2ms,timed_out=false,sliceId=null,updated=0,created=3,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:00:03]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana/YpiZZeH6RWOwDQuAFGlo7g] deleting index
[00:00:03]                 │ proc [kibana]   log   [20:59:55.537] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:00:03]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2/HqRzs1U-QMm-gjKDkBY2fA] update_mapping [_doc]
[00:00:03]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2/HqRzs1U-QMm-gjKDkBY2fA] update_mapping [_doc]
[00:00:03]                 │ proc [kibana]   log   [20:59:55.709] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:00:03]                 │ proc [kibana]   log   [20:59:55.815] [info][savedobjects-service] Finished in 920ms.
[00:00:03]                 │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:00:03]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2/HqRzs1U-QMm-gjKDkBY2fA] update_mapping [_doc]
[00:00:04]                 │ debg creating role global_all_role
[00:00:04]                 │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [global_all_role]
[00:00:04]                 │ debg SecurityPage.forceLogout
[00:00:04]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=100
[00:00:04]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:05]                 │ debg Redirecting to /logout to force the logout
[00:00:05]                 │ debg Waiting on the login form to appear
[00:00:05]                 │ debg Waiting up to 100000ms for login form...
[00:00:05]                 │ debg browser[INFO] http://localhost:6131/logout?_t=1586293197839 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:05]                 │
[00:00:05]                 │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:05]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:00:08]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:09]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:00:13]                 │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T21:00:05Z
[00:00:13]                 │        Adding connection to http://localhost:6131/elasticsearch
[00:00:13]                 │
[00:00:13]                 │      "
[00:00:13]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:14]                 │ debg browser[INFO] http://localhost:6131/login?next=%2F 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:14]                 │
[00:00:14]                 │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:15]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:00:18]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:18]                 │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T21:00:11Z
[00:00:18]                 │        Adding connection to http://localhost:6131/elasticsearch
[00:00:18]                 │
[00:00:18]                 │      "
[00:00:19]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:01:06]               └-: machine_learning_user and global all
[00:01:06]                 └-> "before all" hook
[00:01:06]                 └-> "before all" hook
[00:01:06]                   │ debg creating user machine_learning_user
[00:01:06]                   │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [machine_learning_user]
[00:01:06]                   │ debg created user machine_learning_user
[00:01:06]                   │ debg navigating to login url: http://localhost:6131/login
[00:01:06]                   │ debg Navigate to: http://localhost:6131/login
[00:01:06]                   │ proc [kibana]   log   [21:00:58.881] [info][authentication][plugins][security] Authentication attempt failed: [security_exception] unable to authenticate user [global_all] for REST request [/_security/_authenticate], with { header={ WWW-Authenticate={ 0="ApiKey" & 1="Basic realm=\"security\" charset=\"UTF-8\"" } } }
[00:01:06]                   │ debg ... sleep(700) start
[00:01:06]                   │ERROR browser[SEVERE] http://localhost:6131/login?_t=1586293258871 - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:01:07]                   │ debg ... sleep(700) end
[00:01:07]                   │ debg returned from get, calling refresh
[00:01:07]                   │ debg browser[INFO] http://localhost:6131/login?_t=1586293258871 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:01:07]                   │
[00:01:07]                   │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:07]                   │ debg currentUrl = http://localhost:6131/login
[00:01:07]                   │          appUrl = http://localhost:6131/login
[00:01:07]                   │ debg TestSubjects.find(kibanaChrome)
[00:01:07]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:01:11]                   │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T21:01:04Z
[00:01:11]                   │        Adding connection to http://localhost:6131/elasticsearch
[00:01:11]                   │
[00:01:11]                   │      "
[00:01:11]                   │ debg ... sleep(501) start
[00:01:12]                   │ debg ... sleep(501) end
[00:01:12]                   │ debg in navigateTo url = http://localhost:6131/login
[00:01:12]                   │ debg TestSubjects.exists(statusPageContainer)
[00:01:12]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:01:14]                   │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:01:15]                   │ debg TestSubjects.setValue(loginUsername, machine_learning_user)
[00:01:15]                   │ debg TestSubjects.click(loginUsername)
[00:01:15]                   │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:01:15]                   │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:01:15]                   │ debg TestSubjects.setValue(loginPassword, machine_learning_user-password)
[00:01:15]                   │ debg TestSubjects.click(loginPassword)
[00:01:15]                   │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:01:15]                   │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:01:16]                   │ debg TestSubjects.click(loginSubmit)
[00:01:16]                   │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:01:16]                   │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:01:16]                   │ debg Waiting up to 20000ms for logout button visible...
[00:01:16]                   │ debg TestSubjects.exists(userMenuButton)
[00:01:16]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenuButton"]') with timeout=2500
[00:01:18]                   │ debg browser[INFO] http://localhost:6131/app/kibana 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:01:18]                   │
[00:01:18]                   │ debg browser[INFO] http://localhost:6131/bundles/app/kibana/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:18]                   │ debg --- retry.tryForTime error: [data-test-subj="userMenuButton"] is not displayed
[00:01:19]                   │ debg TestSubjects.exists(userMenuButton)
[00:01:19]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenuButton"]') with timeout=2500
[00:01:21]                   │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T21:01:12Z
[00:01:21]                   │        Adding connection to http://localhost:6131/elasticsearch
[00:01:21]                   │
[00:01:21]                   │      "
[00:01:21]                   │ debg TestSubjects.exists(userMenu)
[00:01:21]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=2500
[00:01:23]                   │ debg --- retry.tryForTime error: [data-test-subj="userMenu"] is not displayed
[00:01:24]                   │ debg TestSubjects.click(userMenuButton)
[00:01:24]                   │ debg Find.clickByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:01:24]                   │ debg Find.findByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:01:24]                   │ debg Waiting up to 20000ms for user menu opened...
[00:01:24]                   │ debg TestSubjects.exists(userMenu)
[00:01:24]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=2500
[00:01:24]                   │ debg TestSubjects.exists(userMenu > logoutLink)
[00:01:24]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"] [data-test-subj="logoutLink"]') with timeout=2500
[00:01:24]                 └-> shows ML navlink
[00:01:24]                   └-> "before each" hook: global before each
[00:01:24]                   │ debg TestSubjects.find(navDrawer)
[00:01:24]                   │ debg Find.findByCssSelector('[data-test-subj="navDrawer"]') with timeout=10000
[00:01:24]                   │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/machine learning feature controls security machine_learning_user and global all shows ML navlink.png"
[00:01:24]                   │ info Current URL is: http://localhost:6131/app/kibana#/home
[00:01:24]                   │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/machine learning feature controls security machine_learning_user and global all shows ML navlink.html
[00:01:24]                   └- ✖ fail: "machine learning feature controls security machine_learning_user and global all shows ML navlink"
[00:01:24]                   │

Stack Trace

Error: expected [ 'Discover',
  'Visualize',
  'Dashboard',
  'Timelion',
  'Canvas',
  'Maps',
  'Metrics',
  'Logs',
  'APM',
  'Uptime',
  'Graph',
  'SIEM',
  'Dev Tools',
  'Management',
  'Endpoint' ] to contain 'Machine Learning'
    at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.contain (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:447:10)
    at Context.it (test/functional/apps/machine_learning/feature_controls/ml_security.ts:105:29)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / kibana-xpack-agent / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/machine_learning/feature_controls/ml_security·ts.machine learning feature controls security machine_learning_user and global all shows ML navlink

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]       │
[00:00:00]         └-: machine learning
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ debg creating role ml_source
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_source]
[00:00:00]             │ debg creating role ml_dest
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_dest]
[00:00:00]             │ debg creating role ml_dest_readonly
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_dest_readonly]
[00:00:00]             │ debg creating role ml_ui_extras
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [ml_ui_extras]
[00:00:00]             │ debg creating user ml_poweruser
[00:00:00]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [ml_poweruser]
[00:00:00]             │ debg created user ml_poweruser
[00:00:00]             │ debg creating user ml_viewer
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [ml_viewer]
[00:00:01]             │ debg created user ml_viewer
[00:00:01]             │ debg creating user ml_unauthorized
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [ml_unauthorized]
[00:00:01]             │ debg created user ml_unauthorized
[00:00:01]           └-: feature controls
[00:00:01]             └-> "before all" hook
[00:00:01]             └-: security
[00:00:01]               └-> "before all" hook
[00:00:01]               └-> "before all" hook
[00:00:01]                 │ info [empty_kibana] Loading "mappings.json"
[00:00:01]                 │ info [empty_kibana] Loading "data.json.gz"
[00:00:01]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_1/H9l3aCe7SiK2_2GRF02yRg] deleting index
[00:00:01]                 │ info [empty_kibana] Deleted existing index [".kibana_1"]
[00:00:01]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:01]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:01]                 │ info [empty_kibana] Created index ".kibana"
[00:00:01]                 │ debg [empty_kibana] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:00:01]                 │ info [empty_kibana] Indexed 2 docs into ".kibana"
[00:00:01]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana/gYtDMuz-RzSMlvlP-SSMzA] update_mapping [_doc]
[00:00:01]                 │ debg Migrating saved objects
[00:00:01]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana/gYtDMuz-RzSMlvlP-SSMzA] update_mapping [_doc]
[00:00:02]                 │ proc [kibana]   log   [20:55:11.927] [info][savedobjects-service] Creating index .kibana_2.
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:02]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] updating number_of_replicas to [0] for indices [.kibana_2]
[00:00:02]                 │ proc [kibana]   log   [20:55:12.088] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:02]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1], mappings [_doc]
[00:00:02]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] updating number_of_replicas to [0] for indices [.kibana_1]
[00:00:03]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] applying create index request using v1 templates []
[00:00:03]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.tasks] creating index, cause [auto(task api)], templates [], shards [1]/[1], mappings [_doc]
[00:00:03]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] updating number_of_replicas to [0] for indices [.tasks]
[00:00:03]                 │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] 1193 finished with response BulkByScrollResponse[took=66.7ms,timed_out=false,sliceId=null,updated=0,created=3,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:00:03]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana/gYtDMuz-RzSMlvlP-SSMzA] deleting index
[00:00:03]                 │ proc [kibana]   log   [20:55:12.676] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:00:03]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2/Kk5uCg_eTgmGhx3yTKoksA] update_mapping [_doc]
[00:00:03]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2/Kk5uCg_eTgmGhx3yTKoksA] update_mapping [_doc]
[00:00:03]                 │ proc [kibana]   log   [20:55:12.878] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:00:03]                 │ proc [kibana]   log   [20:55:13.001] [info][savedobjects-service] Finished in 1078ms.
[00:00:03]                 │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:00:03]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] [.kibana_2/Kk5uCg_eTgmGhx3yTKoksA] update_mapping [_doc]
[00:00:04]                 │ debg creating role global_all_role
[00:00:05]                 │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added role [global_all_role]
[00:00:05]                 │ debg SecurityPage.forceLogout
[00:00:05]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=100
[00:00:05]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:05]                 │ debg Redirecting to /logout to force the logout
[00:00:05]                 │ debg Waiting on the login form to appear
[00:00:05]                 │ debg Waiting up to 100000ms for login form...
[00:00:05]                 │ debg browser[INFO] http://localhost:6131/logout?_t=1586292914888 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:05]                 │
[00:00:05]                 │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:05]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:00:08]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:09]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:00:13]                 │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T20:55:22Z
[00:00:13]                 │        Adding connection to http://localhost:6131/elasticsearch
[00:00:13]                 │
[00:00:13]                 │      "
[00:00:13]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:13]                 │ debg browser[INFO] http://localhost:6131/login?next=%2F 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:13]                 │
[00:00:13]                 │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:14]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:00:18]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:00:18]                 │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T20:55:27Z
[00:00:18]                 │        Adding connection to http://localhost:6131/elasticsearch
[00:00:18]                 │
[00:00:18]                 │      "
[00:00:19]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:01:10]               └-: machine_learning_user and global all
[00:01:10]                 └-> "before all" hook
[00:01:10]                 └-> "before all" hook
[00:01:10]                   │ debg creating user machine_learning_user
[00:01:10]                   │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1586290525783075507] added user [machine_learning_user]
[00:01:10]                   │ debg created user machine_learning_user
[00:01:10]                   │ debg navigating to login url: http://localhost:6131/login
[00:01:10]                   │ debg Navigate to: http://localhost:6131/login
[00:01:10]                   │ proc [kibana]   log   [20:56:19.664] [info][authentication][plugins][security] Authentication attempt failed: [security_exception] unable to authenticate user [global_all] for REST request [/_security/_authenticate], with { header={ WWW-Authenticate={ 0="ApiKey" & 1="Basic realm=\"security\" charset=\"UTF-8\"" } } }
[00:01:10]                   │ debg ... sleep(700) start
[00:01:10]                   │ERROR browser[SEVERE] http://localhost:6131/login?_t=1586292979654 - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:01:11]                   │ debg ... sleep(700) end
[00:01:11]                   │ debg returned from get, calling refresh
[00:01:11]                   │ debg browser[INFO] http://localhost:6131/login?_t=1586292979654 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:01:11]                   │
[00:01:11]                   │ debg browser[INFO] http://localhost:6131/bundles/app/core/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:11]                   │ debg currentUrl = http://localhost:6131/login
[00:01:11]                   │          appUrl = http://localhost:6131/login
[00:01:11]                   │ debg TestSubjects.find(kibanaChrome)
[00:01:11]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:01:17]                   │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T20:56:26Z
[00:01:17]                   │        Adding connection to http://localhost:6131/elasticsearch
[00:01:17]                   │
[00:01:17]                   │      "
[00:01:17]                   │ debg ... sleep(501) start
[00:01:17]                   │ debg ... sleep(501) end
[00:01:17]                   │ debg in navigateTo url = http://localhost:6131/login
[00:01:17]                   │ debg TestSubjects.exists(statusPageContainer)
[00:01:17]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:01:20]                   │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:01:20]                   │ debg TestSubjects.setValue(loginUsername, machine_learning_user)
[00:01:20]                   │ debg TestSubjects.click(loginUsername)
[00:01:20]                   │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:01:20]                   │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:01:21]                   │ debg TestSubjects.setValue(loginPassword, machine_learning_user-password)
[00:01:21]                   │ debg TestSubjects.click(loginPassword)
[00:01:21]                   │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:01:21]                   │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:01:21]                   │ debg TestSubjects.click(loginSubmit)
[00:01:21]                   │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:01:21]                   │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:01:21]                   │ debg Waiting up to 20000ms for logout button visible...
[00:01:21]                   │ debg TestSubjects.exists(userMenuButton)
[00:01:21]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenuButton"]') with timeout=2500
[00:01:24]                   │ debg browser[INFO] http://localhost:6131/app/kibana 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:01:24]                   │
[00:01:24]                   │ debg browser[INFO] http://localhost:6131/bundles/app/kibana/bootstrap.js 9:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:01:24]                   │ debg --- retry.tryForTime error: [data-test-subj="userMenuButton"] is not displayed
[00:01:25]                   │ debg TestSubjects.exists(userMenuButton)
[00:01:25]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenuButton"]') with timeout=2500
[00:01:28]                   │ debg browser[INFO] http://localhost:6131/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js 380:106115 "INFO: 2020-04-07T20:56:36Z
[00:01:28]                   │        Adding connection to http://localhost:6131/elasticsearch
[00:01:28]                   │
[00:01:28]                   │      "
[00:01:28]                   │ debg --- retry.tryForTime error: [data-test-subj="userMenuButton"] is not displayed
[00:01:29]                   │ debg TestSubjects.exists(userMenuButton)
[00:01:29]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenuButton"]') with timeout=2500
[00:01:29]                   │ debg TestSubjects.exists(userMenu)
[00:01:29]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=2500
[00:01:31]                   │ debg --- retry.tryForTime error: [data-test-subj="userMenu"] is not displayed
[00:01:32]                   │ debg TestSubjects.click(userMenuButton)
[00:01:32]                   │ debg Find.clickByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:01:32]                   │ debg Find.findByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:01:32]                   │ debg Waiting up to 20000ms for user menu opened...
[00:01:32]                   │ debg TestSubjects.exists(userMenu)
[00:01:32]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=2500
[00:01:32]                   │ debg TestSubjects.exists(userMenu > logoutLink)
[00:01:32]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"] [data-test-subj="logoutLink"]') with timeout=2500
[00:01:32]                 └-> shows ML navlink
[00:01:32]                   └-> "before each" hook: global before each
[00:01:32]                   │ debg TestSubjects.find(navDrawer)
[00:01:32]                   │ debg Find.findByCssSelector('[data-test-subj="navDrawer"]') with timeout=10000
[00:01:32]                   │ info Taking screenshot "/dev/shm/workspace/kibana/x-pack/test/functional/screenshots/failure/machine learning feature controls security machine_learning_user and global all shows ML navlink.png"
[00:01:32]                   │ info Current URL is: http://localhost:6131/app/kibana#/home
[00:01:32]                   │ info Saving page source to: /dev/shm/workspace/kibana/x-pack/test/functional/failure_debug/html/machine learning feature controls security machine_learning_user and global all shows ML navlink.html
[00:01:32]                   └- ✖ fail: "machine learning feature controls security machine_learning_user and global all shows ML navlink"
[00:01:32]                   │

Stack Trace

Error: expected [ 'Discover',
  'Visualize',
  'Dashboard',
  'Timelion',
  'Canvas',
  'Maps',
  'Metrics',
  'Logs',
  'APM',
  'Uptime',
  'Graph',
  'SIEM',
  'Dev Tools',
  'Management',
  'Endpoint' ] to contain 'Machine Learning'
    at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.contain (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:447:10)
    at Context.it (test/functional/apps/machine_learning/feature_controls/ml_security.ts:105:29)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / kibana-xpack-agent / X-Pack API Integration Tests.x-pack/test/api_integration/apis/management/index_lifecycle_management/policies·js.apis management index lifecycle management policies list should have a default policy to manage the Watcher history indices

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 3 times on tracked branches: https://github.com/elastic/kibana/issues/41237

[00:00:00]       │
[00:00:00]         └-: apis
[00:00:00]           └-> "before all" hook
[00:05:54]           └-: management
[00:05:54]             └-> "before all" hook
[00:06:25]             └-: index lifecycle management
[00:06:25]               └-> "before all" hook
[00:06:25]               └-: policies
[00:06:25]                 └-> "before all" hook
[00:06:25]                 └-: list
[00:06:25]                   └-> "before all" hook
[00:06:25]                   └-> should have a default policy to manage the Watcher history indices
[00:06:25]                     └-> "before each" hook: global before each
[00:06:25]                     └- ✖ fail: "apis management index lifecycle management policies list should have a default policy to manage the Watcher history indices"
[00:06:25]                     │

Stack Trace

{ Error: expected { version: 1,
  modified_date: '2019-04-30T14:30:00.000Z',
  policy: { phases: { delete: [Object] } },
  name: 'watch-history-ilm-policy' } to sort of equal { version: 1,
  modified_date: '2019-04-30T14:30:00.000Z',
  policy: { phases: { delete: [Object] } },
  name: 'watch-history-ilm-policy' }
    at Assertion.assert (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/kibana/packages/kbn-expect/expect.js:244:8)
    at Context.it (test/api_integration/apis/management/index_lifecycle_management/policies.js:43:27)
  actual:
   '{\n  "modified_date": "2019-04-30T14:30:00.000Z"\n  "name": "watch-history-ilm-policy"\n  "policy": {\n    "phases": {\n      "delete": {\n        "actions": {\n          "delete": {\n            "delete_searchable_snapshot": true\n          }\n        }\n        "min_age": "7d"\n      }\n    }\n  }\n  "version": 1\n}',
  expected:
   '{\n  "modified_date": "2019-04-30T14:30:00.000Z"\n  "name": "watch-history-ilm-policy"\n  "policy": {\n    "phases": {\n      "delete": {\n        "actions": {\n          "delete": {}\n        }\n        "min_age": "7d"\n      }\n    }\n  }\n  "version": 1\n}',
  showDiff: true }

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants