elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.57k stars 8.09k forks source link

Failing ES Forward Compatibility: Default CI Group #1 / APM API tests trial no data ML jobs when user has write access to ML when calling create endpoint creates two jobs #179168

Closed mistic closed 1 month ago

mistic commented 5 months ago

APM API Integration tests (trial) x-pack/test/apm_api_integration/tests/settings/anomaly_detection/write_user.ts

APM API tests trial no data ML jobs when user has write access to ML when calling create endpoint creates two jobs

This failure is preventing the ES 8.14 forward compatibility pipeline to proceed.

ApmApiError: Unhandled ApmApiError.
Status: "500"
Endpoint: "POST /internal/apm/settings/anomaly-detection/jobs"
Body: {"statusCode":500,"error":"Internal Server Error","message":"An error occurred while creating ML jobs: [{\"id\":\"apm-production-2066-high_mean_transaction_duration\",\"error\":{\"error\":{\"root_cause\":[{\"type\":\"x_content_parse_exception\",\"reason\":\"[1:2] [job_details] unknown field [job_type]\"}],\"type\":\"x_content_parse_exception\",\"reason\":\"[1:2] [job_details] unknown field [job_type]\"},\"status\":400}},{\"id\":\"apm-staging-32e3-high_mean_transaction_duration\",\"error\":{\"error\":{\"root_cause\":[{\"type\":\"x_content_parse_exception\",\"reason\":\"[1:2] [job_details] unknown field [job_type]\"}],\"type\":\"x_content_parse_exception\",\"reason\":\"[1:2] [job_details] unknown field [job_type]\"},\"status\":400}}]","attributes":{"_inspect":[]}}
    at Proxy.<anonymous> (test/apm_api_integration/common/apm_api_supertest.ts:37:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Context.<anonymous> (test/apm_api_integration/tests/settings/anomaly_detection/write_user.ts:57:11)
    at Object.apply (/opt/local-ssd/buildkite/builds/kb-n2-4-6d3fe13f0cd36535/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:78:16) {
  res: <ref *1> Response {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    res: { method: null, url: '', complete: true, aborted: false },
    request: Test {
      _events: [Object: null prototype],
      _eventsCount: 1,
      _maxListeners: undefined,
      _enableHttp2: false,
      _agent: false,
      _formData: null,
      method: 'POST',
      url: 'http://apm_write_user:changeme@localhost:5620/internal/apm/settings/anomaly-detection/jobs',
      _header: [Object],
      header: [Object],
      writable: true,
      _redirects: 0,
      _maxRedirects: 0,
      cookies: '',
      qs: {},
      _query: [],
      qsRaw: [],
      _redirectList: [],
      _streamRequest: false,
      _lookup: undefined,
      _buffer: true,
      app: 'http://apm_write_user:changeme@localhost:5620',
      _asserts: [],
      _data: [Object],
      req: [ClientRequest],
      protocol: 'http:',
      host: 'localhost:5620',
      _endCalled: true,
      _callback: [Function (anonymous)],
      _fullfilledPromise: [Promise],
      res: [Object],
      _resBuffered: true,
      response: [Circular *1],
      called: true,
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: false
    },
    req: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 3,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: true,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: 41,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: true,
      socket: [Socket],
      _header: 'POST /internal/apm/settings/anomaly-detection/jobs HTTP/1.1\r\n' +
        'Host: localhost:5620\r\n' +
        'Accept-Encoding: gzip, deflate\r\n' +
        'Content-Type: application/json\r\n' +
        'kbn-xsrf: foo\r\n' +
        'Authorization: Basic YXBtX3dyaXRlX3VzZXI6Y2hhbmdlbWU=\r\n' +
        'Content-Length: 41\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      joinDuplicateHeaders: undefined,
      path: '/internal/apm/settings/anomaly-detection/jobs',
      _ended: true,
      res: [Object],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'localhost',
      protocol: 'http:',
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kHighWaterMark)]: 16384,
      [Symbol(kRejectNonStandardBodyWrites)]: false,
      [Symbol(kUniqueHeaders)]: null
    },
    text: '{"statusCode":500,"error":"Internal Server Error","message":"An error occurred while creating ML jobs: [{\\"id\\":\\"apm-production-2066-high_mean_transaction_duration\\",\\"error\\":{\\"error\\":{\\"root_cause\\":[{\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"}],\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"},\\"status\\":400}},{\\"id\\":\\"apm-staging-32e3-high_mean_transaction_duration\\",\\"error\\":{\\"error\\":{\\"root_cause\\":[{\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"}],\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"},\\"status\\":400}}]","attributes":{"_inspect":[]}}',
    files: undefined,
    buffered: true,
    headers: {
      'x-content-type-options': 'nosniff',
      'referrer-policy': 'no-referrer-when-downgrade',
      'content-security-policy': "script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'",
      'kbn-name': 'kb-n2-4-6d3fe13f0cd36535',
      'kbn-license-sig': '5f32a93d45edc3ed88c035e3fcdc67d0fb4b980426abfd73d986059093a91d63',
      'content-type': 'application/json; charset=utf-8',
      'cache-control': 'private, no-cache, no-store, must-revalidate',
      'content-length': '772',
      date: 'Thu, 21 Mar 2024 14:06:15 GMT',
      connection: 'close'
    },
    header: {
      'x-content-type-options': 'nosniff',
      'referrer-policy': 'no-referrer-when-downgrade',
      'content-security-policy': "script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'",
      'kbn-name': 'kb-n2-4-6d3fe13f0cd36535',
      'kbn-license-sig': '5f32a93d45edc3ed88c035e3fcdc67d0fb4b980426abfd73d986059093a91d63',
      'content-type': 'application/json; charset=utf-8',
      'cache-control': 'private, no-cache, no-store, must-revalidate',
      'content-length': '772',
      date: 'Thu, 21 Mar 2024 14:06:15 GMT',
      connection: 'close'
    },
    statusCode: 500,
    status: 500,
    statusType: 5,
    info: false,
    ok: false,
    redirect: false,
    clientError: false,
    serverError: true,
    error: Error: cannot POST /internal/apm/settings/anomaly-detection/jobs (500)
        at Response.toError (/opt/local-ssd/buildkite/builds/kb-n2-4-6d3fe13f0cd36535/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility/kibana/node_modules/superagent/src/node/response.js:110:17)
        at Response._setStatusProperties (/opt/local-ssd/buildkite/builds/kb-n2-4-6d3fe13f0cd36535/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility/kibana/node_modules/superagent/src/response-base.js:107:48)
        at new Response (/opt/local-ssd/buildkite/builds/kb-n2-4-6d3fe13f0cd36535/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility/kibana/node_modules/superagent/src/node/response.js:41:8)
        at Test._emitResponse (/opt/local-ssd/buildkite/builds/kb-n2-4-6d3fe13f0cd36535/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility/kibana/node_modules/superagent/src/node/index.js:953:20)
        at fn (/opt/local-ssd/buildkite/builds/kb-n2-4-6d3fe13f0cd36535/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility/kibana/node_modules/superagent/src/node/index.js:1166:38)
        at IncomingMessage.<anonymous> (/opt/local-ssd/buildkite/builds/kb-n2-4-6d3fe13f0cd36535/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility/kibana/node_modules/superagent/src/node/parsers/json.js:19:7)
        at IncomingMessage.emit (node:events:530:35)
        at endReadableNT (node:internal/streams/readable:1696:12)
        at processTicksAndRejections (node:internal/process/task_queues:82:21) {
      status: 500,
      text: '{"statusCode":500,"error":"Internal Server Error","message":"An error occurred while creating ML jobs: [{\\"id\\":\\"apm-production-2066-high_mean_transaction_duration\\",\\"error\\":{\\"error\\":{\\"root_cause\\":[{\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"}],\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"},\\"status\\":400}},{\\"id\\":\\"apm-staging-32e3-high_mean_transaction_duration\\",\\"error\\":{\\"error\\":{\\"root_cause\\":[{\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"}],\\"type\\":\\"x_content_parse_exception\\",\\"reason\\":\\"[1:2] [job_details] unknown field [job_type]\\"},\\"status\\":400}}]","attributes":{"_inspect":[]}}',
      method: 'POST',
      path: '/internal/apm/settings/anomaly-detection/jobs'
    },
    created: false,
    accepted: false,
    noContent: false,
    badRequest: false,
    unauthorized: false,
    notAcceptable: false,
    forbidden: false,
    notFound: false,
    unprocessableEntity: false,
    type: 'application/json',
    charset: 'utf-8',
    links: {},
    setEncoding: [Function: bound ],
    redirects: [],
    _body: {
      statusCode: 500,
      error: 'Internal Server Error',
      message: 'An error occurred while creating ML jobs: [{"id":"apm-production-2066-high_mean_transaction_duration","error":{"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:2] [job_details] unknown field [job_type]"}],"type":"x_content_parse_exception","reason":"[1:2] [job_details] unknown field [job_type]"},"status":400}},{"id":"apm-staging-32e3-high_mean_transaction_duration","error":{"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:2] [job_details] unknown field [job_type]"}],"type":"x_content_parse_exception","reason":"[1:2] [job_details] unknown field [job_type]"},"status":400}}]',
      attributes: [Object]
    },
    pipe: [Function (anonymous)],
    [Symbol(shapeMode)]: false,
    [Symbol(kCapture)]: false
  }
}
elasticmachine commented 5 months ago

Pinging @elastic/apm-ui (Team:APM)

mistic commented 5 months ago

Skipped.

7.17: bfbee98

crespocarlos commented 1 month ago

I've run this test on 7.17.23 against ES 8.14.0, 8.14.1. 8.14.2 and 8.14.3 and couldn't reproduce the problem.