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

Use HTTP request schemas to create types, use those types in the client #59340

Merged
merged 15 commits into from
Mar 9, 2020

Conversation

oatkiller
Copy link
Contributor

@oatkiller oatkiller commented Mar 4, 2020

Summary

Use a type derived from @kbn/config-schema on the client when creating requests.

Backstory

When creating an HTTP route, we use @kbn/config-schema to create 'schema' objects. These schemas are used to validate and coerce the inputs to the HTTP handler (e.g. HTTP query strings, POST bodies.) The client will make HTTP requests to these handlers. If the HTTP requests made by the client fail the validation, an HTTP error will be triggered. In that case an error will likely be shown to the user.

In the HTTP handler code the validated (and coerced) inputs are cast to a type based on the schema. This is called the TypeOf<schema> type. This allows the HTTP handlers to have type safety.

If the schema changes, the HTTP handler will get a new type, and the developer will be informed (by typecheck) that the HTTP handler code must change.

Ideas

This PR is a POC. It defines a pattern for extending the type safety to the client. The idea is this:

  1. Centralize the schemas into a common area, accessible by public and server code
  2. Still use the schemas in the server, including the TypeOf<schema> type, as before
  3. When creating the HTTP request in the client, use KbnConfigSchemaInputTypeOf<schema> type. This type represents the valid inputs to the request.

With this pattern, if the schema changes, the developer will also be notified that the code creating the request needs to be changed.

Gotchas and stuff

The TypeOf type already exists and represents the validated and coerced type of the input. Why can't we use that in the client?

The inputs are more permissive than the validated types due to coercion. For example, the schema schema.number() accepts strings, and will automatically convert these to numbers.

Another reason: the TypeOf type has limited handling of the schema.maybe schema when used with schema.object

const s = schema.object({
  a: schema.maybe(schema.number()),
  b: schema.number()
})
// This should be fine, as 'a' is 'maybe', but `TypeOf` doesn't treat the key as optional.
const input: TypeOf<s> = { 
  b: 1
}
// This is what you'd have to do
const input2: TypeOf<s> = { 
  b: 1,
  a: undefined,
}

Checklist

Delete any items that are not applicable to this PR.

(https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)

For maintainers

@oatkiller oatkiller requested a review from a team as a code owner March 4, 2020 17:42
@@ -5,6 +5,11 @@
*/

import { SearchResponse } from 'elasticsearch';
import { schema, TypeOf } from '@kbn/config-schema';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not about your code changes but should we break up the types.ts file into smaller files specific to an API like:
A file for alerts, resolver, metadata and then have an index.ts file that puts them altogether so this types.ts file doesn't get too large?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree. i figure if this PR is well accepted we can do that before merging

@jonathan-buttner
Copy link
Contributor

Also I think there is an outstanding issue with using @kbn-config/schema in the browser: #57726

@jonathan-buttner
Copy link
Contributor

I believe @jfsiii ran into this too and as a temporary measure had to define TS types (the type XType = TypeOf) to use in the frontend.

@joshdover
Copy link
Contributor

Yes I don't believe this is going to work correctly until either #57726 is fixed or we upgrade to TypeScript 3.8 (#57774) and can start using type-only imports.

I believe the underlying problem is that when we import @kbn/config-schema into a client bundle, it drags with it a bunch of server code that doesn't work in the browser. I don't know of a way around this without one of these two fixes.

@oatkiller
Copy link
Contributor Author

@jonathan-buttner @joshdover thanks for the info. I wasn't aware of those issues. I'm also not experiencing any problems with this PR.

Thinking through this: maybe this PR works because the client only imports types and any other @kbn/config-schema stuff is shaken off?

Also, to clarify, this code does not use @kbn/config-schema in the client, just the types derived from it.

