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 #18365 to 7.x: [Fleet] Fix agent enrollment script to not create a new enrollment token #18488

Merged
merged 1 commit into from
May 14, 2020

Conversation

nchaulet
Copy link
Member

Cherry-pick of PR #18365 to 7.x branch. Original message:

Description

This script is creating a new enrollment token associated to a non existing config (default is not a valid id, the id of the default config is a random uuid)

I updated this script to get the default enrollment token created during fleet setup instead.

Related to elastic/kibana#65669

Also created an issue on kibana elastic/kibana#65752 to not allow the creation of an enrollment token for a non existing agent config id.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 13, 2020
@nchaulet nchaulet added Team:Ingest Management and removed needs_team Indicates that the issue/PR needs a Team:* label labels May 13, 2020
@elasticmachine
Copy link
Collaborator

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

@nchaulet nchaulet requested a review from michalpristas May 13, 2020 16:42
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 13, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Started by user Michal Pristas, Replayed I can't install packetbeat #1]

  • Start Time: 2020-05-14T05:55:45.544+0000

  • Duration: 103 min 26 sec (6205576)

Test stats 🧪

Test Results
Failed 0
Passed 5779
Skipped 894
Total 6673

Steps errors

Expand to view the steps failures

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Result: FAILURE

    • Duration: 2 min 23 sec

    • Start Time: 2020-05-14T06:19:14.810+0000

    • log

  • Name: Make -C libbeat testsuite

    • Description: make -C libbeat testsuite

    • Result: FAILURE

    • Duration: 28 min 47 sec

    • Start Time: 2020-05-14T06:29:30.958+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-05-14T07:38:44.421Z] + FAILED=0
[2020-05-14T07:38:44.421Z] ++ find x-pack/metricbeat -name terraform.tfstate
[2020-05-14T07:38:44.421Z] + exit 0
[2020-05-14T07:38:44.790Z] + curl -sSLo codecov https://codecov.io/bash
[2020-05-14T07:38:45.058Z] + FILE=auditbeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f auditbeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.058Z] + FILE=filebeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f filebeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.058Z] + FILE=heartbeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f heartbeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.058Z] + FILE=libbeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f libbeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.058Z] + FILE=metricbeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f metricbeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.058Z] + FILE=packetbeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.058Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.058Z] + FILE=journalbeat/build/coverage/full.cov
[2020-05-14T07:38:45.058Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-05-14T07:38:45.498Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats
[2020-05-14T07:38:45.900Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-05-14T07:38:45.919Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Lint
[2020-05-14T07:38:46.009Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-05-14T07:38:46.090Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-05-14T07:38:46.181Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Winlogbeat-oss
[2020-05-14T07:38:46.270Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Dockerlogbeat
[2020-05-14T07:38:46.337Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Heartbeat-oss
[2020-05-14T07:38:46.406Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Journalbeat-oss
[2020-05-14T07:38:46.478Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-05-14T07:38:46.552Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-05-14T07:38:46.623Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-05-14T07:38:46.705Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Filebeat-Windows
[2020-05-14T07:38:46.778Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-05-14T07:38:46.857Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Auditbeat-Linux
[2020-05-14T07:38:46.927Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-05-14T07:38:46.995Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-Windows
[2020-05-14T07:38:47.061Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-05-14T07:38:47.127Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Libbeat-x-pack
[2020-05-14T07:38:47.190Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Filebeat-x-pack
[2020-05-14T07:38:47.255Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Packetbeat-oss
[2020-05-14T07:38:47.320Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-05-14T07:38:47.383Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-05-14T07:38:47.447Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Libbeat-oss
[2020-05-14T07:38:47.510Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Filebeat-oss
[2020-05-14T07:38:47.571Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-05-14T07:38:47.636Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Heartbeat-Windows
[2020-05-14T07:38:47.698Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Auditbeat-Windows
[2020-05-14T07:38:47.759Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Functionbeat-Windows
[2020-05-14T07:38:47.822Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-05-14T07:38:47.884Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-05-14T07:38:47.948Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-05-14T07:38:48.299Z] + cat
[2020-05-14T07:38:48.299Z] + /usr/local/bin/runbld ./runbld-script
[2020-05-14T07:38:48.299Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-05-14T07:38:54.920Z] runbld>>> runbld started
[2020-05-14T07:38:54.920Z] runbld>>> 1.6.11/a66728ff8f4356963772e6e6d2069392fa06acbe
[2020-05-14T07:38:56.848Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-18488' in order of occurrence in the config (last value wins).
[2020-05-14T07:38:58.241Z] runbld>>> Debug logging enabled.
[2020-05-14T07:38:58.241Z] runbld>>> Storing result
[2020-05-14T07:38:58.505Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-05-14T07:38:58.505Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200514073858-99B63BF8
[2020-05-14T07:38:58.505Z] runbld>>> Adding system facts.
[2020-05-14T07:38:59.455Z] runbld>>> Adding vcs info for the latest commit:  23846f7845430d9277b9419a0fa12edc00d90efc
[2020-05-14T07:38:59.455Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-05-14T07:38:59.455Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-05-14T07:38:59.455Z] Processing JUnit reports with runbld...
[2020-05-14T07:38:59.455Z] + echo 'Processing JUnit reports with runbld...'
[2020-05-14T07:39:00.032Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-05-14T07:39:00.032Z] runbld>>> DURATION: 28ms
[2020-05-14T07:39:00.032Z] runbld>>> STDOUT: 40 bytes
[2020-05-14T07:39:00.032Z] runbld>>> STDERR: 49 bytes
[2020-05-14T07:39:00.032Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-05-14T07:39:00.032Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats
[2020-05-14T07:39:01.427Z] runbld>>> Storing build metadata: 
[2020-05-14T07:39:01.427Z] runbld>>> Adding test report.
[2020-05-14T07:39:01.427Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats
[2020-05-14T07:39:02.378Z] runbld>>> Found 92 test output files
[2020-05-14T07:39:02.954Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-05-14T07:39:02.954Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-05-14T07:39:02.954Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-05-14T07:39:02.954Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-05-14T07:39:02.954Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-05-14T07:39:02.954Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-cloudfoundry.xml
[2020-05-14T07:39:03.531Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-05-14T07:39:03.531Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-05-14T07:39:03.795Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 6523 Skipped: 703
[2020-05-14T07:39:04.058Z] runbld>>> Storing result
[2020-05-14T07:39:04.058Z] runbld>>> FAILURES: 0
[2020-05-14T07:39:04.321Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-05-14T07:39:04.321Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200514073858-99B63BF8
[2020-05-14T07:39:04.321Z] runbld>>> Email notification disabled by environment variable.
[2020-05-14T07:39:04.321Z] runbld>>> Slack notification disabled by environment variable.
[2020-05-14T07:39:10.302Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18488
[2020-05-14T07:39:10.577Z] [INFO] getVaultSecret: Getting secrets
[2020-05-14T07:39:10.623Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-05-14T07:39:11.391Z] + chmod 755 generate-build-data.sh
[2020-05-14T07:39:11.392Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18488/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18488/runs/2 FAILURE 6205576
[2020-05-14T07:39:11.942Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18488/runs/2/steps/?limit=10000 -o steps-info.json
[2020-05-14T07:39:12.854Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18488/runs/2/tests/?status=FAILED -o tests-errors.json

@ph
Copy link
Contributor

ph commented May 13, 2020

jenkins test this please

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks correct, let's see CI, you can ignore obviously unrelated tests

@nchaulet nchaulet merged commit 0c7557a into elastic:7.x May 14, 2020
@nchaulet nchaulet deleted the backport_18365_7.x branch May 14, 2020 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants