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

Failing test: Plugin Functional Tests.test/plugin_functional/test_suites/saved_objects_hidden_type/delete·ts - Saved objects with hidden type delete "before all" hook for "should return generic 404 when trying to delete a doc with importableAndExportable types" #131871

Closed
kibanamachine opened this issue May 9, 2022 · 8 comments
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented May 9, 2022

A test failed on a tracked branch

Error: Forcing mocha to abort
    at Object.next (node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/run_tests.js:42:25)
    at SafeSubscriber.__tryOrUnsub (node_modules/rxjs/src/internal/Subscriber.ts:265:10)
    at SafeSubscriber.next (node_modules/rxjs/src/internal/Subscriber.ts:207:14)
    at Subscriber._next (node_modules/rxjs/src/internal/Subscriber.ts:139:22)
    at Subscriber.next (node_modules/rxjs/src/internal/Subscriber.ts:99:12)
    at RaceSubscriber.notifyNext (node_modules/rxjs/src/internal/observable/race.ts:137:22)
    at InnerSubscriber._next (node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)
    at InnerSubscriber.Subscriber.next (node_modules/rxjs/src/internal/Subscriber.ts:99:12)
    at TakeSubscriber._next (node_modules/rxjs/src/internal/operators/take.ts:92:24)
    at TakeSubscriber.Subscriber.next (node_modules/rxjs/src/internal/Subscriber.ts:99:12)
    at AbortSignal.handler (node_modules/rxjs/src/internal/observable/fromEvent.ts:201:20)
    at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
    at AbortSignal.dispatchEvent (node:internal/event_target:589:26)
    at abortSignal (node:internal/abort_controller:283:10)
    at AbortController.abort (node:internal/abort_controller:314:5)
    at onEarlyExit (node_modules/@kbn/test/target_node/functional_tests/tasks.js:112:21) {
  uncaught: true
}

First failure: CI Build - 7.17

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label May 9, 2022
@botelastic botelastic bot added the needs-team Issues missing a team label label May 9, 2022
@jsanz jsanz added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label May 11, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@botelastic botelastic bot removed the needs-team Issues missing a team label label May 11, 2022
@jsanz
Copy link
Member

jsanz commented May 11, 2022

@elastic/kibana-core this seems to be related with your area, please reassign if I'm wrong.

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - 7.17

@TinaHeiligers
Copy link
Contributor

@jsanz you are correct with the team assignment. The tests were added in #90178

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - 7.17

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - 7.17

mistic added a commit that referenced this issue Sep 28, 2022
@mistic
Copy link
Member

mistic commented Sep 28, 2022

Skipped. These tests began to be flaky after an update to Chromium.

7.17: 035bffc

@gsoldevila
Copy link
Contributor

Same underlying cause as #131830

These tests load documents in the .kibana index through ES archiver, in a before block.

There seems to be a race condition, probably competing against the Kibana startup migration logic.

  1. ES archiver’s load operation performs a migration of the .kibana index after loading the documents into it.
  2. This migration calls the /internal/saved_objects/_migrate endpoint, which runs the .kibana migrator.

This operation fails, and it seems that since the Promise rejection is not handled, brings the Kibana server down.

ERROR [migrate saved objects] request failed (attempt=1/5): read ECONNRESET
ERROR [kibana] exitted early: [kibana] exited with code 1

Internally, during this migration, one of the calls to ES fails due to an unexisting index alias:

proc [kibana] Unhandled Promise rejection detected:
[00:09:13]             │ proc [kibana] 
[00:09:13]             │ proc [kibana] ResponseError: Saved object index alias [.kibana_7.17.6] not found: index_not_found_exception: [index_not_found_exception] Reason: no such index [.kibana_7.17.6] and [require_alias] request flag is [true] and [.kibana_7.17.6] is not an alias
[00:09:13]             │ proc [kibana]     at onBody (/opt/local-ssd/buildkite/builds/kb-n2-4-29dc84655aa33b78/elastic/kibana-on-merge/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:367:23)
[00:09:13]             │ proc [kibana]     at IncomingMessage.onEnd (/opt/local-ssd/buildkite/builds/kb-n2-4-29dc84655aa33b78/elastic/kibana-on-merge/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:291:11)
[00:09:13]             │ proc [kibana]     at IncomingMessage.emit (node:events:539:35)
[00:09:13]             │ proc [kibana]     at endReadableNT (node:internal/streams/readable:1345:12)
[00:09:13]             │ proc [kibana]     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
[00:09:13]             │ proc [kibana]   meta: {
[00:09:13]             │ proc [kibana]     body: { error: [Object], status: 404 },
[00:09:13]             │ proc [kibana]     statusCode: 404,
[00:09:13]             │ proc [kibana]     headers: {
[00:09:13]             │ proc [kibana]       'x-opaque-id': 'unknownId',
[00:09:13]             │ proc [kibana]       'x-elastic-product': 'Elasticsearch',
[00:09:13]             │ proc [kibana]       'content-type': 'application/json; charset=UTF-8',
[00:09:13]             │ proc [kibana]       'content-length': '445'
[00:09:13]             │ proc [kibana]     },
[00:09:13]             │ proc [kibana]     meta: {
[00:09:13]             │ proc [kibana]       context: null,
[00:09:13]             │ proc [kibana]       request: [Object],
[00:09:13]             │ proc [kibana]       name: 'elasticsearch-js',
[00:09:13]             │ proc [kibana]       connection: [Object],
[00:09:13]             │ proc [kibana]       attempts: 0,
[00:09:13]             │ proc [kibana]       aborted: false
[00:09:13]             │ proc [kibana]     }
[00:09:13]             │ proc [kibana]   },
[00:09:13]             │ proc [kibana]   isBoom: true,
[00:09:13]             │ proc [kibana]   isServer: true,
[00:09:13]             │ proc [kibana]   data: null,
[00:09:13]             │ proc [kibana]   output: {
[00:09:13]             │ proc [kibana]     statusCode: 500,
[00:09:13]             │ proc [kibana]     payload: {
[00:09:13]             │ proc [kibana]       message: 'An internal server error occurred',
[00:09:13]             │ proc [kibana]       statusCode: 500,
[00:09:13]             │ proc [kibana]       error: 'Internal Server Error'
[00:09:13]             │ proc [kibana]     },
[00:09:13]             │ proc [kibana]     headers: {}
[00:09:13]             │ proc [kibana]   },
[00:09:13]             │ proc [kibana]   [Symbol(SavedObjectsClientErrorCode)]: 'SavedObjectsClient/generalError'
[00:09:13]             │ proc [kibana] }
[00:09:13]             │ proc [kibana] 
[00:09:13]             │ proc [kibana] Terminating process...

I imagine that this alias is missing occasionally (flakily) due to other asynchronous actors deleting it.

  • My best guess is Kibana’s startup migration logic, which runs a migrator for every index. It would seem that this logic must run BEFORE starting the tests, but I haven’t confirmed that this is executed sequentially with the proper awaits.
  • Could be that ES fails for some other reason and takes Kibana down with it too.
  • Could other FT be running in parallel and impacting each other?

@gsoldevila gsoldevila self-assigned this Aug 10, 2023
gsoldevila added a commit that referenced this issue Aug 11, 2023
…ives to reduce flakiness (#162259) (#163479)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[FTR - esArchiver] Update `saved_objects_management` test archives to
reduce flakiness
(#162259)](#162259)

<!--- Backport version: 8.9.8 -->

### Related issues:
- #132855
- #130305
- #147635
- #132566
- #131871
- #131830
- #131834

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2023-07-24T08:11:39Z","message":"[FTR
- esArchiver] Update `saved_objects_management` test archives to reduce
flakiness (#162259)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/161882\r\n\r\nUpdates all
archives of
the\r\n`test/functional/fixtures/es_archiver/saved_objects_management`
test\r\nsuite:\r\n* Removing SO index definitions.\r\n* Updating
documents defined in
`data.json`.","sha":"59450f0a22bb8c34598d7156dcbf144d41752259","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","technical
debt","release_note:skip","backport:skip","FTR","v8.10.0"],"number":162259,"url":"https://github.com/elastic/kibana/pull/162259","mergeCommit":{"message":"[FTR
- esArchiver] Update `saved_objects_management` test archives to reduce
flakiness (#162259)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/161882\r\n\r\nUpdates all
archives of
the\r\n`test/functional/fixtures/es_archiver/saved_objects_management`
test\r\nsuite:\r\n* Removing SO index definitions.\r\n* Updating
documents defined in
`data.json`.","sha":"59450f0a22bb8c34598d7156dcbf144d41752259"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162259","number":162259,"mergeCommit":{"message":"[FTR
- esArchiver] Update `saved_objects_management` test archives to reduce
flakiness (#162259)\n\n## Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/161882\r\n\r\nUpdates all
archives of
the\r\n`test/functional/fixtures/es_archiver/saved_objects_management`
test\r\nsuite:\r\n* Removing SO index definitions.\r\n* Updating
documents defined in
`data.json`.","sha":"59450f0a22bb8c34598d7156dcbf144d41752259"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

6 participants