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: API Integration Tests.test/api_integration/apis/data_views/fields_for_wildcard_route/response·ts - apis index_patterns index_patterns/_fields_for_wildcard route fields_for_wildcard_route response returns 200 when index is closed #199413

Open
kibanamachine opened this issue Nov 8, 2024 · 24 comments · May be fixed by #199717
Labels
blocker failed-es-promotion failed-test A test failure on a tracked branch, potentially flaky-test skipped-test Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.17.0 v9.0.0

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Nov 8, 2024

A test failed on a tracked branch

Error: expected 200 "OK", got 404 "Not Found"
    at Context.<anonymous> (response.ts:252:10)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.apply (wrap_function.js:74:16)
----
    at Test._assertStatus (node_modules/supertest/lib/test.js:252:14)
    at /opt/buildkite-agent/builds/bk-agent-prod-gcp-1731037086955086518/elastic/kibana-elasticsearch-snapshot-verify/kibana/node_modules/supertest/lib/test.js:308:13
    at Test._assertFunction (node_modules/supertest/lib/test.js:285:13)
    at Test.assert (node_modules/supertest/lib/test.js:164:23)
    at localAssert (node_modules/supertest/lib/test.js:120:14)
    at fn (node_modules/supertest/lib/test.js:125:7)
    at Test.callback (node_modules/superagent/src/node/index.js:899:3)
    at fn (node_modules/superagent/src/node/index.js:1165:18)
    at IncomingMessage.<anonymous> (node_modules/superagent/src/node/parsers/json.js:19:7)
    at IncomingMessage.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

First failure: kibana-elasticsearch-snapshot-verify - 8.x

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Nov 8, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Nov 8, 2024
@kibanamachine kibanamachine added failed-es-promotion Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Nov 8, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Nov 8, 2024
@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - 8.x

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@delanni
Copy link
Contributor

delanni commented Nov 8, 2024

@elastic/kibana-data-discovery - This is not flakiness, this is due to a new ES snapshot. Can you help us triage if this is something we need to adjust to on the Kibana side?

@jughosta
Copy link
Contributor

jughosta commented Nov 8, 2024

It does not look like the ES response for a closed index changed. I tested with the following and it's the same on older version.

PUT test
PUT test/_mapping
{
  "properties": {
    "actual": {
      "type": "keyword"
    }
  }
}
POST test/_field_caps?fields=*
POST test/_close
POST test/_field_caps?fields=*

Maybe it takes longer in some cases to create an index.

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - 8.x

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - 8.x

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - 8.x

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - 8.x

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - 8.x

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - main

@kibanamachine
Copy link
Contributor Author

New failure: kibana-elasticsearch-snapshot-verify - 8.x

@kertal
Copy link
Member

kertal commented Nov 11, 2024

@jughosta did you test with the latest snapshot? Looking at the test, I don't see a reason why there should be a 404

  it('returns 200 when index is closed', async () => {
      const es = getService('es');

      await es.indices.close({ index: 'basic_index' });

      await supertest
        .get(FIELDS_FOR_WILDCARD_PATH)
        .set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL)
        .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
        .query({ pattern: 'basic_index' })
        .expect(200, {
          fields: [],
          indices: [],
        });
    });

according to the logs the closing was successful, but also it seems the cluster health state was RED before going to YELLOW? I don't think this is expected?

”-> "before each" hook: global before each for "returns 200 when index is closed"
[00:00:16]             │ info [o.e.c.m.MetadataIndexStateService] [ftr] closing indices [basic_index/UCol_hTtQJK87jIxTgQg5A]
[00:00:16]             │ info [o.e.c.m.MetadataIndexStateService] [ftr] completed closing of indices [basic_index]
[00:00:17]             │ info [o.e.c.r.a.AllocationService] [ftr] current.health="YELLOW" message="Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[basic_index][0]]])." previous.health="RED" reason="shards started [[basic_index][0]]"
[00:00:17]             └- ✖ fail: apis index_patterns index_patterns/_fields_for_wildcard route fields_for_wildcard_route response returns 200 when index is closed

FYI @jbudz

@kertal
Copy link
Member

kertal commented Nov 11, 2024

Not sure if this is expected from ES side, that when an index is closed it's switching from RED to YELLOW? if this is, maybe @jughosta is right about "taking longer", it might take longer from ES side to get from the RED to the YELLOW state, and in between it causes a 404?

info [o.e.c.r.a.AllocationService] [ftr] current.health="YELLOW" message="Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[basic_index][0]]])." previous.health="RED" reason="shards started [[basic_index][0]]"
[00:00:32]             └- ✖ fail: apis index_patterns index_patterns/_fields_for_wildcard route fields_for_wildcard_route response returns 200 when index is closed

@jughosta
Copy link
Contributor

There is a change in ES response, please see #199654 (comment)

@jbudz
Copy link
Member

jbudz commented Nov 11, 2024

We're going to skip, promote the new snapshot, and apply a fix in

if (error.message.startsWith('cluster_block_exception')) {

@jbudz
Copy link
Member

jbudz commented Nov 11, 2024

/skip

@kibanamachine
Copy link
Contributor Author

Skipped

8.x: faf0496
main: e6265f2

tkajtoch pushed a commit to tkajtoch/kibana that referenced this issue Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker failed-es-promotion failed-test A test failure on a tracked branch, potentially flaky-test skipped-test Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants