open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.9k stars 2.27k forks source link

vCenter failed to receive VMs metrics panic runtime error invalid memory address or nil pointer dereference #34343

Open shacharSirotkin opened 1 month ago

shacharSirotkin commented 1 month ago

Component(s)

vCenter receiver

What happened?

Description

I tried to config a vcenterreciver and got a stack trace of runtime error saying: panic: runtime error: invalid memory address or nil pointer dereference.

Steps to Reproduce

Install otel-collector-contrib on your PC and use a config.yaml to receive metrics from vCenter in version 7.0.3

Expected Result

normal metrics of vcenter

Actual Result

panic: runtime error: invalid memory address or nil pointer dereference.

github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(*vcenterMetricScraper).buildVMMetrics() .....

Collector version

0.105.0

Environment information

Environment

Windows 10 Enterprise

OpenTelemetry Collector configuration

receivers:
    vecenter/vc1:
        endpoint: https://dev-vc1.my.domain
        username: vm_mgr_svc
        password: **************
        collection_interval: 1m
        tls:
            insecure: false
            insecure_skip_verify: true

exporters:
     file/myfile:
         path: metrics

service:
     pipelines:
          metrics:
               receivers:
                    - vcenter/vc1
               exporters:
                   - file/myfile
      telemetry:
          metrics:
                address: 0.0.0.0:8993

Log output

panic: runtime error: invalid memory address or nil pointer dereference.

github.com/open-telemetry/opentelemetry-collector-contrib/receiver/vcenterreceiver.(*vcenterMetricScraper).buildVMMetrics()
.....

Additional context

No response

github-actions[bot] commented 1 month ago

Pinging code owners for receiver/vcenter: @djaglowski @schmikei @StefanKurek. See Adding Labels via Comments if you do not have permissions to add labels yourself.

crobert-1 commented 1 month ago

Thanks for filing @shacharSirotkin, is that the full stack trace from the panic? It would be helpful to have more specific information about where the panic occurred in buildVMMetrics.

BominRahmani commented 1 month ago

@shacharSirotkin Hey! I'd love to take a look at this, if you could please supply the full stack trace from the panic you see.