stackabletech / stackablectl

Commandline tool to interact with a Stackable Data Platform
Other
8 stars 1 forks source link

Coredump when trying to install an operator version that doesn't exist #127

Closed razvan closed 8 months ago

razvan commented 2 years ago

Description

The operator nifi=0.6.0-pr353 doesn't exist and stackablectl crashes.

$ stackablectl operator install --kind-cluster secret commons nifi=0.6.0-pr353   
...
[INFO ] Installing secret operator
[INFO ] Installing commons operator
[INFO ] Installing nifi operator in version 0.6.0-pr353
panic: failed to download "stackable-test/nifi-operator" at version "0.6.0-pr353"

goroutine 17 [running, locked to thread]:
main.go_install_helm_release({0x55cee971db10, 0xd}, {0x55cee97120a0, 0x1c}, {0x55cee9720b10, 0xb}, {0x55cee75cf2b0, 0x0}, {0x55cee971e7e0, 0x7}, ...)
        /home/razvan/repo/stackable/stackablectl/go-helm-wrapper/main.go:38 +0x1fc
[1]    29619 IOT instruction (core dumped)  stackablectl operator install --kind-cluster secret commons nifi=0.6.0-pr353
$ stackablectl --version                                                      
stackablectl 0.4.0
sbernauer commented 2 years ago

That#s the behavior of the underlying (go) helm lib. We could check via Rust if the versions exists but for my personally the error message failed to download "stackable-test/nifi-operator" at version "0.6.0-pr353" is sufficient enough. The helm lib is also used to install helm-charts not provided by us (e.g. minio or postgres)

lfrancke commented 2 years ago

I agree with both of you. The error message is good but the panic after is not good. I'll tag this as a bug for now, but it's not too critical.

Techassi commented 1 year ago

This is now improved. See https://github.com/stackabletech/stackable-cockpit/blob/dd978a9003846cd8938a560d1bf1c9c019c997fa/src/helm.rs#L136-L139

This will now return and display an error:

Installing 1 operator
Installing foo operator
Error: operator command error

Caused by these errors (recent errors listed first):
  1: Helm error
  2: failed to install Helm release *
  3: helm error: chart "foo-operator" matching >0.0.0-0 not found in stackable-dev index. (try 'helm repo update'): no chart name found

This will now only panic when the Go Helm wrapper fails (for example when creating a Helm client in Go). So guess we can close this.

fhennig commented 8 months ago

Yeah I'm getting:

Installed secret operator
Installed commons operator
  ERROR  Go wrapper function go_install_helm_release encountered an error: chart "nifi-operator" matching 0.6.0-pr353 not found in stackable-test index. (try 'helm repo update'): no chart version found for nifi-operator-0.6.0-pr353
    at rust/stackable-cockpit/src/helm.rs:279

An unrecoverable error occured: failed to execute operator (sub)command

Caused by these errors (recent errors listed first):
 1: Helm error
 2: failed to install Helm release
 3: helm error

I'm closing this, as there is no coredump anymore and the error message looks sensible