@@ -205,7 +205,12 @@ export interface HttpRequestInit {

/** @public */
export interface HttpFetchQuery {
[key: string]: string | number | boolean | undefined;
[key: string]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The underlying code supports this already. This change loosens up the type

@jonathan-buttner
Copy link
Contributor

@jonathan-buttner @joshdover thanks for the info. I wasn't aware of those issues. I'm also not experiencing any problems with this PR.

Thinking through this: maybe this PR works because the client only imports types and any other @kbn/config-schema stuff is shaken off?

Also, to clarify, this code does not use @kbn/config-schema in the client, just the types derived from it.

Ah ok, I missed that, that might work then since it's just doing the types and not the @kbn/config-schema itself. I think the issue I saw when testing some code that had the schema imported in the frontend was a reference to a net package was missing. The bootup of kibana wouldn't fail though, it would just print out in the kibana logs and when you browsed to the app page it would fail I think.

@joshdover
Copy link
Contributor

@jonathan-buttner @joshdover thanks for the info. I wasn't aware of those issues. I'm also not experiencing any problems with this PR.

Thinking through this: maybe this PR works because the client only imports types and any other @kbn/config-schema stuff is shaken off?

Also, to clarify, this code does not use @kbn/config-schema in the client, just the types derived from it.

Hmm I'm skeptical, because from my understanding this is not how things currently work. If you're importing a module, even just to get the types, that module's dependencies must also be imported & bundled. This is why the type-only imports and exports feature was added to TypeScript.

If this is working, I would like to understand why.

@@ -610,7 +610,7 @@ export interface HttpFetchOptionsWithPath extends HttpFetchOptions {
// @public (undocumented)
export interface HttpFetchQuery {
// (undocumented)
[key: string]: string | number | boolean | undefined;
[key: string]: string | number | boolean | undefined | Array<string | number | boolean | undefined>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

generated docs

/**
* Used to validate GET requests against the index of the alerting APIs.
*/
export const alertingIndexGetQuerySchema = schema.object(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we go w/ this design, the schemas would be centralized in common somewhere. I think

),
sort: schema.maybe(schema.string()),
order: schema.maybe(
schema.string({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated to this PR, but I think we could use a oneOf type thing here?

type KbnConfigSchemaInputObjectTypeOf<
T extends kbnConfigSchemaTypes.ObjectType
> = T extends kbnConfigSchemaTypes.ObjectType<infer P>
? {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This maps the properties of a schema object. It does it twice, once for values that accept 'undefined', and once for keys that do not. If a value accepts undefined, they key is marked optional (?)
TODO add above in comment in code


export const alertMiddlewareFactory: MiddlewareFactory<AlertListState> = coreStart => {
return api => next => async (action: AppAction) => {
next(action);
const state = api.getState();
if (action.type === 'userChangedUrl' && isOnAlertPage(state)) {
const response: AlertResultList = await coreStart.http.get(`/api/endpoint/alerts`, {
query: apiQueryParams(state),
query: cloneHttpFetchQuery(apiQueryParams(state)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The http.get function won't accept our Immutable type. I'm not sure if this is the best approach long term.
Basically, we require that the return value of apiQueryParams not be modified, and .get isn't promising that it won't modify them. Therefore we clone it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems okay to me.


import { HttpFetchQuery } from '../../../../../src/core/public';

export function cloneHttpFetchQuery(query: Immutable<HttpFetchQuery>): HttpFetchQuery {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

simply clone a query object.

@oatkiller
Copy link
Contributor Author

@jonathan-buttner @joshdover thanks for the info. I wasn't aware of those issues. I'm also not experiencing any problems with this PR.
Thinking through this: maybe this PR works because the client only imports types and any other @kbn/config-schema stuff is shaken off?
Also, to clarify, this code does not use @kbn/config-schema in the client, just the types derived from it.

Hmm I'm skeptical, because from my understanding this is not how things currently work. If you're importing a module, even just to get the types, that module's dependencies must also be imported & bundled. This is why the type-only imports and exports feature was added to TypeScript.

If this is working, I would like to understand why.

@joshdover I don't really know. If i had to guess I'd just say 'tree-shaking?'. But I can dig into it more.

@joshdover
Copy link
Contributor

Tree-shaking seems to be the answer. I ran webpack with the stats.json output to use with webpack-bundle-analyzer. What I found is that if you import only types from a module, then the module does not end up in the bundle.

As soon as a value is imported, the entire module and it's dependencies will also be imported into the bundle, causing a break. So it appears this will work as long as the module does not contain any values that also need to be imported.

Either way, CI / optimizer will let you know when this happens if one of the dependencies needed is not supported in the browser (like the net module that Joi depends on).

@jfsiii
Copy link
Contributor

jfsiii commented Mar 4, 2020

@oatkiller @joshdover #59340 (comment) matches my experience as well. Ingest Manager was able to use the TypeOf<typeof SomeKBNConfigSchema>> approach in common/types/ for a few weeks until our client side bundle mysteriously failed with that net error. Our guess was that it was when we added enums which result in a JS object unlike type, interface, etch which are compiled away.

We put the @kbn/config-schema items under server/types/ and are following #57726 & #57774

@oatkiller
Copy link
Contributor Author

@oatkiller @joshdover #59340 (comment) matches my experience as well. Ingest Manager was able to use the TypeOf<typeof SomeKBNConfigSchema>> approach in common/types/ for a few weeks until our client side bundle mysteriously failed with that net error. Our guess was that it was when we added enums which result in a JS object unlike type, interface, etch which are compiled away.

We put the @kbn/config-schema items under server/types/ and are following #57726 & #57774

Thanks for the info. I'm thinking of going w/ the approach I have here in light of the fact that config-schema will likely eventually work in the client. Thanks again

> = T extends kbnConfigSchemaTypes.ObjectType
? KbnConfigSchemaInputObjectTypeOf<
T
> /** The schema.number() schema accepts strings, so accept them here to. There's no good way to make this happen ONLY when schema.number is called? i dont think it matters? */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

improve comment verbiage

Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: to should be too.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thiiiiink this won't matter if strings are accepted everywhere. That's probably due to the fact that URL query params (which are always strings) are accepted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

asc = 'asc',
desc = 'desc',
}
export type Direction = 'asc' | 'desc';
Copy link
Contributor

Choose a reason for hiding this comment

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

@oatkiller Is type better than enum? TypeScript n00b here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Other plugins have used enum for this... for example, siem. So just curious what the advantages/disadvantages are.

Copy link
Contributor Author

@oatkiller oatkiller Mar 5, 2020

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so i tried to go back and make everything the enum, but it turns out we have a whole lot of places in the app writing 'asc' and 'desc' as literals. I don't honestly know what the best practice is, but for the sake of keeping the (runtime) enum out of the validation that will be used on FE and BE, I'm going to keep this as a type for now. I'm aware that this may not be right, I just don't have quite enough experience w/ this yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, that's fine. I imagine that could be difficult to work into the schema validation. Let's come back to it later.

/**
* Like TypeOf, but provides a type for creating the value that will match.
* schema.number accepts a string, so this allows strings for number
* schema.maybe creates an optional type, if such a type is a prop on an schema.object,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it technically accurate to say "optional type" here? I see that it's clarified on the line below, but this comment seems a little ambiguous.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reworded. Hopefully more clear?

/**
 * Takes a @kbn/config-schema 'schema' type and returns a type that represents valid inputs.
 * Similar to `TypeOf`, but allows strings as input for `schema.number()` (which is inline
 * with the behavior of the validator.) Also, for `schema.object`, when a value is a `schema.maybe`
 * the key will be marked optional (via `?`) so that you can omit keys for optional values.
 *
 * Use this when creating a value that will be passed to the schema.
 * e.g.
 * ```ts
 * const input: KbnConfigSchemaInputTypeOf<typeof schema> = value
 * schema.validate(input) // should be valid
 * ```
 */

/**
* Query params to pass to the alert API when fetching new data.
*/
export type AlertingIndexGetQueryInput = KbnConfigSchemaInputTypeOf<
Copy link
Contributor

Choose a reason for hiding this comment

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

👏 👏 👏

@@ -39,11 +34,11 @@ export class AlertDetailsPagination extends Pagination<
): Promise<SearchResponse<AlertEvent>> {
const reqData: AlertSearchQuery = {
pageSize: 1,
sort: EndpointAppConstants.ALERT_LIST_DEFAULT_SORT,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why dis?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can restore it. the value in the constants class was not typed right so i just used the literal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

restored it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

restored it

@oatkiller oatkiller added Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0 labels Mar 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/endpoint-app-team (Feature:Endpoint)

Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

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

Platform changes LGTM

@oatkiller
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine elasticmachine requested a review from a team as a code owner March 9, 2020 15:30
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / kibana-xpack-agent / X-Pack Saved Object API Integration Tests -- security_only.x-pack/test/saved_object_api_integration/security_only/apis/bulk_update·ts.saved objects security only enabled bulkUpdate dual-privileges user "before all" hook for "should return 403 for hiddentype doc"

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: saved objects security only enabled
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_legacy_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_dual_privileges_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_dual_privileges_dashboard_only_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_dashboard_only_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_default_space_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_default_space_read_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_space_1_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_space_1_read_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [not_a_kibana_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_legacy_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_dual_privileges_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_dual_privileges_dashboard_only_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_dashboard_only_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_default_space_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_default_space_read_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_space_1_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_space_1_read_user]
[00:05:09]               │ERROR [migrate saved objects] request failed (attempt=5/5)
[00:05:09]               └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "before all" hook for "should return 403 for hiddentype doc""
[00:05:09]               │
[00:04:49]           └-: bulkUpdate
[00:04:49]             └-> "before all" hook
[00:05:09]                 └-> "after all" hook
[00:04:59]             └-: dual-privileges user
[00:04:59]               └-> "before all" hook
[00:04:59]               └-> "before all" hook
[00:04:59]                 │ info [saved_objects/spaces] Loading "mappings.json"
[00:04:59]                 │ info [saved_objects/spaces] Loading "data.json"
[00:04:59]                 │ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] [.kibana] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:04:59]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana][0]]]).
[00:04:59]                 │ info [r.suppressed] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] path: /.kibana/_doc/telemetry%3Atelemetry, params: {index=.kibana, id=telemetry:telemetry}
[00:04:59]                 │      org.elasticsearch.action.NoShardAvailableActionException: No shard available for [get [.kibana][telemetry:telemetry]: routing [null]]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:224) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.onFailure(TransportSingleShardAction.java:210) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$2.handleException(TransportSingleShardAction.java:266) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1067) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1176) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1150) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:60) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:56) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:88) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.onFailure(ThreadContext.java:676) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
[00:04:59]                 │      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
[00:04:59]                 │      	at java.lang.Thread.run(Thread.java:830) [?:?]
[00:04:59]                 │      Caused by: org.elasticsearch.transport.RemoteTransportException: [kibana-ci-immutable-debian-tests-xl-1583767884413211985][127.0.0.1:6193][indices:data/read/get[s]]
[00:04:59]                 │      Caused by: org.elasticsearch.index.shard.IllegalIndexShardStateException: CurrentState[RECOVERING] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]
[00:04:59]                 │      	at org.elasticsearch.index.shard.IndexShard.readAllowed(IndexShard.java:1685) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.shard.IndexShard.get(IndexShard.java:905) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.innerGet(ShardGetService.java:174) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:104) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:95) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:106) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:45) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.lambda$asyncShardOperation$0(TransportSingleShardAction.java:110) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:58) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:688) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	... 3 more
[00:04:59]                 │ info [saved_objects/spaces] Created index ".kibana"
[00:04:59]                 │ debg [saved_objects/spaces] ".kibana" settings {"index":{"auto_expand_replicas":"0-1","number_of_replicas":"0","number_of_shards":"1"}}
[00:04:59]                 │ proc [kibana] internal/process/warning.js:153
[00:04:59]                 │ proc [kibana]         throw warning;
[00:04:59]                 │ proc [kibana]         ^
[00:04:59]                 │ proc [kibana] 
[00:04:59]                 │ proc [kibana] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[00:04:59]                 │ proc [kibana]     at emitDeprecationWarning (internal/process/promises.js:111:13)
[00:04:59]                 │ proc [kibana]     at emitWarning (internal/process/promises.js:104:3)
[00:04:59]                 │ proc [kibana]     at emitPromiseRejectionWarnings (internal/process/promises.js:143:7)
[00:04:59]                 │ proc [kibana]     at process._tickCallback (internal/process/next_tick.js:69:34)
[00:04:59]                 │ info [saved_objects/spaces] Indexed 16 docs into ".kibana"
[00:04:59]                 │ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] [.kibana/J16fJrWzT7GVlK5jLKScwQ] update_mapping [_doc]
[00:04:59]                 └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "before all" hook"
[00:04:59]                 │
[00:04:59]                 └-> "after all" hook
[00:04:59]                   │ debg Migrating saved objects
[00:04:59]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=1/5)
[00:04:59]                   │ERROR [migrate saved objects] request failed (attempt=1/5)
[00:05:00]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=2/5)
[00:05:00]                   │ERROR [migrate saved objects] request failed (attempt=2/5)
[00:05:02]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=3/5)
[00:05:02]                   │ERROR [migrate saved objects] request failed (attempt=3/5)
[00:05:05]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=4/5)
[00:05:05]                   │ERROR [migrate saved objects] request failed (attempt=4/5)
[00:05:09]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=5/5)
[00:05:09]                   └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "after all" hook for "should return 403 for hiddentype doc""
[00:05:09]                   │

