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 vsphere/virtualmachine crash #18996

Closed
adriansr opened this issue Jun 5, 2020 · 1 comment · Fixed by #19078
Closed

Metricbeat vsphere/virtualmachine crash #18996

adriansr opened this issue Jun 5, 2020 · 1 comment · Fixed by #19078
Assignees
Labels
bug help wanted Indicates that a maintainer wants help on an issue or pull request Metricbeat Metricbeat Team:Integrations Label for the Integrations team

Comments

@adriansr
Copy link
Contributor

adriansr commented Jun 5, 2020

For confirmed bugs, please report:

  • Version: 7.7.0
  • Operating System: n/a
  • Discuss Forum URL: n/a
  • Steps to Reproduce:

For some users the vSphere module is crashing randomly with:

runtime error: invalid memory address or nil pointer dereference
github.com/elastic/beats/v7/libbeat/logp.Recover
	/go/src/github.com/elastic/beats/libbeat/logp/global.go:101
runtime.gopanic
	/usr/local/go/src/runtime/panic.go:679
runtime.panicmem
	/usr/local/go/src/runtime/panic.go:199
runtime.sigpanic
	/usr/local/go/src/runtime/signal_windows.go:233
github.com/elastic/beats/v7/metricbeat/module/vsphere/virtualmachine.(*MetricSet).Fetch
	/go/src/github.com/elastic/beats/metricbeat/module/vsphere/virtualmachine/virtualmachine.go:175
github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).fetch
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:263
github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).startPeriodicFetching
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:224
github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).run
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:208
github.com/elastic/beats/v7/metricbeat/mb/module.(*Wrapper).Start.func1
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:147

These is the location of the invalid memory access (line 175):

if vm.Summary.Runtime.Host != nil {
event["host.id"] = vm.Summary.Runtime.Host.Value
} else {
m.Logger().Debug("'Host', 'Runtime' or 'Summary' data not found. This is either a parsing error " +
"from vsphere library, an error trying to reach host/guest or incomplete information returned " +
"from host/guest")
}
hostSystem, err := getHostSystem(ctx, c, vm.Summary.Runtime.Host.Reference())

Looks to me like the access to vm.Summary.Runtime.Host.Reference should be done inside the != nil check in line 167. Alternatively the (debug) log message in 170 suggests that maybe processing should be terminated if .Host is nil.

@adriansr adriansr added bug help wanted Indicates that a maintainer wants help on an issue or pull request Metricbeat Metricbeat Team:Integrations Label for the Integrations team labels Jun 5, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Indicates that a maintainer wants help on an issue or pull request Metricbeat Metricbeat Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants