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

Deleting Cloud Gateway network panics #65

Open
pmalek opened this issue Feb 6, 2025 · 1 comment
Open

Deleting Cloud Gateway network panics #65

pmalek opened this issue Feb 6, 2025 · 1 comment

Comments

@pmalek
Copy link
Member

pmalek commented Feb 6, 2025

goroutine 1653 [running]:
	k8s.io/apimachinery/pkg/util/runtime.logPanic({0x1081b6948, 0x140020bf4d0}, {0x107c9b4a0, 0x1099a0f80})
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:107 +0xe4
			sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile.func1()
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:107 +0x1bc
			panic({0x107c9b4a0?, 0x1099a0f80?})
	/Users/USER/.gvm/gos/go1.23.6/src/runtime/panic.go:785 +0xf0
			github.com/Kong/sdk-konnect-go.(*CloudGateways).DeleteNetwork.func1()
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/!kong/[email protected]/cloudgateways.go:4256 +0x7c
			github.com/Kong/sdk-konnect-go/internal/utils.Retry.func1()
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/!kong/[email protected]/internal/utils/retries.go:50 +0x120
			github.com/Kong/sdk-konnect-go/internal/utils.retryWithBackoff({0x1081b6948, 0x140020bf5f0}, 0x14002304a70, 0x14002304908)
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/!kong/[email protected]/internal/utils/retries.go:121 +0x13c
			github.com/Kong/sdk-konnect-go/internal/utils.Retry({0x1081b6948, 0x140020bf5f0}, {0x14002305650, {0x14002305618, 0x1, 0x1}}, 0x14002305a28)
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/!kong/[email protected]/internal/utils/retries.go:39 +0x29c
			github.com/Kong/sdk-konnect-go.(*CloudGateways).DeleteNetwork(0x140000d06e0, {0x1081b6948, 0x140020bf5f0}, {0x14000c537d0, 0x24}, {0x0, 0x0, 0x0})
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/github.com/!kong/[email protected]/cloudgateways.go:4249 +0xd64
			github.com/kong/gateway-operator/controller/konnect/ops.deleteKonnectNetwork({0x1081b6948, 0x140020bf5f0}, {0x1081b8ba0, 0x140000d06e0}, 0x14001f81180)
	/Users/USER/code_/gateway-operator/controller/konnect/ops/ops_konnectnetwork.go:52 +0x8c
			github.com/kong/gateway-operator/controller/konnect/ops.Delete[...]({0x1081b6948, 0x140020bf5f0}, {0x1081e45d0, 0x1400196f278}, {0x1081d2040, 0x140004db7a0}, {0x10818d0e8, 0x109a85c80}, 0x14001f81180)
	/Users/USER/code_/gateway-operator/controller/konnect/ops/ops.go:234 +0xde4
			github.com/kong/gateway-operator/controller/konnect.(*KonnectEntityReconciler[...]).Reconcile(0x1081eef00, {0x1081b6948, 0x140020bf5f0}, {{{0x140020e6c96, 0x7}, {0x1400200c7c8, 0x11}}})
	/Users/USER/code_/gateway-operator/controller/konnect/reconciler_generic.go:485 +0x5020
			sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile(0x1081e3ce0, {0x1081b6948, 0x140020bf4d0}, {{{0x140020e6c96, 0x7}, {0x1400200c7c8, 0x11}}})
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:118 +0x1a8
			sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler(0x1081e3ce0, {0x1081b6948, 0x140020bf4d0}, {{{0x140020e6c96, 0x7}, {0x1400200c7c8, 0x11}}})
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:328 +0x370
			sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem(0x1081e3ce0, {0x1081b6980, 0x14000499950})
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:288 +0x3bc
			sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2()
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:249 +0xe8
			created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2 in goroutine 596
	/Users/USER/.gvm/pkgsets/go1.23.6/global/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:245 +0xa60
@pmalek pmalek changed the title Delete Cloud Gateway network panics Deleting Cloud Gateway network panics Feb 6, 2025
@pmalek
Copy link
Member Author

pmalek commented Feb 7, 2025

xref: slack thread https://kongstrong.slack.com/archives/C05MLAA216D/p1738863071903989

Reproduced it with a simple test:

func TestCloudGatewayNetwork(t *testing.T) {
	sdk := SDK(t, GlobalAPI)

	t.Run("Networks", func(t *testing.T) {
		ctx := context.Background()

		respGet, err := sdk.CloudGateways.GetNetwork(ctx, "03fc0cb9-e9ec-49e5-bb2d-b07928bfb47a")
		require.NoError(t, err)
		require.NotNil(t, respGet)

		respDelete, err := sdk.CloudGateways.DeleteNetwork(ctx, respGet.Network.ID)
		require.NoError(t, err)
		require.NotNil(t, respDelete)
	})
}
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10529a54c]

goroutine 36 [running]:
testing.tRunner.func1.2({0x105374aa0, 0x1056068e0})
	/Users/USER/.gvm/gos/go1.23.6/src/testing/testing.go:1632 +0x3c0
testing.tRunner.func1()
	/Users/USER/.gvm/gos/go1.23.6/src/testing/testing.go:1635 +0x57c
panic({0x105374aa0?, 0x1056068e0?})
	/Users/USER/.gvm/gos/go1.23.6/src/runtime/panic.go:785 +0xf0
github.com/Kong/sdk-konnect-go.(*CloudGateways).DeleteNetwork.func1()
	/Users/USER/code_/sdk-konnect-go/cloudgateways.go:4256 +0x7c
github.com/Kong/sdk-konnect-go/internal/utils.Retry.func1()
	/Users/USER/code_/sdk-konnect-go/internal/utils/retries.go:50 +0x120
github.com/Kong/sdk-konnect-go/internal/utils.retryWithBackoff({0x1053e6818, 0x10563ece0}, 0x1400041ac60, 0x1400041aaf8)
	/Users/USER/code_/sdk-konnect-go/internal/utils/retries.go:121 +0x13c
github.com/Kong/sdk-konnect-go/internal/utils.Retry({0x1053e6818, 0x10563ece0}, {0x1400041b840, {0x1400041b808, 0x1, 0x1}}, 0x1400041bc18)
	/Users/USER/code_/sdk-konnect-go/internal/utils/retries.go:39 +0x29c
github.com/Kong/sdk-konnect-go.(*CloudGateways).DeleteNetwork(0x14000121c20, {0x1053e6818, 0x10563ece0}, {0x140000ca390, 0x24}, {0x0, 0x0, 0x0})
	/Users/USER/code_/sdk-konnect-go/cloudgateways.go:4249 +0xd64
github.com/Kong/sdk-konnect-go/test/integration.TestCloudGatewayNetwork.func1(0x1400011eb60)
	/Users/USER/code_/sdk-konnect-go/test/integration/cloudgateway_test.go:160 +0x214
testing.tRunner(0x1400011eb60, 0x1400010b790)
	/Users/USER/.gvm/gos/go1.23.6/src/testing/testing.go:1690 +0x1a8
created by testing.(*T).Run in goroutine 35
	/Users/USER/.gvm/gos/go1.23.6/src/testing/testing.go:1743 +0x668

f930d10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant