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

[Filebeat] Fix checkpoint #21344

Merged
merged 24 commits into from
Sep 29, 2020
Merged

[Filebeat] Fix checkpoint #21344

merged 24 commits into from
Sep 29, 2020

Conversation

marc-gr
Copy link
Contributor

@marc-gr marc-gr commented Sep 28, 2020

Re-opening of #20567, thanks @Bernhard-Fluehmann for the original work!

Original PR message:

What does this PR do?

Resolves conflicting set of timestamp field

Why is it important?

Some Checkpoint logs contain a time field and the pipeline contained a processor for it. As far as I can see the current implementation causes two errors. 1st the presence of a time field breaks the pipeline since the logs received from filebeat contain a timestamp already. 2nd problem is that the format of the time field is unix time and thus needs to be converted into a iso timestamp first.
The reason why the problem was not detected by the testsuite seems to be that none of the logs of the checkpoint.log file contains the time field. I have added such a log line at the end now.

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

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 28, 2020
@marc-gr marc-gr changed the title Fix checkpoint [Filebeat] Fix checkpoint Sep 28, 2020
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 28, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@marc-gr marc-gr requested a review from a team September 28, 2020 12:40
@marc-gr marc-gr added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 28, 2020
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 28, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 28, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #21344 updated]

  • Start Time: 2020-09-28T14:11:06.339+0000

  • Duration: 85 min 18 sec

Test stats 🧪

Test Results
Failed 0
Passed 20288
Skipped 1858
Total 22146

Steps errors

Expand to view the steps failures

  • Name: Archive the artifacts

    • Description: [2020-09-28T15:36:02.057Z] Archiving artifacts
      [2020-09-28T15:36:02.079Z] ‘build-reasons/*.md’

    • Duration: 0 min 0 sec

    • Start Time: 2020-09-28T15:36:02.050+0000

    • log

  • Name: Process JUnit reports with runbld

    • Description:

    • Duration: 0 min 18 sec

    • Start Time: 2020-09-28T15:36:04.276+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-09-28T15:35:58.469Z]   Version:          1.3.7
[2020-09-28T15:35:58.469Z]   GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
[2020-09-28T15:35:58.469Z]  runc:
[2020-09-28T15:35:58.469Z]   Version:          1.0.0-rc10
[2020-09-28T15:35:58.469Z]   GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
[2020-09-28T15:35:58.469Z]  docker-init:
[2020-09-28T15:35:58.469Z]   Version:          0.18.0
[2020-09-28T15:35:58.469Z]   GitCommit:        fec3683
[2020-09-28T15:36:02.023Z] Post stage
[2020-09-28T15:36:02.039Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats
[2020-09-28T15:36:02.057Z] Archiving artifacts
[2020-09-28T15:36:02.079Z] ‘build-reasons/*.md’ doesn’t match anything: even ‘build-reasons’ doesn’t exist
[2020-09-28T15:36:02.100Z] Error when executing always post condition:
[2020-09-28T15:36:02.106Z] hudson.AbortException: No artifacts found that match the file pattern "build-reasons/*.md". Configuration error?
[2020-09-28T15:36:02.106Z] 	at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:280)
[2020-09-28T15:36:02.106Z] 	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:91)
[2020-09-28T15:36:02.106Z] 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
[2020-09-28T15:36:02.106Z] 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
[2020-09-28T15:36:02.106Z] 	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
[2020-09-28T15:36:02.106Z] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2020-09-28T15:36:02.106Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-09-28T15:36:02.106Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-09-28T15:36:02.106Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-09-28T15:36:02.106Z] 	at java.lang.Thread.run(Thread.java:748)
[2020-09-28T15:36:02.106Z] 
[2020-09-28T15:36:02.248Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats
[2020-09-28T15:36:02.258Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/uncategorized-1601303657699
[2020-09-28T15:36:02.290Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/libbeat-stress-tests-1601303902885
[2020-09-28T15:36:02.321Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/auditbeat-macos-macosx-1601303955982
[2020-09-28T15:36:02.355Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/winlogbeat-crosscompile-1601303976719
[2020-09-28T15:36:02.386Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/generator-macos-metricbeat-macosx-1601303988177
[2020-09-28T15:36:02.418Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-elastic-agent-build-1601303997896
[2020-09-28T15:36:02.458Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/generator-macos-beat-macosx-1601304023713
[2020-09-28T15:36:02.495Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/heartbeat-macos-macosx-1601304031266
[2020-09-28T15:36:02.533Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/journalbeat-unitTest-1601304031929
[2020-09-28T15:36:02.566Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/auditbeat-crosscompile-1601304041758
[2020-09-28T15:36:02.604Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-dockerlogbeat-build-1601304045657
[2020-09-28T15:36:02.636Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-functionbeat-build-1601304091904
[2020-09-28T15:36:02.672Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/metricbeat-macos-macosx-1601304108399
[2020-09-28T15:36:02.711Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-elastic-agent-macos-macosx-1601304137665
[2020-09-28T15:36:02.749Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-auditbeat-macos-macosx-1601304145258
[2020-09-28T15:36:02.790Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/libbeat-crosscompile-1601304172631
[2020-09-28T15:36:02.822Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/packetbeat-build-1601304216004
[2020-09-28T15:36:02.862Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/metricbeat-unitTest-1601304254415
[2020-09-28T15:36:02.897Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-elastic-agent-windows-windows-2019-1601304267728
[2020-09-28T15:36:02.940Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-filebeat-macos-macosx-1601304276450
[2020-09-28T15:36:02.982Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/heartbeat-build-1601304375233
[2020-09-28T15:36:03.022Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-auditbeat-windows-windows-2019-1601304400229
[2020-09-28T15:36:03.067Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-auditbeat-build-1601304418071
[2020-09-28T15:36:03.118Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/auditbeat-windows-windows-2019-1601304427538
[2020-09-28T15:36:03.158Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-metricbeat-macos-macosx-1601304432399
[2020-09-28T15:36:03.194Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/auditbeat-build-1601304445704
[2020-09-28T15:36:03.232Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-functionbeat-macos-macosx-1601304447295
[2020-09-28T15:36:03.271Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/heartbeat-windows-windows-2019-1601304450363
[2020-09-28T15:36:03.312Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-winlogbeat-build-windows-2019-1601304475301
[2020-09-28T15:36:03.356Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/winlogbeat-windows-windows-2019-1601304486880
[2020-09-28T15:36:03.395Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/generator-metricbeat-test-1601304522838
[2020-09-28T15:36:03.439Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-libbeat-build-1601304533187
[2020-09-28T15:36:03.545Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/metricbeat-crosscompile-1601304540562
[2020-09-28T15:36:03.584Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/filebeat-windows-windows-2019-1601304541655
[2020-09-28T15:36:03.643Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-filebeat-windows-windows-2019-1601304552149
[2020-09-28T15:36:03.682Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-functionbeat-windows-windows-2019-1601304566275
[2020-09-28T15:36:03.722Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/generator-beat-test-1601304573423
[2020-09-28T15:36:03.761Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/filebeat-macos-macosx-1601304590688
[2020-09-28T15:36:03.798Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/packetbeat-windows-windows-2019-1601304684451
[2020-09-28T15:36:03.836Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-metricbeat-windows-windows-2019-1601304712265
[2020-09-28T15:36:03.881Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/metricbeat-windows-windows-2019-1601304734611
[2020-09-28T15:36:03.926Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/packetbeat-macos-macosx-1601304991632
[2020-09-28T15:36:03.981Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/filebeat-build-1601305291629
[2020-09-28T15:36:04.028Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/libbeat-build-1601305510817
[2020-09-28T15:36:04.084Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-filebeat-build-1601305769386
[2020-09-28T15:36:04.132Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/metricbeat-goIntegTest-1601305818707
[2020-09-28T15:36:04.180Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/metricbeat-pythonIntegTest-1601306009817
[2020-09-28T15:36:04.216Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats/x-pack-metricbeat-build-1601307065271
[2020-09-28T15:36:04.568Z] + cat
[2020-09-28T15:36:04.568Z] + /usr/local/bin/runbld ./runbld-test-reports --job-name elastic+beats+pull-request
[2020-09-28T15:36:04.568Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-09-28T15:36:11.160Z] runbld>>> runbld started
[2020-09-28T15:36:11.160Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-09-28T15:36:12.308Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-09-28T15:36:12.308Z] runbld>>> Matches in the system config:
[2020-09-28T15:36:12.308Z] runbld>>> - Matched ^elastic\+beats
[2020-09-28T15:36:12.308Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-09-28T15:36:13.694Z] runbld>>> Debug logging enabled.
[2020-09-28T15:36:13.694Z] runbld>>> Storing result
[2020-09-28T15:36:13.953Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-09-28T15:36:13.953Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200928153613-A0D87E19
[2020-09-28T15:36:13.953Z] runbld>>> Adding system facts.
[2020-09-28T15:36:15.115Z] runbld>>> Sending debug log to infra-root+runbld-debug@e***.co
[2020-09-28T15:36:16.505Z] runbld>>> Error: The source clone was not found in /var/lib/jenkins/workspace/Beats_beats_PR-21344/src/github.com/elastic/beats.  The most common cause is that Jenkins and runbld are configured with different working directories (referred to as 'basedir' in JJB and 'cwd' in runbld config).
[2020-09-28T15:36:21.802Z] ERROR: runbld post build action failed.
[2020-09-28T15:36:21.802Z] ERROR: script returned exit code 1
[2020-09-28T15:36:22.845Z] Running on worker-1244230 in /var/lib/jenkins/workspace/Beats_beats_PR-21344
[2020-09-28T15:36:22.873Z] [INFO] getVaultSecret: Getting secrets
[2020-09-28T15:36:22.958Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-09-28T15:36:25.806Z] + chmod 755 generate-build-data.sh
[2020-09-28T15:36:25.807Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21344/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21344/runs/2 FAILURE 5118062
[2020-09-28T15:36:25.807Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21344/runs/2/steps/?limit=10000 -o steps-info.json
[2020-09-28T15:36:32.195Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21344/runs/2/tests/?status=FAILED -o tests-errors.json
[2020-09-28T15:36:32.195Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21344/runs/2/log/ -o pipeline-log.txt

Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

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

LGTM

@marc-gr marc-gr merged commit 452c6d2 into elastic:master Sep 29, 2020
@marc-gr marc-gr deleted the fix-checkpoint branch September 29, 2020 08:42
marc-gr added a commit to marc-gr/beats that referenced this pull request Sep 29, 2020
* fix checkpoint @timestamp already exists

* Fix checkpoint @timestamp already existing, test logs

* testfile

* Updated CHANGELOG

* fix ASCIIDOC

* remove timestamp renaming since it produced strange error messages about too much compiled scrips

* reenable tiemestamp rename

* move comment in asciidoc to bugfixes

* move comment in asciidoc to bugfixes

* fix asciidoc

* fix asciidoc

* fix tes log

* remove empty lines

* Fix pipeline and re generate test files

* Reorder changelog entry

Co-authored-by: bernhard.fluehmann <bernhard.fluehmann@realstuff.ch>
(cherry picked from commit 452c6d2)
v1v added a commit to v1v/beats that referenced this pull request Sep 29, 2020
* upstream/master:
  feat: prepare release pipelines (elastic#21238)
  Add IP validation to Security module (elastic#21325)
  Fixes for new 7.10 rsa2elk datasets (elastic#21240)
  o365input: Restart after fatal error (elastic#21258)
  Fix panic in cgroups monitoring (elastic#21355)
  Handle multiple upstreams in ingress-controller (elastic#21215)
  [CI] Fix runbld when workspace does not exist (elastic#21350)
  [Filebeat] Fix checkpoint (elastic#21344)
  [CI] Archive build reasons (elastic#21347)
  Add dashboard for pubsub metricset in googlecloud module (elastic#21326)
  [Elastic Agent] Allow embedding of certificate (elastic#21179)
  Adds a default for failure_cache.min_ttl (elastic#21085)
  [libbeat] Disk queue implementation (elastic#21176)
marc-gr added a commit that referenced this pull request Sep 30, 2020
* fix checkpoint @timestamp already exists

* Fix checkpoint @timestamp already existing, test logs

* testfile

* Updated CHANGELOG

* fix ASCIIDOC

* remove timestamp renaming since it produced strange error messages about too much compiled scrips

* reenable tiemestamp rename

* move comment in asciidoc to bugfixes

* move comment in asciidoc to bugfixes

* fix asciidoc

* fix asciidoc

* fix tes log

* remove empty lines

* Fix pipeline and re generate test files

* Reorder changelog entry

Co-authored-by: bernhard.fluehmann <bernhard.fluehmann@realstuff.ch>
(cherry picked from commit 452c6d2)
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.

[Filebeat][Checkpoint module] field [@timestamp] already exists
4 participants