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

Adds a default for failure_cache.min_ttl #21085

Merged

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Sep 14, 2020

What does this PR do?

It adds a default value for the failure_cache.min_ttl setting added in #18986. The default value is the same as that for the success_cache.min_ttl setting.

Why is it important?

As reported in https://discuss.elastic.co/t/fail-to-unpack-the-dns-configuration-requires-duration-1-accessing-processors-0-dns-min-ttl/248453/1, before the change in this PR, when a user configures the DNS processor minimally like so:

processors:
- dns:
    type: reverse

The following error is thrown:

Exiting: error initializing processors: fail to unpack the dns configuration: requires duration < 1 accessing 'processors.0.dns.min_ttl'

Resolves #21103.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 14, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 14, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 14, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #21085 updated]

  • Start Time: 2020-09-17T09:29:58.578+0000

  • Duration: 73 min 47 sec

Test stats 🧪

Test Results
Failed 3
Passed 20105
Skipped 1834
Total 21942

Test errors

Expand to view the tests failures

  • Name: Build and Test / Libbeat / Libbeat oss / TestReplaceClientWorker – pipeline

    • Age: 1
    • Duration: 25.94
    • Error Details: Failed
  • Name: Build and Test / Libbeat / Libbeat oss / TestReplaceClientWorker/network_client – pipeline

    • Age: 1
    • Duration: 22.76
    • Error Details: Failed
  • Name: Build and Test / Filebeat oss / test_default_settings – filebeat.tests.system.test_autodiscover.TestAutodiscover

    • Age: 1
    • Duration: 90.003
    • Error Details: Failed: Timeout >90.0s

Steps errors

Expand to view the steps failures

  • Name: Mage build test

    • Description: mage build test

    • Duration: 26 min 2 sec

    • Start Time: 2020-09-17T09:56:00.576+0000

    • log

  • Name: Mage build test

    • Description: mage build test

    • Duration: 22 min 56 sec

    • Start Time: 2020-09-17T09:56:07.336+0000

    • log

  • Name: Make test-package

    • Description: make -C generator/_templates/beat test-package

    • Duration: 4 min 19 sec

    • Start Time: 2020-09-17T10:20:18.276+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-09-17T10:41:15.298Z] + tar --version
[2020-09-17T10:41:15.612Z] + tar -xpf source.tgz
[2020-09-17T10:41:28.179Z] + rm source.tgz
[2020-09-17T10:41:28.193Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats
[2020-09-17T10:41:28.216Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Lint
[2020-09-17T10:41:28.306Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-09-17T10:41:28.386Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Winlogbeat-oss
[2020-09-17T10:41:28.467Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-09-17T10:41:28.547Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-09-17T10:41:28.627Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-09-17T10:41:28.708Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-09-17T10:41:28.787Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/dockerlogbeat
[2020-09-17T10:41:28.866Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-09-17T10:41:28.943Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-09-17T10:41:29.023Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Journalbeat
[2020-09-17T10:41:29.104Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Packetbeat-Linux
[2020-09-17T10:41:29.182Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-09-17T10:41:29.262Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-09-17T10:41:29.341Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-09-17T10:41:29.422Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-09-17T10:41:29.505Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-09-17T10:41:29.740Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-09-17T10:41:29.819Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-09-17T10:41:29.899Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Heartbeat-oss
[2020-09-17T10:41:29.978Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Packetbeat-Mac-OS-X
[2020-09-17T10:41:30.058Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-09-17T10:41:30.138Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-09-17T10:41:30.219Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Heartbeat-Windows
[2020-09-17T10:41:30.298Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-09-17T10:41:30.377Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-09-17T10:41:30.456Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-09-17T10:41:30.535Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-09-17T10:41:30.615Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Libbeat-x-pack
[2020-09-17T10:41:30.696Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Generators-Beat-Mac-OS-X
[2020-09-17T10:41:30.777Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Filebeat-Windows
[2020-09-17T10:41:30.859Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-09-17T10:41:30.939Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-09-17T10:41:31.019Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-09-17T10:41:31.101Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Packetbeat-Windows
[2020-09-17T10:41:31.180Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-09-17T10:41:31.260Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-Windows
[2020-09-17T10:41:31.339Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-09-17T10:41:31.418Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Functionbeat-Windows
[2020-09-17T10:41:31.498Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Libbeat-oss
[2020-09-17T10:41:31.598Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-09-17T10:41:31.680Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Filebeat-oss
[2020-09-17T10:41:31.759Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Filebeat-x-pack
[2020-09-17T10:41:31.839Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-OSS-Python-Integration-tests
[2020-09-17T10:41:31.919Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests
[2020-09-17T10:41:32.000Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-09-17T10:41:32.403Z] + cat
[2020-09-17T10:41:32.404Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-09-17T10:41:32.404Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-09-17T10:41:39.029Z] runbld>>> runbld started
[2020-09-17T10:41:39.030Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-09-17T10:41:41.585Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-09-17T10:41:41.585Z] runbld>>> Matches in the system config:
[2020-09-17T10:41:41.585Z] runbld>>> - Matched ^elastic\+beats
[2020-09-17T10:41:41.585Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-09-17T10:41:42.530Z] runbld>>> Debug logging enabled.
[2020-09-17T10:41:42.530Z] runbld>>> Storing result
[2020-09-17T10:41:42.792Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-09-17T10:41:42.792Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200917104142-46A17328
[2020-09-17T10:41:42.792Z] runbld>>> Adding system facts.
[2020-09-17T10:41:43.746Z] runbld>>> Adding vcs info for the latest commit:  c7e967b200dfec1cafe01bececeaf70a7c72c908
[2020-09-17T10:41:43.746Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-09-17T10:41:43.746Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-09-17T10:41:43.746Z] Processing JUnit reports with runbld...
[2020-09-17T10:41:43.746Z] + echo 'Processing JUnit reports with runbld...'
[2020-09-17T10:41:44.329Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-09-17T10:41:44.329Z] runbld>>> DURATION: 28ms
[2020-09-17T10:41:44.329Z] runbld>>> STDOUT: 40 bytes
[2020-09-17T10:41:44.329Z] runbld>>> STDERR: 49 bytes
[2020-09-17T10:41:44.329Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-09-17T10:41:44.329Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-21085
[2020-09-17T10:41:45.277Z] runbld>>> Storing build metadata: 
[2020-09-17T10:41:45.277Z] runbld>>> Adding test report.
[2020-09-17T10:41:45.277Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats
[2020-09-17T10:41:45.851Z] runbld>>> Found 139 test output files
[2020-09-17T10:41:47.774Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-09-17T10:41:47.775Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-09-17T10:41:47.775Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-09-17T10:41:47.775Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-09-17T10:41:47.775Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-09-17T10:42:44.091Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-09-17T10:42:44.091Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-21085/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-09-17T10:42:44.091Z] runbld>>> Test output logs contained: Errors: 0 Failures: 3 Tests: 21789 Skipped: 1561
[2020-09-17T10:42:44.091Z] runbld>>> Storing result
[2020-09-17T10:42:44.091Z] runbld>>> FAILURES: 3
[2020-09-17T10:42:44.091Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-09-17T10:42:44.091Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200917104142-46A17328
[2020-09-17T10:42:44.091Z] runbld>>> Email notification disabled by environment variable.
[2020-09-17T10:42:44.091Z] runbld>>> Slack notification disabled by environment variable.
[2020-09-17T10:42:44.843Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-21085
[2020-09-17T10:42:44.955Z] [INFO] getVaultSecret: Getting secrets
[2020-09-17T10:42:45.040Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-09-17T10:42:45.810Z] + chmod 755 generate-build-data.sh
[2020-09-17T10:42:45.810Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21085/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21085/runs/3 FAILURE 4366969
[2020-09-17T10:42:45.810Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21085/runs/3/steps/?limit=10000 -o steps-info.json
[2020-09-17T10:42:48.293Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-21085/runs/3/tests/?status=FAILED -o tests-errors.json

@adriansr
Copy link
Contributor

@ycombinator by looking at the linked discuss case I'm not sure if this PR is sufficient for the fix.

I've had to add the following changes:

diff --git a/libbeat/processors/dns/config.go b/libbeat/processors/dns/config.go
index 9c430a8845..ad9809325d 100644
--- a/libbeat/processors/dns/config.go
+++ b/libbeat/processors/dns/config.go
@@ -29,7 +29,7 @@ import (

 // Config defines the configuration options for the DNS processor.
 type Config struct {
-       CacheConfig
+       CacheConfig  `config:",inline"`
        Nameservers  []string      `config:"nameservers"`              // Required on Windows. /etc/resolv.conf is used if none are given.
        Timeout      time.Duration `conifg:"timeout"`                  // Per request timeout (with 2 nameservers the total timeout would be 2x).
        Type         string        `config:"type" validate:"required"` // Reverse is the only supported type currently.
@@ -89,7 +89,7 @@ type CacheSettings struct {
        TTL time.Duration `config:"ttl"`

        // Minimum TTL value for successful DNS responses.
-       MinTTL time.Duration `config:"min_ttl" validate:"min=1"`
+       MinTTL time.Duration `config:"min_ttl" validate:"min=1ns"`

        // Initial capacity. How much space is allocated at initialization.
        InitialCapacity int `config:"capacity.initial" validate:"min=0"`

@ycombinator
Copy link
Contributor Author

Hey @adriansr, yes, you're right — I misunderstood the original discuss post (see recent comments there). The discuss post author created #21103, which your patch addresses. I will apply your patch to my PR here now. Thanks!

@ycombinator ycombinator force-pushed the lb-processors-dns-min-ttl-default branch from e17c1a1 to c7e967b Compare September 17, 2020 09:28
@andrewkroh andrewkroh merged commit ddfe085 into elastic:master Sep 28, 2020
@andrewkroh andrewkroh removed the needs_backport PR is waiting to be backported to other branches. label Sep 28, 2020
andrewkroh pushed a commit to andrewkroh/beats that referenced this pull request Sep 28, 2020
* Adds a default for failure_cache.min_ttl

* Parse YAML as inline + fix default value

Fixes elastic#21103

Co-authored-by: Adrian Serrano <adrisr83@gmail.com>
(cherry picked from commit ddfe085)
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)
andrewkroh added a commit that referenced this pull request Oct 1, 2020
* Adds a default for failure_cache.min_ttl

* Parse YAML as inline + fix default value

Fixes #21103

Co-authored-by: Adrian Serrano <adrisr83@gmail.com>
(cherry picked from commit ddfe085)

Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
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.

Packetbeat: DNS processor configuration parsing error
4 participants