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

Cherry-pick #24489 to 7.12: [Elastic Agent] Add verification check when updating communication to Kibana. #24520

Merged
merged 4 commits into from
Mar 15, 2021

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Mar 12, 2021

Cherry-pick of PR #24489 to 7.12 branch. Original message:

What does this PR do?

Adds a verification check when updating how the Elastic Agent communicates with Kibana. Ensures that the Elastic Agent reports Failed when an error occurs dispatching action.

Why is it important?

Currently if the user has the global Kibana connection information wrong in the policies Elastic Agent will update the client and then fail to checkin. This ensures that before updating to a new client that the new client can actually communicate with Kibana. In the case that it cannot communicate it updates the Elastic Agent as failed and reports back to the original client that the action of updating the policy failed.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

… Kibana. (elastic#24489)

* Add verification check when updating communication to Kibana.

* Add changelog.

* Add const.

(cherry picked from commit ad3300d)
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 12, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 12, 2021
@botelastic
Copy link

botelastic bot commented Mar 12, 2021

This pull request doesn't have a Team:<team> label.

@blakerouse blakerouse self-assigned this Mar 12, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 12, 2021

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: Pull request #24520 updated

  • Reason: Aborted from #4

  • Start Time: 2021-03-15T15:58:35.703+0000

  • Duration: 63 min 44 sec

  • Commit: 437ab43

Test stats 🧪

Test Results
Failed 0
Passed 6532
Skipped 24
Total 6556

Trends 🧪

Image of Build Times

Image of Tests

Steps errors 1

Expand to view the steps failures

Error signal
  • Took 0 min 0 sec . View more details on here
  • Description: Error 'org.jenkinsci.plugins.workflow.steps.FlowInterruptedException'

Log output

Expand to view the last 100 lines of log output

[2021-03-15T17:00:00.575Z]  Go version:        go1.13.15
[2021-03-15T17:00:00.575Z]  Git commit:        4484c46
[2021-03-15T17:00:00.575Z]  Built:             Wed Sep 16 17:03:14 2020
[2021-03-15T17:00:00.575Z]  OS/Arch:           linux/arm64
[2021-03-15T17:00:00.575Z]  Experimental:      false
[2021-03-15T17:00:00.575Z] 
[2021-03-15T17:00:00.575Z] Server: Docker Engine - Community
[2021-03-15T17:00:00.575Z]  Engine:
[2021-03-15T17:00:00.575Z]   Version:          19.03.13
[2021-03-15T17:00:00.575Z]   API version:      1.40 (minimum version 1.12)
[2021-03-15T17:00:00.575Z]   Go version:       go1.13.15
[2021-03-15T17:00:00.575Z]   Git commit:       4484c46
[2021-03-15T17:00:00.575Z]   Built:            Wed Sep 16 17:01:45 2020
[2021-03-15T17:00:00.575Z]   OS/Arch:          linux/arm64
[2021-03-15T17:00:00.575Z]   Experimental:     false
[2021-03-15T17:00:00.575Z]  containerd:
[2021-03-15T17:00:00.575Z]   Version:          1.3.7
[2021-03-15T17:00:00.575Z]   GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
[2021-03-15T17:00:00.575Z]  runc:
[2021-03-15T17:00:00.575Z]   Version:          1.0.0-rc10
[2021-03-15T17:00:00.575Z]   GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
[2021-03-15T17:00:00.575Z]  docker-init:
[2021-03-15T17:00:00.575Z]   Version:          0.18.0
[2021-03-15T17:00:00.575Z]   GitCommit:        fec3683
[2021-03-15T17:00:00.575Z] Change ownership of all files inside the specific folder from root/root to current user/group
[2021-03-15T17:00:05.129Z] Change permissions with write access of all files inside the specific folder
[2021-03-15T17:00:06.589Z] + python .ci/scripts/pre_archive_test.py
[2021-03-15T17:00:09.090Z] Copy ./x-pack/metricbeat/build into build/x-pack/metricbeat/build
[2021-03-15T17:00:09.090Z] Copy ./x-pack/metricbeat/build/golang-crossbuild into build/x-pack/metricbeat/build/golang-crossbuild
[2021-03-15T17:00:09.090Z] Copy ./x-pack/filebeat/build into build/x-pack/filebeat/build
[2021-03-15T17:00:09.090Z] Copy ./x-pack/filebeat/build/golang-crossbuild into build/x-pack/filebeat/build/golang-crossbuild
[2021-03-15T17:00:09.090Z] Copy ./x-pack/elastic-agent/build into build/x-pack/elastic-agent/build
[2021-03-15T17:00:09.090Z] Copy ./x-pack/elastic-agent/build/package/elastic-agent-ubi8/elastic-agent-linux-arm64.docker/docker-build into build/x-pack/elastic-agent/build/package/elastic-agent-ubi8/elastic-agent-linux-arm64.docker/docker-build
[2021-03-15T17:00:09.090Z] Copy ./x-pack/elastic-agent/build/package/elastic-agent/elastic-agent-linux-arm64.docker/docker-build into build/x-pack/elastic-agent/build/package/elastic-agent/elastic-agent-linux-arm64.docker/docker-build
[2021-03-15T17:00:09.090Z] Copy ./x-pack/elastic-agent/build/golang-crossbuild into build/x-pack/elastic-agent/build/golang-crossbuild
[2021-03-15T17:00:09.090Z] Copy ./x-pack/heartbeat/build into build/x-pack/heartbeat/build
[2021-03-15T17:00:09.090Z] Copy ./x-pack/heartbeat/build/golang-crossbuild into build/x-pack/heartbeat/build/golang-crossbuild
[2021-03-15T17:00:09.190Z] Running in /var/lib/jenkins/workspace/PR-24520-3-dd250922-7f71-4abc-97a2-b1826d34183e/src/github.com/elastic/beats/build
[2021-03-15T17:00:09.759Z] + rm -rf ve
[2021-03-15T17:00:09.760Z] + find . -type d -name vendor -exec rm -r {} ;
[2021-03-15T17:00:09.895Z] Recording test results
[2021-03-15T17:00:10.378Z] None of the test reports contained any result
[2021-03-15T17:00:10.385Z] [Checks API] No suitable checks publisher found.
[2021-03-15T17:00:10.989Z] + tar --version
[2021-03-15T17:00:11.684Z] + tar --exclude=test-build-artifacts-x-pack/elastic-agent-packaging-arm-arm.tgz -czf test-build-artifacts-x-pack/elastic-agent-packaging-arm-arm.tgz .
[2021-03-15T17:00:12.899Z] Click here to forcibly terminate running steps
[2021-03-15T17:00:53.439Z] + gsutil --version
[2021-03-15T17:00:53.439Z] /var/lib/jenkins/workspace/PR-24520-3-dd250922-7f71-4abc-97a2-b1826d34183e/src/github.com/elastic/beats/build@tmp/durable-99d2c8db/script.sh: 1: /var/lib/jenkins/workspace/PR-24520-3-dd250922-7f71-4abc-97a2-b1826d34183e/src/github.com/elastic/beats/build@tmp/durable-99d2c8db/script.sh: gsutil: not found
[2021-03-15T17:00:53.553Z] Running in /var/lib/jenkins/workspace/PR-24520-3-dd250922-7f71-4abc-97a2-b1826d34183e/src/github.com/elastic/beats/build@tmp
[2021-03-15T17:00:54.359Z] + wget --version
[2021-03-15T17:00:55.023Z] + wget -q -O gsutil.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-319.0.0-linux-x86_64.tar.gz
[2021-03-15T17:00:56.509Z] + tar -xpf gsutil.tar.gz --strip-components=1
[2021-03-15T17:00:58.649Z] Masking supported pattern matches of $FILE_CREDENTIAL
[2021-03-15T17:00:59.242Z] + gcloud auth activate-service-account --key-file ****
[2021-03-15T17:01:01.095Z] Activated service account credentials for: [[email protected]]
[2021-03-15T17:01:01.788Z] + gsutil -m -q cp -a public-read test-build-artifacts-x-pack/elastic-agent-packaging-arm-arm.tgz gs://beats-ci-temp/Beats/beats/PR-24520-3
[2021-03-15T17:01:08.076Z] + python .ci/scripts/search_system_tests.py
[2021-03-15T17:01:08.214Z] [INFO] system-tests=''. If no empty then let's create a tarball
[2021-03-15T17:01:08.838Z] + go clean -modcache
[2021-03-15T17:01:12.147Z] Cleaning up /var/lib/jenkins/workspace/PR-24520-3-dd250922-7f71-4abc-97a2-b1826d34183e
[2021-03-15T17:01:12.147Z] Client: Docker Engine - Community
[2021-03-15T17:01:12.147Z]  Version:           19.03.13
[2021-03-15T17:01:12.147Z]  API version:       1.40
[2021-03-15T17:01:12.147Z]  Go version:        go1.13.15
[2021-03-15T17:01:12.147Z]  Git commit:        4484c46
[2021-03-15T17:01:12.147Z]  Built:             Wed Sep 16 17:03:14 2020
[2021-03-15T17:01:12.147Z]  OS/Arch:           linux/arm64
[2021-03-15T17:01:12.147Z]  Experimental:      false
[2021-03-15T17:01:12.147Z] 
[2021-03-15T17:01:12.147Z] Server: Docker Engine - Community
[2021-03-15T17:01:12.147Z]  Engine:
[2021-03-15T17:01:12.147Z]   Version:          19.03.13
[2021-03-15T17:01:12.147Z]   API version:      1.40 (minimum version 1.12)
[2021-03-15T17:01:12.147Z]   Go version:       go1.13.15
[2021-03-15T17:01:12.147Z]   Git commit:       4484c46
[2021-03-15T17:01:12.147Z]   Built:            Wed Sep 16 17:01:45 2020
[2021-03-15T17:01:12.147Z]   OS/Arch:          linux/arm64
[2021-03-15T17:01:12.147Z]   Experimental:     false
[2021-03-15T17:01:12.147Z]  containerd:
[2021-03-15T17:01:12.147Z]   Version:          1.3.7
[2021-03-15T17:01:12.147Z]   GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
[2021-03-15T17:01:12.147Z]  runc:
[2021-03-15T17:01:12.147Z]   Version:          1.0.0-rc10
[2021-03-15T17:01:12.147Z]   GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
[2021-03-15T17:01:12.147Z]  docker-init:
[2021-03-15T17:01:12.147Z]   Version:          0.18.0
[2021-03-15T17:01:12.147Z]   GitCommit:        fec3683
[2021-03-15T17:01:12.147Z] Change ownership of all files inside the specific folder from root/root to current user/group
[2021-03-15T17:01:13.440Z] Change permissions with write access of all files inside the specific folder
[2021-03-15T17:01:13.937Z] Running in /var/lib/jenkins/workspace/PR-24520-3-dd250922-7f71-4abc-97a2-b1826d34183e
[2021-03-15T17:01:18.369Z] Failed in branch x-pack/elastic-agent-packaging-arm-arm
[2021-03-15T17:01:18.500Z] Stage "Packaging" skipped due to earlier failure(s)
[2021-03-15T17:01:18.544Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-24520/src/github.com/elastic/beats
[2021-03-15T17:01:18.785Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-24520
[2021-03-15T17:01:18.817Z] [INFO] getVaultSecret: Getting secrets
[2021-03-15T17:01:18.909Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-03-15T17:01:19.552Z] + chmod 755 generate-build-data.sh
[2021-03-15T17:01:19.552Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-24520/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-24520/runs/3 ABORTED 3763589
[2021-03-15T17:01:20.102Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-24520/runs/3/steps/?limit=10000 -o steps-info.json
[2021-03-15T17:01:21.013Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-24520/runs/3/tests/?status=FAILED -o tests-errors.json

@blakerouse blakerouse merged commit b66de85 into elastic:7.12 Mar 15, 2021
@blakerouse blakerouse deleted the backport_24489_7.12 branch March 15, 2021 17:59
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #24520 updated

  • Start Time: 2021-03-15T16:58:03.480+0000

  • Duration: 88 min 47 sec

  • Commit: 1c7296d

Test stats 🧪

Test Results
Failed 0
Passed 6532
Skipped 24
Total 6556

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 6532
Skipped 24
Total 6556

@zube zube bot removed the [zube]: Done label Jun 14, 2021
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
… Kibana. (elastic#24489) (elastic#24520)

* Add verification check when updating communication to Kibana.

* Add changelog.

* Add const.

(cherry picked from commit 5da3bd8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants