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

[Metricbeat] Check if fields in DBInstance struct is nil #13294

Merged
merged 3 commits into from
Aug 23, 2019
Merged

[Metricbeat] Check if fields in DBInstance struct is nil #13294

merged 3 commits into from
Aug 23, 2019

Conversation

kaiyan-sheng
Copy link
Contributor

When metricbeat is running with aws rds metricset enabled, create a new rds instance and this error showed up:

2019-08-20T15:03:02.210-0600    ERROR   runtime/panic.go:82     recovered from panic while fetching 'aws/rds' for host ''. Recovering, but please report this.  {"panic": "runtime error: invalid memory address or nil pointer dereference", "stack": "github.com/elastic/beats/libbeat/logp.Recover\n\t/Users/kaiyansheng/go/src/github.com/elastic/beats/libbeat/logp/global.go:105\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:522\nruntime.panicmem\n\t/usr/local/go/src/runtime/panic.go:82\nruntime.sigpanic\n\t/usr/local/go/src/runtime/signal_unix.go:390\ngithub.com/elastic/beats/x-pack/metricbeat/module/aws/rds.getDBInstancesPerRegion\n\t/Users/kaiyansheng/go/src/github.com/elastic/beats/x-pack/metricbeat/module/aws/rds/rds.go:165\ngithub.com/elastic/beats/x-pack/metricbeat/module/aws/rds.(*MetricSet).Fetch\n\t/Users/kaiyansheng/go/src/github.com/elastic/beats/x-pack/metricbeat/module/aws/rds/rds.go:88\ngithub.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).fetch\n\t/Users/kaiyansheng/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:244\ngithub.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).startPeriodicFetching\n\t/Users/kaiyansheng/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:212\ngithub.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).run\n\t/Users/kaiyansheng/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:199\ngithub.com/elastic/beats/metricbeat/mb/module.(*Wrapper).Start.func1\n\t/Users/kaiyansheng/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:138"}

When a new RDS instance is still in creating state, it has an arn but not AvailabilityZone yet. That's why this invalid memory address or nil pointer dereference error shows up.

closes #13037

@kaiyan-sheng kaiyan-sheng requested a review from a team as a code owner August 20, 2019 22:05
@kaiyan-sheng kaiyan-sheng self-assigned this Aug 20, 2019
@kaiyan-sheng
Copy link
Contributor Author

jenkins, test this please

@jsoriano jsoriano added needs_backport PR is waiting to be backported to other branches. v7.3.2 v7.4.0 labels Aug 23, 2019
@kaiyan-sheng kaiyan-sheng merged commit 6a7be07 into elastic:master Aug 23, 2019
@kaiyan-sheng kaiyan-sheng deleted the rds_nil branch August 23, 2019 14:21
kaiyan-sheng added a commit that referenced this pull request Aug 23, 2019
…e struct is nil (#13333)

* [Metricbeat] Check if fields in DBInstance struct is nil (#13294)
@kaiyan-sheng kaiyan-sheng added test-plan Add this PR to be manual test plan and removed needs_backport PR is waiting to be backported to other branches. v7.3.2 v7.4.0 labels Aug 26, 2019
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…Instance struct is nil (elastic#13333)

* [Metricbeat] Check if fields in DBInstance struct is nil (elastic#13294)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Metricbeat Metricbeat review Team:Integrations Label for the Integrations team test-plan Add this PR to be manual test plan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metricbeat] invalid memory address or nil pointer error for rds metricset
3 participants