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

VM Getters panic on shutdown VMs #256

Open
aravindhp opened this issue Oct 23, 2024 · 0 comments · May be fixed by #257
Open

VM Getters panic on shutdown VMs #256

aravindhp opened this issue Oct 23, 2024 · 0 comments · May be fixed by #257
Labels
bug Something isn't working

Comments

@aravindhp
Copy link

Describe the bug

GetVMByName(), GetVM(), ListVMs() etc panic if they run into a VM which is shutdown. Example:

{"time":"2024-10-22T16:45:45.989264166-07:00","level":"DEBUG","msg":"Testing oVirt engine connection..."}
{"time":"2024-10-22T16:45:46.560604734-07:00","level":"DEBUG","msg":"Completed testing oVirt engine connection."}
{"time":"2024-10-22T16:45:46.560632692-07:00","level":"DEBUG","msg":"Getting vm name ab-lnxdev01..."}
panic: the address must not be nil, please use Address() function instead

goroutine 19 [running]:
github.com/ovirt/go-ovirt.(*Ip).MustAddress(...)
        /home/aravindh/go/pkg/mod/github.com/ovirt/[email protected]/types.go:25910
github.com/ovirt/go-ovirt-client/v3.convertSDKNicConfiguration(0x0?)
        /home/aravindh/go/pkg/mod/github.com/ovirt/go-ovirt-client/[email protected]/vm.go:542 +0x358
github.com/ovirt/go-ovirt-client/v3.convertSDKInitialization(0x1?)
        /home/aravindh/go/pkg/mod/github.com/ovirt/go-ovirt-client/[email protected]/vm.go:533 +0xc6
github.com/ovirt/go-ovirt-client/v3.vmInitializationConverter(0xce5f2b1500000003?, 0xc000226200)
        /home/aravindh/go/pkg/mod/github.com/ovirt/go-ovirt-client/[email protected]/vm.go:2576 +0x18
github.com/ovirt/go-ovirt-client/v3.convertSDKVM(0xc0000ec588, {0xafd7e8, 0xc000443140})
        /home/aravindh/go/pkg/mod/github.com/ovirt/go-ovirt-client/[email protected]/vm.go:2352 +0x1cf
github.com/ovirt/go-ovirt-client/v3.(*oVirtClient).GetVMByName.func1()
        /home/aravindh/go/pkg/mod/github.com/ovirt/go-ovirt-client/[email protected]/vm_get_by_name.go:23 +0x1d5
github.com/ovirt/go-ovirt-client/v3.retry({0xc00030e8e0, 0x1b}, {0xaf35e0, 0xc000070140}, {0xc0002f4460, 0x6, 0x71aaecdb7bb8?}, 0xc000045bb8)
        /home/aravindh/go/pkg/mod/github.com/ovirt/go-ovirt-client/[email protected]/retry.go:38 +0x25d
github.com/ovirt/go-ovirt-client/v3.(*oVirtClient).GetVMByName(0xc000443140, {0xa1a901, 0xb}, {0x0, 0x0, 0x0})
        /home/aravindh/go/pkg/mod/github.com/ovirt/go-ovirt-client/[email protected]/vm_get_by_name.go:10 +0x18e
<snip>

To Reproduce

  1. Call ListVMs() against an oVirt instance that has shutdown VMs

Expected behavior

The calls should return VM(s).

This is because convertSDKNicConfiguration always expects a Nic to have an address.

@aravindhp aravindhp added the bug Something isn't working label Oct 23, 2024
@aravindhp aravindhp linked a pull request Oct 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant