-
Notifications
You must be signed in to change notification settings - Fork 919
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
[BUG] govc metric.ls panic #2835
Comments
Howdy 🖐 jcpowermac ! Thank you for your interest in this project. We value your feedback and will respond soon. If you want to contribute to this project, please make yourself familiar with the |
Not sure what's causing this, I haven't used vmc myself. Could include the debug logs or
|
@dougm attached |
https://github.com/vmware/govmomi/blob/master/performance/manager.go#L208 - is
|
This is an odd issue... using spew func (d groupPerfCounterInfo) Less(i, j int) bool {
spew.Printf("i: %#+v\n", i)
spew.Printf("j: %#+v\n", j)
ci := d.ids[i].CounterId
spew.Printf("ci: %#+v\n", ci)
cj := d.ids[j].CounterId
spew.Printf("cj: %#+v\n", cj)
spew.Printf("len(d.ids): %#+v\n", len(d.ids))
spew.Printf("len(d.info): %#+v\n", len(d.info))
for loc, value := range d.info {
if value != nil {
if loc == ci || loc == cj {
spew.Printf("loc: %#+v value: %#+v\n", loc, value)
}
}
}
gi := d.info[ci].GroupInfo.GetElementDescription()
gj := d.info[cj].GroupInfo.GetElementDescription()
return gi.Key < gj.Key
}
The |
We see similar issue with some virtual machines. sort.sort functions panics when it reaches to doPivot function. It looks like a golang issue. I believe this started happening to us after 1.18, because we don't remember if it was happening before. Do you have 1.18 as well? @jcpowermac |
|
I forgot to mention that our other CI enviornment running vCenter - Version: 7.0.2 Build: 17920168 |
Reproduced in non-vmc vcenter as well
|
And then upgraded to u3e
|
I can reproduce this. Not seeing an issue with Go's sort itself @yusufozturk , but what @jcpowermac is seeing. Where of the 163 available metrics for a vm, 1 of them does not have PerfCounterInfo. I can see from @jcpowermac 's logs and mine, vCenter is not returning that 1 PerfCounterInfo, which seems like a vCenter bug. But something we can workaround in govmomi for now to avoid the panic, I'll try to put something together soon. |
@dougm thank you for confirming. |
Newer versions of vCenter may return a CounterId via QueryAvailablePerfMetric() which does not have a corresponding PerfCounterInfo entry in PerformanceManager's perfCounter property. This results in a panic by a few of the govc metric commands and any application using performance.Manager.AvailableMetric with Sort enabled. While this may be a bug in vCenter, it is included in some recent release versions. This workaround avoids the panic by ignoring any CounterId w/o a PerfCounterInfo. Closes vmware#2835
@jcpowermac I'll open a bug against vCenter for this, a CounterId without any PerfCounterInfo is not usable. I could only see this with type VirtualMachine and the default (realtime/20s) interval, history intervals (`-i day|week|month|year) don't include this phantom CounterId. In the meantime, we can workaround with #2859 |
Newer versions of vCenter may return a CounterId via QueryAvailablePerfMetric() which does not have a corresponding PerfCounterInfo entry in PerformanceManager's perfCounter property. This results in a panic by a few of the govc metric commands and any application using performance.Manager.AvailableMetric with Sort enabled. While this may be a bug in vCenter, it is included in some recent release versions. This workaround avoids the panic by ignoring any CounterId w/o a PerfCounterInfo. Also updated vcsim's PerformanceManager.QueryCounter to match real vCenter's behavior. Where null is returned for an unknown CounterId. Closes vmware#2835
Newer versions of vCenter may return a CounterId via QueryAvailablePerfMetric() which does not have a corresponding PerfCounterInfo entry in PerformanceManager's perfCounter property. This results in a panic by a few of the govc metric commands and any application using performance.Manager.AvailableMetric with Sort enabled. While this may be a bug in vCenter, it is included in some recent release versions. This workaround avoids the panic by ignoring any CounterId w/o a PerfCounterInfo. Also updated vcsim's PerformanceManager.QueryCounter to match real vCenter's behavior. Where null is returned for an unknown CounterId. Closes vmware#2835
Describe the bug
When running
govc metric.ls
the command panicsTo Reproduce
Steps to reproduce the behavior:
govc metric.ls
against a virtual machineExpected behavior
No panic
Affected version
Multiple versions: 0.27.4, 0.28.0
Screenshots/Debug Output
Additional context
This issue started after our VMC SDDC was upgraded:
SDDC Version: | 1.16v7
https://docs.vmware.com/en/VMware-Cloud-on-AWS/services/com.vmware.vmc-aws-operations/GUID-52CED8FB-2E3A-4766-8C59-2EAD8E2C1D31.html
vCenter:
Version: 7.0.3 Build: 19504857
We have been running this command in CI for 9 months without issue.
https://github.com/openshift/release/pull/20598/files
The text was updated successfully, but these errors were encountered: