Skip to content

Conversation

schmikei
Copy link
Contributor

Description

I believe that this should be the only nullable field improperly accessed within this file.

// The ConfigInfo data object type encapsulates the configuration settings and
// virtual hardware for a virtual machine.
//
// This type holds all the information
// that is present in the .vmx configuration file for the virtual machine.
type VirtualMachineConfigInfo struct {

I'm thinking users may have created a machine and attached the vmdk to it and thats may be the potential cause?

Either way this should resolve the NPE and shouldn't crash the collector when we encounter these.

Link to tracking issue

Fixes #41018

Testing

Documentation

Changelog

@songy23 songy23 merged commit 2f7c78e into open-telemetry:main Jul 31, 2025
182 checks passed
@schmikei schmikei deleted the schmikei/vcenter-fix branch July 31, 2025 14:36
@schmikei schmikei changed the title fix npe on some metrics for vcenter vms [receiver/vcenterreceiver]: fix npe on some metrics for vcenter vms Jul 31, 2025
Dylan-M pushed a commit to Dylan-M/opentelemetry-collector-contrib that referenced this pull request Aug 5, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

I believe that this should be the only nullable field improperly
accessed within this file.

```go
// The ConfigInfo data object type encapsulates the configuration settings and
// virtual hardware for a virtual machine.
//
// This type holds all the information
// that is present in the .vmx configuration file for the virtual machine.
type VirtualMachineConfigInfo struct {
```

I'm thinking users may have created a machine and attached the vmdk to
it and thats may be the potential cause?

Either way this should resolve the NPE and shouldn't crash the collector
when we encounter these.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#41018

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

Changelog
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.

vcenterreceiver panics on VM metric collection (nil pointer dereference in buildVMMetrics)

3 participants