Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Crash when parsing custom registry tags #138

Closed
bnason opened this issue Apr 6, 2022 · 0 comments · Fixed by #139
Closed

Crash when parsing custom registry tags #138

bnason opened this issue Apr 6, 2022 · 0 comments · Fixed by #139
Assignees

Comments

@bnason
Copy link

bnason commented Apr 6, 2022

Theila is crashing with a SIGSEGV when navigating to the Overpage page and the Kubernetes cluster is using images with a port. For instance, I'm using a local cache registry and the image for kube-apiserver is registry:5443/k8s.gcr.io/kube-apiserver:v1.22.8. It seems it's trying to parse out v1.22.8 but instead getting 5443/k8s

2022-04-05T14:24:06.725-0500 DEBUG runtime/adapter.go:405 controller starting {"component": "theilaRuntime", "controller": "UpgradeController"}
2022-04-05T14:24:06.726-0500 INFO grpc/grpc.go:124 serve gRPC at 127.0.0.1:45603 {"component": "grpc"}
2022-04-05T14:24:06.726-0500 INFO backend/server.go:104 serving on 127.0.0.1:8080 {"component": "server"}
2022-04-05T14:24:10.531-0500 INFO controllers/upgrade.go:211 reconciled available Kubernetes releases {"component": "theilaRuntime", "controller": "UpgradeController"}
2022-04-05T14:24:15.184-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "f2f9f550-3b15-4566-9676-beaf6c56e1a1", "resource": "TaskStatuses.theila.sidero.dev", "namespace": "", "source": "Theila", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:15.185-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "65bf223e-34d0-44ad-afe7-7332ce30ef4b", "resource": "nodes.v1", "namespace": "", "source": "Kubernetes", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:15.186-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "52f0e435-d518-4b0f-89ad-aeae3060c1a8", "resource": "TaskStatuses.theila.sidero.dev", "namespace": "admin@capv-bootstrap", "source": "Theila", "context": "admin@capv-bootstrap"}
I0405 14:24:16.213955  186061 request.go:665] Waited for 1.035099196s due to client-side throttling, not priority and fairness, request: GET:https://10.5.0.2:6443/apis/flowcontrol.apiserver.k8s.io/v1beta1?timeout=32s
2022-04-05T14:24:22.184-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "e880c850-53e2-400b-a51d-de9f3c147db9", "resource": "pods.v1", "namespace": "", "source": "Kubernetes", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:25.598-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "cea7b951-226f-4fe5-87d7-41a9bf15c7f2", "resource": "TaskStatuses.theila.sidero.dev", "namespace": "", "source": "Theila", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:25.604-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "bce10a71-27e0-4be6-b3d4-fb3e055f5918", "resource": "TaskStatuses.theila.sidero.dev", "namespace": "admin@capv-bootstrap", "source": "Theila", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:27.012-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "2cf606b2-2980-48e5-b957-bd2a60180761", "resource": "TaskStatuses.theila.sidero.dev", "namespace": "", "source": "Theila", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:27.013-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "678bc5c7-275e-4443-8da2-68ae5c7d56e8", "resource": "nodes.v1", "namespace": "", "source": "Kubernetes", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:27.013-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "581d7d5c-3f92-47d0-9861-2316269ceb78", "resource": "pods.v1", "namespace": "", "source": "Kubernetes", "context": "admin@capv-bootstrap"}
2022-04-05T14:24:27.014-0500 DEBUG ws/subscription.go:105 subscribed {"component": "subscription", "subscription": "dd25d54e-818c-4cda-9564-5c7859089114", "resource": "clusters.v1alpha4.cluster.x-k8s.io", "namespace": "", "source": "Kubernetes", "context": "admin@capv-bootstrap"}
failed to parse kube-apiserver container version strconv.ParseInt: parsing "5443/k8s": invalid syntax
failed to parse kube-controller-manager container version strconv.ParseInt: parsing "5443/k8s": invalid syntax
failed to parse kube-proxy container version strconv.ParseInt: parsing "5443/k8s": invalid syntax
failed to parse kube-scheduler container version strconv.ParseInt: parsing "5443/k8s": invalid syntax
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1bdb8d7]

goroutine 1346 [running]:
github.com/talos-systems/talos/pkg/cluster/kubernetes.DetectLowestVersion({0x2aeb0b0, 0xc000a85e60}, {0x2b15c80, 0xc00009bd80}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...})
	/go/pkg/mod/github.com/talos-systems/talos@v1.0.0-beta.1/pkg/cluster/kubernetes/detect.go:67 +0x257
github.com/siderolabs/theila/internal/backend/grpc.(*managementServer).UpgradeInfo(0x1f63e20, {0x2aeb0b0, 0xc000a85e60}, 0xc00087ab68)
	/src/internal/backend/grpc/management.go:57 +0x172
github.com/siderolabs/theila/api/rpc._ManagementService_UpgradeInfo_Handler({0x1f235e0, 0x3ea57e0}, {0x2aeb0b0, 0xc000a85e60}, 0xc0002b87e0, 0x0)
	/src/api/rpc/management_grpc.pb.go:76 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00061d340, {0x2b253b0, 0xc0000f8b60}, 0xc000afea20, 0xc0007e7bc0, 0x3e24040, 0x0)
	/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1282 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc00061d340, {0x2b253b0, 0xc0000f8b60}, 0xc000afea20, 0x0)
	/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:1616 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/go/pkg/mod/google.golang.org/grpc@v1.44.0/server.go:919 +0x294
smira added a commit to smira/talos that referenced this issue Apr 6, 2022
Use the last `:` in the image reference.

Handle the case when no version was discovered.

See siderolabs/theila#138

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
smira added a commit to smira/talos that referenced this issue Apr 7, 2022
Use the last `:` in the image reference.

Handle the case when no version was discovered.

See siderolabs/theila#138

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Unix4ever added a commit to Unix4ever/theila that referenced this issue Apr 8, 2022
Fixes: siderolabs#138
Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
smira added a commit to smira/talos that referenced this issue Apr 13, 2022
Use the last `:` in the image reference.

Handle the case when no version was discovered.

See siderolabs/theila#138

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
(cherry picked from commit 0cb84e8)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants