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

[test-failed]: X-Pack API Integration Tests1.x-pack/test/api_integration/apis/fleet/unenroll_agent·ts - apis Fleet Endpoints fleet_unenroll_agent "before each" hook for "allow to unenroll using a list of ids" #72193

Closed
liza-mae opened this issue Jul 16, 2020 · 14 comments · Fixed by #73317
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:Operations Team label for Operations Team test-cloud

Comments

@liza-mae
Copy link
Contributor

Version: 7.9.0
Class: X-Pack API Integration Tests1.x-pack/test/api_integration/apis/fleet/unenroll_agent·ts
Stack Trace:
{ ConnectionError: self signed certificate in certificate chain
at ClientRequest.request.on.err (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackExt/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/@elastic/elasticsearch/lib/Connection.js:107:18)
at TLSSocket.socketErrorListener (_http_client.js:401:9)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'ConnectionError',
meta:
{ body: null,
statusCode: null,
headers: null,
warnings: null,
meta:
{ context: null,
request: [Object],
name: 'elasticsearch-js',
connection: [Object],
attempts: 3,
aborted: false } } }
Test Report: https://internal-ci.elastic.co/view/Stack%20Tests/job/elastic+estf-cloud-kibana-tests/495/testReport/

@liza-mae liza-mae added failed-test A test failure on a tracked branch, potentially flaky-test test-cloud labels Jul 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-test-triage (failed-test)

@jen-huang jen-huang added the Team:Fleet Team label for Observability Data Collection Fleet team label Jul 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@delvedor
Copy link
Member

Hello! It looks like you are using a self-signed certificate in the test environment, and this is causing the Elasticsearch Node.js client to fail. You should either add rejectUnauthorized: false in the ssl configuration or put process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 at the top of your test file.

This is valid also for #72180 #72181 #72194 #72195 #72196

@jen-huang jen-huang self-assigned this Jul 20, 2020
@liza-mae
Copy link
Contributor Author

Thanks @delvedor I tested it with that option set and it worked, why do these specific tests need this setting? Looks like the other API tests are working without it.

@spalger
Copy link
Contributor

spalger commented Jul 22, 2020

@delvedor I think it's misleading to imply that the only "solution" is to disable TLS authorization. Turning off authorization is a work around, not a solution.

@liza-mae
Copy link
Contributor Author

Thanks @spalger for clarifying - I am going to revert my change so we don't mask this failure.

cc: @legrego @jportner

@liza-mae liza-mae reopened this Jul 22, 2020
@liza-mae liza-mae added the Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! label Jul 22, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@liza-mae
Copy link
Contributor Author

@legrego if this test is catching a TLS misconfiguration on cloud we need to investigate it.

@jen-huang jen-huang removed their assignment Jul 22, 2020
@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 22, 2020

Checking first with fleet team to see if there isn't something incorrect on their side first.

@liza-mae liza-mae added the bug Fixes for quality problems that affect the customer experience label Jul 22, 2020
@liza-mae
Copy link
Contributor Author

cc: @nchaulet to look at the tests.

@nchaulet nchaulet self-assigned this Jul 22, 2020
@nchaulet
Copy link
Member

I am able to have a repro locally and looks like I am able to fix the test by commenting this line https://github.com/elastic/kibana/blob/master/test/common/services/elasticsearch.ts#L32

I do not think it's a ingest manager specific problem

@liza-mae
Copy link
Contributor Author

I am not familiar with this setup.

@spalger why would commenting out this line fix the problem?

ca: fs.readFileSync(CA_CERT_PATH, 'utf-8'),

@liza-mae liza-mae removed the bug Fixes for quality problems that affect the customer experience label Jul 22, 2020
@spalger
Copy link
Contributor

spalger commented Jul 22, 2020

Looks like this line was added in #65598 with the assumption that the only time the elasticsearch client is used with https urls will be when using our local certificates.

@liza-mae liza-mae added Team:Operations Team label for Operations Team and removed Team:Fleet Team label for Observability Data Collection Fleet team Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Jul 22, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

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:Operations Team label for Operations Team test-cloud
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants