bl4ko/netbox-ssot

v1.0.3 null pointer on ovirt

TaLoN1x opened this issue ยท 3 comments

Running latest version againts Netbox 4 and Ovirt results in a nullpointer:

2024/05/13 12:58:38 ovirt.go:123 INFO (ovirt-test): Successfully synced syncDatacenters-fm in 0.000088 seconds
panic: reflect: slice index out of range

goroutine 23 [running]:
reflect.Value.Index({0xb2bfc0?, 0xc0039920c8?, 0x4?}, 0xdfb0a1?)
/usr/local/Cellar/go/1.22.2/libexec/src/reflect/value.go:1430 +0x167
github.com/bl4ko/netbox-ssot/internal/utils.convertSliceToComparableSlice({0xb2bfc0?, 0xc0039920c8?, 0xa9a0af?})
/Users/jurikononov/src/tmp/netbox-ssot/internal/utils/diff_map.go:240 +0x46
github.com/bl4ko/netbox-ssot/internal/utils.addSliceDiff({0xb2bfc0?, 0xc003992088?, 0x1?}, {0xb2bfc0?, 0xc0039920c8?, 0xa9a0a9?}, {0xa9a0af, 0x4}, 0x38?, 0xc002b3f6e0)
/Users/jurikononov/src/tmp/netbox-ssot/internal/utils/diff_map.go:219 +0x1fb
github.com/bl4ko/netbox-ssot/internal/utils.JSONDiffMapExceptID({0xd57e80, 0xc003992080}, {0xd57e80, 0xc0039920c0}, 0x0, 0xc00015ff20)
/Users/jurikononov/src/tmp/netbox-ssot/internal/utils/diff_map.go:166 +0x985
github.com/bl4ko/netbox-ssot/internal/utils.JSONDiffMapExceptID({0xb8e540, 0xc003994000}, {0xb8e540, 0xc00037c808}, 0x0, 0xc00015ff20)
/Users/jurikononov/src/tmp/netbox-ssot/internal/utils/diff_map.go:121 +0x510
github.com/bl4ko/netbox-ssot/internal/netbox/inventory.(*NetboxInventory).AddClusterType(0xc0000de1e0, {0xf3c518, 0xc00085e360}, 0xc003994000)
/Users/jurikononov/src/tmp/netbox-ssot/internal/netbox/inventory/add_items.go:335 +0x255
github.com/bl4ko/netbox-ssot/internal/source/ovirt.(*OVirtSource).syncClusters(0xc0007ff500, 0xc0000de1e0)
/Users/jurikononov/src/tmp/netbox-ssot/internal/source/ovirt/ovirt_sync.go:102 +0x156
github.com/bl4ko/netbox-ssot/internal/source/ovirt.(*OVirtSource).Sync(0xc0007ff500, 0xc0000de1e0)
/Users/jurikononov/src/tmp/netbox-ssot/internal/source/ovirt/ovirt.go:118 +0x2fb
main.main.func1({0xf3c518, 0xc00085e360}, {0xf3a7a8, 0xc0007ff500})
/Users/jurikononov/src/tmp/netbox-ssot/cmd/netbox-ssot/main.go:98 +0x2f1
created by main.main in goroutine 1
/Users/jurikononov/src/tmp/netbox-ssot/cmd/netbox-ssot/main.go:78 +0x67e

Thanks for report. I have added fix in develop branch, but I am not sure if it solves, could you try this on develop branch?

Reopen if not fixed

๐ŸŽ‰ This issue has been resolved in version 1.1.0 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€