Stack Trace

{ DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    at emitDeprecationWarning (internal/process/promises.js:111:13)
    at emitWarning (internal/process/promises.js:104:3)
    at emitPromiseRejectionWarnings (internal/process/promises.js:143:7)
    at process._tickCallback (internal/process/next_tick.js:69:34)
  name: 'DeprecationWarning',
  code: 'DEP0018',
  uncaught: true,
  multiple:
   [ Error: [migrate saved objects] request failed (attempt=5/5) -- and ran out of retries
         at KbnClientRequester.request (/dev/shm/workspace/kibana/packages/kbn-dev-utils/target/kbn_client/kbn_client_requester.js:99:23)
         at process._tickCallback (internal/process/next_tick.js:68:7) ] }

Kibana Pipeline / kibana-xpack-agent / X-Pack Saved Object API Integration Tests -- security_only.x-pack/test/saved_object_api_integration/security_only/apis/bulk_update·ts.saved objects security only enabled bulkUpdate dual-privileges user "after all" hook for "should return 403 for hiddentype doc"

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: saved objects security only enabled
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_legacy_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_dual_privileges_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_dual_privileges_dashboard_only_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_dashboard_only_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_default_space_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_default_space_read_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_space_1_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_space_1_read_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [not_a_kibana_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_legacy_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_dual_privileges_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_dual_privileges_dashboard_only_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_dashboard_only_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_default_space_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_default_space_read_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_space_1_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_space_1_read_user]
[00:04:49]           └-: bulkUpdate
[00:04:49]             └-> "before all" hook
[00:04:59]             └-: dual-privileges user
[00:04:59]               └-> "before all" hook
[00:04:59]               └-> "before all" hook
[00:04:59]                 │ info [saved_objects/spaces] Loading "mappings.json"
[00:04:59]                 │ info [saved_objects/spaces] Loading "data.json"
[00:04:59]                 │ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] [.kibana] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:04:59]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana][0]]]).
[00:04:59]                 │ info [r.suppressed] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] path: /.kibana/_doc/telemetry%3Atelemetry, params: {index=.kibana, id=telemetry:telemetry}
[00:04:59]                 │      org.elasticsearch.action.NoShardAvailableActionException: No shard available for [get [.kibana][telemetry:telemetry]: routing [null]]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:224) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.onFailure(TransportSingleShardAction.java:210) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$2.handleException(TransportSingleShardAction.java:266) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1067) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1176) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1150) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:60) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:56) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:88) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.onFailure(ThreadContext.java:676) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
[00:04:59]                 │      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
[00:04:59]                 │      	at java.lang.Thread.run(Thread.java:830) [?:?]
[00:04:59]                 │      Caused by: org.elasticsearch.transport.RemoteTransportException: [kibana-ci-immutable-debian-tests-xl-1583767884413211985][127.0.0.1:6193][indices:data/read/get[s]]
[00:04:59]                 │      Caused by: org.elasticsearch.index.shard.IllegalIndexShardStateException: CurrentState[RECOVERING] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]
[00:04:59]                 │      	at org.elasticsearch.index.shard.IndexShard.readAllowed(IndexShard.java:1685) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.shard.IndexShard.get(IndexShard.java:905) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.innerGet(ShardGetService.java:174) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:104) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:95) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:106) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:45) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.lambda$asyncShardOperation$0(TransportSingleShardAction.java:110) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:58) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:688) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	... 3 more
[00:04:59]                 │ info [saved_objects/spaces] Created index ".kibana"
[00:04:59]                 │ debg [saved_objects/spaces] ".kibana" settings {"index":{"auto_expand_replicas":"0-1","number_of_replicas":"0","number_of_shards":"1"}}
[00:04:59]                 │ proc [kibana] internal/process/warning.js:153
[00:04:59]                 │ proc [kibana]         throw warning;
[00:04:59]                 │ proc [kibana]         ^
[00:04:59]                 │ proc [kibana] 
[00:04:59]                 │ proc [kibana] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[00:04:59]                 │ proc [kibana]     at emitDeprecationWarning (internal/process/promises.js:111:13)
[00:04:59]                 │ proc [kibana]     at emitWarning (internal/process/promises.js:104:3)
[00:04:59]                 │ proc [kibana]     at emitPromiseRejectionWarnings (internal/process/promises.js:143:7)
[00:04:59]                 │ proc [kibana]     at process._tickCallback (internal/process/next_tick.js:69:34)
[00:04:59]                 │ info [saved_objects/spaces] Indexed 16 docs into ".kibana"
[00:04:59]                 │ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] [.kibana/J16fJrWzT7GVlK5jLKScwQ] update_mapping [_doc]
[00:04:59]                 └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "before all" hook"
[00:04:59]                 │
[00:04:59]                 └-> "after all" hook
[00:04:59]                   │ debg Migrating saved objects
[00:04:59]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=1/5)
[00:04:59]                   │ERROR [migrate saved objects] request failed (attempt=1/5)
[00:05:00]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=2/5)
[00:05:00]                   │ERROR [migrate saved objects] request failed (attempt=2/5)
[00:05:02]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=3/5)
[00:05:02]                   │ERROR [migrate saved objects] request failed (attempt=3/5)
[00:05:05]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=4/5)
[00:05:05]                   │ERROR [migrate saved objects] request failed (attempt=4/5)
[00:05:09]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=5/5)
[00:05:09]                   └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "after all" hook for "should return 403 for hiddentype doc""
[00:05:09]                   │

Stack Trace

Error: [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=5/5) -- and ran out of retries
    at KbnClientRequester.request (/dev/shm/workspace/kibana/packages/kbn-dev-utils/target/kbn_client/kbn_client_requester.js:99:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / kibana-xpack-agent / X-Pack Saved Object API Integration Tests -- security_only.x-pack/test/saved_object_api_integration/security_only/apis/bulk_update·ts.saved objects security only enabled bulkUpdate dual-privileges user "before all" hook for "should return 403 for hiddentype doc"

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: saved objects security only enabled
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_legacy_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_dual_privileges_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_dual_privileges_dashboard_only_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_dashboard_only_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_default_space_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_default_space_read_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_space_1_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added role [kibana_rbac_space_1_read_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [not_a_kibana_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_legacy_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_dual_privileges_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_dual_privileges_dashboard_only_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_dashboard_only_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_default_space_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_default_space_read_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_space_1_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] added user [a_kibana_rbac_space_1_read_user]
[00:05:09]               │ERROR [migrate saved objects] request failed (attempt=5/5)
[00:05:09]               └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "before all" hook for "should return 403 for hiddentype doc""
[00:05:09]               │
[00:04:49]           └-: bulkUpdate
[00:04:49]             └-> "before all" hook
[00:05:09]                 └-> "after all" hook
[00:04:59]             └-: dual-privileges user
[00:04:59]               └-> "before all" hook
[00:04:59]               └-> "before all" hook
[00:04:59]                 │ info [saved_objects/spaces] Loading "mappings.json"
[00:04:59]                 │ info [saved_objects/spaces] Loading "data.json"
[00:04:59]                 │ info [o.e.c.m.MetaDataCreateIndexService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] [.kibana] creating index, cause [api], templates [], shards [1]/[0], mappings [_doc]
[00:04:59]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana][0]]]).
[00:04:59]                 │ info [r.suppressed] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] path: /.kibana/_doc/telemetry%3Atelemetry, params: {index=.kibana, id=telemetry:telemetry}
[00:04:59]                 │      org.elasticsearch.action.NoShardAvailableActionException: No shard available for [get [.kibana][telemetry:telemetry]: routing [null]]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:224) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.onFailure(TransportSingleShardAction.java:210) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction$2.handleException(TransportSingleShardAction.java:266) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1067) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1176) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1150) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:60) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.ChannelActionListener.onFailure(ChannelActionListener.java:56) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable.onFailure(ActionRunnable.java:88) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.onFailure(ThreadContext.java:676) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
[00:04:59]                 │      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
[00:04:59]                 │      	at java.lang.Thread.run(Thread.java:830) [?:?]
[00:04:59]                 │      Caused by: org.elasticsearch.transport.RemoteTransportException: [kibana-ci-immutable-debian-tests-xl-1583767884413211985][127.0.0.1:6193][indices:data/read/get[s]]
[00:04:59]                 │      Caused by: org.elasticsearch.index.shard.IllegalIndexShardStateException: CurrentState[RECOVERING] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]
[00:04:59]                 │      	at org.elasticsearch.index.shard.IndexShard.readAllowed(IndexShard.java:1685) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.shard.IndexShard.get(IndexShard.java:905) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.innerGet(ShardGetService.java:174) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:104) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:95) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:106) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:45) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.lambda$asyncShardOperation$0(TransportSingleShardAction.java:110) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:58) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:688) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:04:59]                 │      	... 3 more
[00:04:59]                 │ info [saved_objects/spaces] Created index ".kibana"
[00:04:59]                 │ debg [saved_objects/spaces] ".kibana" settings {"index":{"auto_expand_replicas":"0-1","number_of_replicas":"0","number_of_shards":"1"}}
[00:04:59]                 │ proc [kibana] internal/process/warning.js:153
[00:04:59]                 │ proc [kibana]         throw warning;
[00:04:59]                 │ proc [kibana]         ^
[00:04:59]                 │ proc [kibana] 
[00:04:59]                 │ proc [kibana] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[00:04:59]                 │ proc [kibana]     at emitDeprecationWarning (internal/process/promises.js:111:13)
[00:04:59]                 │ proc [kibana]     at emitWarning (internal/process/promises.js:104:3)
[00:04:59]                 │ proc [kibana]     at emitPromiseRejectionWarnings (internal/process/promises.js:143:7)
[00:04:59]                 │ proc [kibana]     at process._tickCallback (internal/process/next_tick.js:69:34)
[00:04:59]                 │ info [saved_objects/spaces] Indexed 16 docs into ".kibana"
[00:04:59]                 │ info [o.e.c.m.MetaDataMappingService] [kibana-ci-immutable-debian-tests-xl-1583767884413211985] [.kibana/J16fJrWzT7GVlK5jLKScwQ] update_mapping [_doc]
[00:04:59]                 └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "before all" hook"
[00:04:59]                 │
[00:04:59]                 └-> "after all" hook
[00:04:59]                   │ debg Migrating saved objects
[00:04:59]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=1/5)
[00:04:59]                   │ERROR [migrate saved objects] request failed (attempt=1/5)
[00:05:00]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=2/5)
[00:05:00]                   │ERROR [migrate saved objects] request failed (attempt=2/5)
[00:05:02]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=3/5)
[00:05:02]                   │ERROR [migrate saved objects] request failed (attempt=3/5)
[00:05:05]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=4/5)
[00:05:05]                   │ERROR [migrate saved objects] request failed (attempt=4/5)
[00:05:09]                   │ERROR [GET http://elastic:changeme@localhost:6191/api/status] request failed (attempt=5/5)
[00:05:09]                   └- ✖ fail: "saved objects security only enabled bulkUpdate dual-privileges user "after all" hook for "should return 403 for hiddentype doc""
[00:05:09]                   │

Stack Trace

Error: [migrate saved objects] request failed (attempt=5/5) -- and ran out of retries
    at KbnClientRequester.request (/dev/shm/workspace/kibana/packages/kbn-dev-utils/target/kbn_client/kbn_client_requester.js:99:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)

History

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

@oatkiller oatkiller merged commit 12a3ccf into elastic:master Mar 9, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 10, 2020
* master: (22 commits)
  Generate docs from data plugin (elastic#56955)
  Fixes elastic#59513 by hiding one of the symmetric edges rather than omiting it (elastic#59514)
  Harden creation of child processes (elastic#55697)
  [Alerting] replace watcher http APIs used by index threshold Alerting (elastic#59475)
  [Maps][docs] add more details to Quantitative data driven styling docs (elastic#59553)
  chore: 🤖 hide Drilldowns in master (elastic#59698)
  [Discover] Migrate AppState/GlobalState to new app state helpers (elastic#57175)
  Use HTTP request schemas to create types, use those types in the client (elastic#59340)
  [Maps] Support categorical styling for numbers and dates (elastic#57908)
  [ML] Functional API tests - bucket span estimation with custom search.max_buckets (elastic#59665)
  Fix slm_ui setting by changing camel case back to snake case. (elastic#59663)
  removes beta tag (elastic#59618)
  [DOCS] Removed spatial references (elastic#59595)
  fix outdated docs (elastic#58729)
  [ML] Fixes bucket span estimators loading of max_buckets setting (elastic#59639)
  [ML] Refactoring anomaly detector job types (elastic#59556)
  [Upgrade Assistant] Better handling of closed indices (elastic#58890)
  additional visualizations plugin cleanup before moving to NP (elastic#59318)
  In scripted fields, unable to switch the `Type` - getting a console error which says - Class constructor DecoratedFieldFormat cannot be invoked without 'new' (elastic#59285)
  [Visualize] Remove global state in visualize (elastic#58352)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 10, 2020
…s/kibana into alerting/fix-flaky-instance-test

* 'alerting/fix-flaky-instance-test' of github.com:gmmorris/kibana: (176 commits)
  Generate docs from data plugin (elastic#56955)
  Fixes elastic#59513 by hiding one of the symmetric edges rather than omiting it (elastic#59514)
  Harden creation of child processes (elastic#55697)
  [Alerting] replace watcher http APIs used by index threshold Alerting (elastic#59475)
  [Maps][docs] add more details to Quantitative data driven styling docs (elastic#59553)
  chore: 🤖 hide Drilldowns in master (elastic#59698)
  [Discover] Migrate AppState/GlobalState to new app state helpers (elastic#57175)
  Use HTTP request schemas to create types, use those types in the client (elastic#59340)
  [Maps] Support categorical styling for numbers and dates (elastic#57908)
  [ML] Functional API tests - bucket span estimation with custom search.max_buckets (elastic#59665)
  Fix slm_ui setting by changing camel case back to snake case. (elastic#59663)
  removes beta tag (elastic#59618)
  [DOCS] Removed spatial references (elastic#59595)
  fix outdated docs (elastic#58729)
  [ML] Fixes bucket span estimators loading of max_buckets setting (elastic#59639)
  [ML] Refactoring anomaly detector job types (elastic#59556)
  [Upgrade Assistant] Better handling of closed indices (elastic#58890)
  additional visualizations plugin cleanup before moving to NP (elastic#59318)
  In scripted fields, unable to switch the `Type` - getting a console error which says - Class constructor DecoratedFieldFormat cannot be invoked without 'new' (elastic#59285)
  [Visualize] Remove global state in visualize (elastic#58352)
  ...
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 59340 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 10, 2020
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 59340 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 11, 2020
@oatkiller oatkiller deleted the schema-stuff branch March 31, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants