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 #18405 to 7.8: Cleaner output of inspect command #18579

Merged
merged 1 commit into from
May 17, 2020

Conversation

michalpristas
Copy link
Contributor

@michalpristas michalpristas commented May 15, 2020

Cherry-pick of PR #18405 to 7.8 branch. Original message:

What does this PR do?

Use of classic errors instead of custom type for inspect command. custom type is more suitable for logs where it carries call stack and error history here we just need an output displayed to user.

Why is it important?

call stack is confusing for user

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.

How to test

build agent and provide config with management.mode=fleet without enrolling. then run ./elastic-agent inspect
You should see error without call stack

Fixes: #18344

@elasticmachine
Copy link
Collaborator

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

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

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

Test stats 🧪

Test Results
Failed 0
Passed 1146
Skipped 181
Total 1327

Steps errors

Expand to view the steps failures

  • Name: Mage update build test
    • Description: mage update build test

    • Result: FAILURE

    • Duration: 7 min 21 sec

    • Start Time: 2020-05-15T13:58:20.836+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-05-15T14:51:04.234Z] + MSG='parameter missing.'
[2020-05-15T14:51:04.234Z] + TERRAFORM_VERSION=0.12.24
[2020-05-15T14:51:04.234Z] + HOME=/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579
[2020-05-15T14:51:04.234Z] + TERRAFORM_CMD=/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin/terraform
[2020-05-15T14:51:04.234Z] ++ uname -s
[2020-05-15T14:51:04.234Z] ++ tr '[:upper:]' '[:lower:]'
[2020-05-15T14:51:04.234Z] + OS=linux
[2020-05-15T14:51:04.234Z] + mkdir -p /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin
[2020-05-15T14:51:04.234Z] + curl -sSLo - https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip
[2020-05-15T14:51:05.186Z] ++ dirname /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin/terraform
[2020-05-15T14:51:05.187Z] + unzip -o /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin/terraform.zip -d /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin
[2020-05-15T14:51:05.187Z] Archive:  /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin/terraform.zip
[2020-05-15T14:51:05.449Z]   inflating: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin/terraform  
[2020-05-15T14:51:05.449Z] + rm /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin/terraform.zip
[2020-05-15T14:51:05.449Z] + chmod +x /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/bin/terraform
[2020-05-15T14:51:05.898Z] + make mage
[2020-05-15T14:51:05.898Z] Installing mage v1.9.0 from vendor dir.
[2020-05-15T14:51:06.852Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/.magefile cleaned
[2020-05-15T14:51:07.247Z] + git config --get user.email
[2020-05-15T14:51:07.248Z] + [ -z  ]
[2020-05-15T14:51:07.248Z] + git config user.email [email protected]
[2020-05-15T14:51:07.248Z] + git config user.name beatsmachine
[2020-05-15T14:51:07.721Z] + .ci/scripts/terraform-cleanup.sh x-pack/metricbeat
[2020-05-15T14:51:07.721Z] + DIRECTORY=x-pack/metricbeat
[2020-05-15T14:51:07.721Z] + FAILED=0
[2020-05-15T14:51:07.721Z] ++ find x-pack/metricbeat -name terraform.tfstate
[2020-05-15T14:51:07.722Z] + exit 0
[2020-05-15T14:51:08.211Z] + curl -sSLo codecov https://codecov.io/bash
[2020-05-15T14:51:08.481Z] + FILE=auditbeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f auditbeat/build/coverage/full.cov ]
[2020-05-15T14:51:08.481Z] + FILE=filebeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f filebeat/build/coverage/full.cov ]
[2020-05-15T14:51:08.481Z] + FILE=heartbeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f heartbeat/build/coverage/full.cov ]
[2020-05-15T14:51:08.481Z] + FILE=libbeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f libbeat/build/coverage/full.cov ]
[2020-05-15T14:51:08.481Z] + FILE=metricbeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f metricbeat/build/coverage/full.cov ]
[2020-05-15T14:51:08.481Z] + FILE=packetbeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-05-15T14:51:08.481Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-05-15T14:51:08.481Z] + FILE=journalbeat/build/coverage/full.cov
[2020-05-15T14:51:08.481Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-05-15T14:51:11.105Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats
[2020-05-15T14:51:11.472Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-05-15T14:51:11.509Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Lint
[2020-05-15T14:51:11.709Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-05-15T14:51:11.869Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Filebeat-x-pack
[2020-05-15T14:51:12.039Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-05-15T14:51:12.201Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-05-15T14:51:12.363Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-05-15T14:51:12.524Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-05-15T14:51:12.989Z] + cat
[2020-05-15T14:51:12.989Z] + /usr/local/bin/runbld ./runbld-script
[2020-05-15T14:51:12.989Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-05-15T14:51:19.599Z] runbld>>> runbld started
[2020-05-15T14:51:19.599Z] runbld>>> 1.6.11/a66728ff8f4356963772e6e6d2069392fa06acbe
[2020-05-15T14:51:21.005Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-18579' in order of occurrence in the config (last value wins).
[2020-05-15T14:51:22.392Z] runbld>>> Debug logging enabled.
[2020-05-15T14:51:22.392Z] runbld>>> Storing result
[2020-05-15T14:51:22.392Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-05-15T14:51:22.392Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200515145122-BF658C42
[2020-05-15T14:51:22.392Z] runbld>>> Adding system facts.
[2020-05-15T14:51:23.340Z] runbld>>> Adding vcs info for the latest commit:  868162d970c7b42876e2e0393ba2f5980cb803e8
[2020-05-15T14:51:23.913Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-05-15T14:51:23.913Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-05-15T14:51:23.913Z] Processing JUnit reports with runbld...
[2020-05-15T14:51:23.913Z] + echo 'Processing JUnit reports with runbld...'
[2020-05-15T14:51:24.179Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-05-15T14:51:24.179Z] runbld>>> DURATION: 14ms
[2020-05-15T14:51:24.179Z] runbld>>> STDOUT: 40 bytes
[2020-05-15T14:51:24.179Z] runbld>>> STDERR: 49 bytes
[2020-05-15T14:51:24.179Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-05-15T14:51:24.179Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats
[2020-05-15T14:51:25.565Z] runbld>>> Storing build metadata: 
[2020-05-15T14:51:25.566Z] runbld>>> Adding test report.
[2020-05-15T14:51:25.566Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats
[2020-05-15T14:51:26.508Z] runbld>>> Found 30 test output files
[2020-05-15T14:51:26.508Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-05-15T14:51:26.508Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-05-15T14:51:26.508Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-05-15T14:51:26.769Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-05-15T14:51:26.770Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-05-15T14:51:26.770Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-cloudfoundry.xml
[2020-05-15T14:51:27.031Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 1327 Skipped: 155
[2020-05-15T14:51:27.290Z] runbld>>> Storing result
[2020-05-15T14:51:27.290Z] runbld>>> FAILURES: 0
[2020-05-15T14:51:27.551Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-05-15T14:51:27.551Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200515145122-BF658C42
[2020-05-15T14:51:27.551Z] runbld>>> Email notification disabled by environment variable.
[2020-05-15T14:51:27.551Z] runbld>>> Slack notification disabled by environment variable.
[2020-05-15T14:51:33.192Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18579
[2020-05-15T14:51:33.375Z] [INFO] getVaultSecret: Getting secrets
[2020-05-15T14:51:33.445Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-05-15T14:51:34.386Z] + chmod 755 generate-build-data.sh
[2020-05-15T14:51:34.386Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18579/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18579/runs/1 FAILURE 4521981
[2020-05-15T14:51:35.298Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18579/runs/1/steps/?limit=10000 -o steps-info.json
[2020-05-15T14:51:38.008Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18579/runs/1/tests/?status=FAILED -o tests-errors.json
[2020-05-15T14:51:38.008Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18579/runs/1/log/ -o pipeline-log.txt

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Backport looks good.

@michalpristas michalpristas merged commit c4bb9b2 into elastic:7.8 May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport enhancement Ingest Management:alpha1 Group issues for ingest management alpha1 review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants