Skip to content

Conversation

schmikei
Copy link
Contributor

Description

This PR just practices being defensive around accessing of the types.VirtualMachineConfigInfo. As I've never seen this field been nil I am still not quite certain which prerequisites cause this for a specific VM but figured the nil checks are safe enough to guard us from any nil-pointer access.

Link to tracking issue

Fixes #42098

Testing

Documentation

Changelog entry

@schmikei
Copy link
Contributor Author

schmikei commented Aug 19, 2025

test failure is not related to this PR

skywalkingreceiver failure
Running target 'test' in module 'receiver/skywalkingreceiver' as part of group 'receiver-3'
make --no-print-directory -C receiver/skywalkingreceiver test
/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/.tools/gotestsum --rerun-fails=1 --packages="./..." -- -race -timeout 600s -parallel 4 --tags=""
∅  internal/metadata
∅  internal/metrics
∅  internal/trace
✖  . (61ms)

DONE 22 tests, 1 failure in 0.061s

✖  . (20ms)

=== Failed
=== FAIL: . TestHttpReception (0.00s)
    skywalking_receiver_test.go:139: 
        	Error Trace:	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/skywalkingreceiver/skywalking_receiver_test.go:139
        	            				/opt/hostedtoolcache/go/1.24.6/arm64/src/testing/testing.go:1211
        	            				/opt/hostedtoolcache/go/1.24.6/arm64/src/testing/testing.go:1445
        	            				/opt/hostedtoolcache/go/1.24.6/arm64/src/testing/testing.go:17[86](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/17071073869/job/48400008790?pr=42102#step:4:87)
        	Error:      	Received unexpected error:
        	            	context canceled
make[2]: *** [../../Makefile.Common:106: test] Error 1
make[1]: *** [Makefile:254: receiver/skywalkingreceiver] Error 2
make[1]: *** Waiting for unfinished jobs....
        	Test:       	TestHttpReception

=== FAIL: . TestHttpReception (re-run 1) (0.00s)
    skywalking_receiver_test.go:139: 
        	Error Trace:	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/skywalkingreceiver/skywalking_receiver_test.go:139
        	            				/opt/hostedtoolcache/go/1.24.6/arm64/src/testing/testing.go:1211
        	            				/opt/hostedtoolcache/go/1.24.6/arm64/src/testing/testing.go:1445
        	            				/opt/hostedtoolcache/go/1.24.6/arm64/src/testing/testing.go:1786
        	Error:      	Received unexpected error:
        	            	context canceled
        	Test:       	TestHttpReception

@atoulme atoulme merged commit ebc1d94 into open-telemetry:main Aug 19, 2025
186 checks passed
@schmikei schmikei deleted the fix/panic-in-vcenter-vm-collection branch August 19, 2025 18:57
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 panic when collecting VM metrics (nil pointer dereference at resources.go:118)

3 participants