helmfile/helmfile

helmfile error not propagated to action

jkroepke opened this issue · 36 comments

Hi,

today, had this error on my pipeline:

COMBINED OUTPUT:
  Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused
Listing releases matching ^opsstack$
confirming if the release is already installed or not: command "/opt/hostedtoolcache/helm/3.13.2/x64/helm" exited with non-zero status:

PATH:
  /opt/hostedtoolcache/helm/3.13.2/x64/helm

ARGS:
  0: helm (4 bytes)
  1: list (4 bytes)
  2: --filter (8 bytes)
  3: ^opsstack$ (10 bytes)
  4: --namespace (11 bytes)
  5: opsstack (8 bytes)
  6: --uninstalling (14 bytes)
  7: --deployed (10 bytes)
  8: --failed (8 bytes)
  9: --pending (9 bytes)

ERROR:
  exit status 1

EXIT STATUS
  1

STDERR:
  Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused

COMBINED OUTPUT:
  Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused
Affected releases are:
  opsstack (../../charts/opsstack) UPDATED
  opsstack-crds (../../charts/opsstack-crds) UPDATED

Identified at least one change

Kubernetes was not reachable, but helmfile diff does not fail with exit code 1. It failed with exit code 2 which should indicate a diff is present..

http://localhost:8080/version, please check your kubeconfig.

do you upgrade your helmfile or helm version? and please show the version information.

http://localhost:8080/version, please check your kubeconfig.

Thank you. But I expect that the action errored.

Run helmfile/helmfile-action@v1.6.0
Attempting to download helm v3.13.2...
Attempting to download helmfile v0.159.0...

@jkroepke you can try to rollback to the old version helm. helmfile doesn't access the k8s directly.

@yxxhero I'm not reporting that I have connection issues to Kubernetes. I have my connection and CI/CD under control.

I'm reporting that helmfile reports exit code 1

ERROR:
exit status 1

EXIT STATUS
1

But the action is green/not errored.

image

@jkroepke oh. I see.

could you share the job link here?

Its a company repository without public access.

With details you neec?

@jkroepke did you see any logs like "The process 'helmfile ${helmfileArgs}' failed with exit code ${processExitCode}"?

@jkroepke Or maybe you can post the whole logs.

did you see any logs like "The process 'helmfile ${helmfileArgs}' failed with exit code ${processExitCode}"?

No. See the screenshot above, there is no ending line with that.

I have the feeling that this error exists only, if helmfile reports that helm list fails. If I have other errors, where helm diff, or helm upgrade fails, then I can see the line like:

Error: The process 'helmfile sync -f prod-opsstack/helm/helmfile.yaml --skip-crds --color --skip-deps' failed with exit code 1

It could also possible that helmfile itself does not exit with exit code 1, if there helm list failes. In because in other situations, everything works fine.

@jkroepke are your releases more than one?

could you post the whole logs. in order to make me finding more info.

Raw output logs

Details
2023-12-11T18:57:13.1115911Z ##[group]Run helmfile/helmfile-action@v1.6.0
2023-12-11T18:57:13.1116862Z with:
2023-12-11T18:57:13.1117515Z   helmfile-version: v0.159.0
2023-12-11T18:57:13.1118317Z   helm-version: v3.13.2
2023-12-11T18:57:13.1119263Z   helm-plugins: https://github.com/databus23/helm-diff
2023-12-11T18:57:13.1121498Z   helmfile-args: diff -f prod-opsstack/helm/helmfile.yaml --skip-diff-on-install --color --detailed-exitcode --context 10 
2023-12-11T18:57:13.1123598Z   helmfile-workdirectory: .
2023-12-11T18:57:13.1124338Z env:
2023-12-11T18:57:13.1124986Z   CHART_LOCATION: ../../charts/
2023-12-11T18:57:13.1125798Z   VERSION_OPSSTACK: 0.0.0
2023-12-11T18:57:13.1126571Z   VERSION_OPSSTACK_CRD: 2.11.0
2023-12-11T18:57:13.1127363Z   ARM_USE_OIDC: true
2023-12-11T18:57:13.1128313Z   AZURE_TENANT_ID: ***
2023-12-11T18:57:13.1129284Z   AZURE_SUBSCRIPTION_ID: ***
2023-12-11T18:57:13.1130260Z   AZURE_CLIENT_ID: ***
2023-12-11T18:57:13.1131296Z   AZURE_CLIENT_SECRET: ***
2023-12-11T18:57:13.1132550Z   AZURE_FEDERATED_TOKEN_FILE: /home/runner/work/cdt-ops-stack/cdt-ops-stack/.az-token
2023-12-11T18:57:13.1133823Z ##[endgroup]
2023-12-11T18:57:13.4261453Z Attempting to download helm v3.13.2...
2023-12-11T18:57:13.4263700Z Attempting to download helmfile v0.159.0...
2023-12-11T18:57:13.9750953Z [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/84324fa3-ef95-4199-ab9f-fda7040c11d7 -f /home/runner/work/_temp/d7395709-bcda-4736-ae28-384d90d53d4e
2023-12-11T18:57:14.1902877Z [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/05cac9fc-419a-4dde-8c74-1012f37c6c73 -f /home/runner/work/_temp/37adcf93-be40-4154-8ae2-d3381f79cc12
2023-12-11T18:57:14.8858988Z [command]/opt/hostedtoolcache/helm/3.13.2/x64/helm plugin install https://github.com/databus23/helm-diff
2023-12-11T18:57:16.3997246Z Downloading https://github.com/databus23/helm-diff/releases/latest/download/helm-diff-linux-amd64.tgz
2023-12-11T18:57:17.4000254Z Preparing to install into /home/runner/.local/share/helm/plugins/helm-diff
2023-12-11T18:57:17.4002828Z helm-diff installed into /home/runner/.local/share/helm/plugins/helm-diff/helm-diff
2023-12-11T18:57:17.4070158Z 
2023-12-11T18:57:17.4070717Z The Helm Diff Plugin
2023-12-11T18:57:17.4071221Z 
2023-12-11T18:57:17.4071776Z * Shows a diff explaining what a helm upgrade would change:
2023-12-11T18:57:17.4073099Z     This fetches the currently deployed version of a release
2023-12-11T18:57:17.4074426Z   and compares it to a local chart plus values. This can be
2023-12-11T18:57:17.4075725Z   used visualize what changes a helm upgrade will perform.
2023-12-11T18:57:17.4076514Z 
2023-12-11T18:57:17.4077099Z * Shows a diff explaining what had changed between two revisions:
2023-12-11T18:57:17.4078427Z     This fetches previously deployed versions of a release
2023-12-11T18:57:17.4079739Z   and compares them. This can be used visualize what changes
2023-12-11T18:57:17.4081469Z   were made during revision change.
2023-12-11T18:57:17.4082091Z 
2023-12-11T18:57:17.4082638Z * Shows a diff explaining what a helm rollback would change:
2023-12-11T18:57:17.4084711Z     This fetches the currently deployed version of a release
2023-12-11T18:57:17.4086175Z   and compares it to the previously deployed version of the release, that you
2023-12-11T18:57:17.4087671Z   want to rollback. This can be used visualize what changes a
2023-12-11T18:57:17.4088828Z   helm rollback will perform.
2023-12-11T18:57:17.4089371Z 
2023-12-11T18:57:17.4097035Z Usage:
2023-12-11T18:57:17.4097816Z   diff [flags]
2023-12-11T18:57:17.4098604Z   diff [command]
2023-12-11T18:57:17.4099115Z 
2023-12-11T18:57:17.4099499Z Available Commands:
2023-12-11T18:57:17.4100686Z   completion  Generate the autocompletion script for the specified shell
2023-12-11T18:57:17.4102378Z   release     Shows diff between release's manifests
2023-12-11T18:57:17.4104975Z   revision    Shows diff between revision's manifests
2023-12-11T18:57:17.4106770Z   rollback    Show a diff explaining what a helm rollback could perform
2023-12-11T18:57:17.4108294Z   upgrade     Show a diff explaining what a helm upgrade would change.
2023-12-11T18:57:17.4109565Z   version     Show version of the helm diff plugin
2023-12-11T18:57:17.4110271Z 
2023-12-11T18:57:17.4110511Z Flags:
2023-12-11T18:57:17.4111787Z       --allow-unreleased                 enables diffing of releases that are not yet deployed via Helm
2023-12-11T18:57:17.4113792Z   -a, --api-versions stringArray         Kubernetes api versions used for Capabilities.APIVersions
2023-12-11T18:57:17.4117546Z       --color                            color output. You can control the value for this flag via HELM_DIFF_COLOR=[true|false]. If both --no-color and --color are unspecified, coloring enabled only when the stdout is a term and TERM is not "dumb"
2023-12-11T18:57:17.4120553Z   -C, --context int                      output NUM lines of context around changes (default -1)
2023-12-11T18:57:17.4122327Z       --detailed-exitcode                return a non-zero exit code when there are changes
2023-12-11T18:57:17.4124460Z       --devel                            use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.
2023-12-11T18:57:17.4127504Z       --disable-openapi-validation       disables rendered templates validation against the Kubernetes OpenAPI Schema
2023-12-11T18:57:17.4130630Z       --disable-validation               disables rendered templates validation against the Kubernetes cluster you are currently pointing to. This is the same validation performed on an install
2023-12-11T18:57:17.4133898Z       --dry-run                          disables cluster access and show diff as if it was install. Implies --install, --reset-values, and --disable-validation
2023-12-11T18:57:17.4138688Z   -D, --find-renames float32             Enable rename detection if set to any value greater than 0. If specified, the value denotes the maximum fraction of changed content as lines added + removed compared to total lines in a diff for considering it a rename. Only objects of the same Kind are attempted to be matched
2023-12-11T18:57:17.4142627Z   -h, --help                             help for diff
2023-12-11T18:57:17.4144160Z       --include-tests                    enable the diffing of the helm test hooks
2023-12-11T18:57:17.4145880Z       --insecure-skip-tls-verify         skip tls certificate checks for the chart download
2023-12-11T18:57:17.4148521Z       --install                          enables diffing of releases that are not yet deployed via Helm (equivalent to --allow-unreleased, added to match "helm upgrade --install" command
2023-12-11T18:57:17.4151013Z       --kube-version string              Kubernetes version used for Capabilities.KubeVersion
2023-12-11T18:57:17.4152949Z       --kubeconfig string                This flag is ignored, to allow passing of this top level flag to helm
2023-12-11T18:57:17.4155725Z       --no-color                         remove colors from the output. If both --no-color and --color are unspecified, coloring enabled only when the stdout is a term and TERM is not "dumb"
2023-12-11T18:57:17.4158035Z       --no-hooks                         disable diffing of hooks
2023-12-11T18:57:17.4159894Z       --normalize-manifests              normalize manifests before running diff to exclude style differences from the output
2023-12-11T18:57:17.4163126Z       --output string                    Possible values: diff, simple, template, dyff. When set to "template", use the env var HELM_DIFF_TPL to specify the template. (default "diff")
2023-12-11T18:57:17.4169546Z       --post-renderer string             the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path
2023-12-11T18:57:17.4172782Z       --post-renderer-args stringArray   an argument to the post-renderer (can specify multiple)
2023-12-11T18:57:17.4175371Z       --repo string                      specify the chart repository url to locate the requested chart
2023-12-11T18:57:17.4177450Z       --reset-values                     reset the values to the ones built into the chart and merge in any new values
2023-12-11T18:57:17.4179904Z       --reuse-values                     reuse the last release's values and merge in any new values. If '--reset-values' is specified, this is ignored
2023-12-11T18:57:17.4182596Z       --set stringArray                  set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
2023-12-11T18:57:17.4185924Z       --set-file stringArray             set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
2023-12-11T18:57:17.4189351Z       --set-string stringArray           set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
2023-12-11T18:57:17.4191824Z       --show-secrets                     do not redact secret values in the output
2023-12-11T18:57:17.4193442Z       --strip-trailing-cr                strip trailing carriage return on input
2023-12-11T18:57:17.4195220Z       --suppress stringArray             allows suppression of the values listed in the diff output
2023-12-11T18:57:17.4196898Z   -q, --suppress-secrets                 suppress secrets in the output
2023-12-11T18:57:17.4198614Z       --three-way-merge                  use three-way-merge to compute patch and generate diff output
2023-12-11T18:57:17.4200613Z   -f, --values valueFiles                specify values in a YAML file (can specify multiple) (default [])
2023-12-11T18:57:17.4202827Z       --version string                   specify the exact chart version to use. If this is not specified, the latest version is used
2023-12-11T18:57:17.4204082Z 
2023-12-11T18:57:17.4204384Z Additional help topics:
2023-12-11T18:57:17.4205149Z   diff            
2023-12-11T18:57:17.4205567Z 
2023-12-11T18:57:17.4206248Z Use "diff [command] --help" for more information about a command.
2023-12-11T18:57:17.4268585Z Installed plugin: diff
2023-12-11T18:57:17.4333933Z [command]/opt/hostedtoolcache/helm/3.13.2/x64/helm plugin list
2023-12-11T18:57:17.4992414Z NAME	VERSION	DESCRIPTION                           
2023-12-11T18:57:17.4993789Z diff	3.8.1  	Preview helm upgrade changes as a diff
2023-12-11T18:57:17.5028619Z [command]/opt/hostedtoolcache/helmfile/0.159.0/x64/helmfile diff -f prod-opsstack/helm/helmfile.yaml --skip-diff-on-install --color --detailed-exitcode --context 10
2023-12-11T18:57:19.4019055Z Adding repo grafana https://grafana.github.io/helm-charts
2023-12-11T18:57:19.9191048Z "grafana" has been added to your repositories
2023-12-11T18:57:19.9192841Z 
2023-12-11T18:57:19.9195465Z Adding repo jetstack https://charts.jetstack.io
2023-12-11T18:57:20.1488755Z "jetstack" has been added to your repositories
2023-12-11T18:57:20.1489539Z 
2023-12-11T18:57:20.1490502Z Adding repo ingress-nginx https://kubernetes.github.io/ingress-nginx
2023-12-11T18:57:20.3458739Z "ingress-nginx" has been added to your repositories
2023-12-11T18:57:20.3459540Z 
2023-12-11T18:57:20.3460339Z Adding repo external-dns https://kubernetes-sigs.github.io/external-dns
2023-12-11T18:57:20.4647333Z "external-dns" has been added to your repositories
2023-12-11T18:57:20.4649028Z 
2023-12-11T18:57:20.4650792Z Adding repo oauth2-proxy https://oauth2-proxy.github.io/manifests
2023-12-11T18:57:20.6782021Z "oauth2-proxy" has been added to your repositories
2023-12-11T18:57:20.6783138Z 
2023-12-11T18:57:20.6785073Z Adding repo velero https://vmware-tanzu.github.io/helm-charts/
2023-12-11T18:57:20.8552227Z "velero" has been added to your repositories
2023-12-11T18:57:20.8553593Z 
2023-12-11T18:57:20.8556634Z Building dependency release=opsstack-crds, chart=../../charts/opsstack-crds
2023-12-11T18:57:21.7704908Z Hang tight while we grab the latest from your chart repositories...
2023-12-11T18:57:21.7707668Z ...Successfully got an update from the "external-dns" chart repository
2023-12-11T18:57:21.7710987Z ...Successfully got an update from the "velero" chart repository
2023-12-11T18:57:21.7713361Z ...Successfully got an update from the "ingress-nginx" chart repository
2023-12-11T18:57:21.7715461Z ...Successfully got an update from the "oauth2-proxy" chart repository
2023-12-11T18:57:21.7754040Z ...Successfully got an update from the "jetstack" chart repository
2023-12-11T18:57:21.7755543Z ...Successfully got an update from the "grafana" chart repository
2023-12-11T18:57:21.7757268Z Update Complete. ⎈Happy Helming!⎈
2023-12-11T18:57:21.7758196Z Saving 1 charts
2023-12-11T18:57:21.7759337Z Dependency crds did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:21.7760813Z Deleting outdated charts
2023-12-11T18:57:21.7761301Z 
2023-12-11T18:57:21.7761895Z Building dependency release=opsstack, chart=../../charts/opsstack
2023-12-11T18:57:31.1823561Z Hang tight while we grab the latest from your chart repositories...
2023-12-11T18:57:31.1827187Z ...Successfully got an update from the "external-dns" chart repository
2023-12-11T18:57:31.1830276Z ...Successfully got an update from the "ingress-nginx" chart repository
2023-12-11T18:57:31.1832459Z ...Successfully got an update from the "oauth2-proxy" chart repository
2023-12-11T18:57:31.1845180Z ...Successfully got an update from the "velero" chart repository
2023-12-11T18:57:31.1847253Z ...Successfully got an update from the "jetstack" chart repository
2023-12-11T18:57:31.1849213Z ...Successfully got an update from the "grafana" chart repository
2023-12-11T18:57:31.1850769Z Update Complete. ⎈Happy Helming!⎈
2023-12-11T18:57:31.1851619Z Saving 23 charts
2023-12-11T18:57:31.1852933Z Dependency dashboards did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1855123Z Dependency prometheus-rules did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1857287Z Dependency m365-exporter did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1859652Z Dependency azure-loganalytics-exporter did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1862885Z Dependency azure-metrics-exporter did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1865776Z Dependency azure-resourcemanager-exporter did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1868310Z Dependency azure-resourcegraph-exporter did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1870765Z Dependency grafana-agent-config did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1872883Z Dependency webshell did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1874770Z Dependency trivy did not declare a repository. Assuming it exists in the charts directory
2023-12-11T18:57:31.1876830Z Downloading kube-prometheus-stack from repo oci://ghcr.io/prometheus-community/charts
2023-12-11T18:57:31.1878715Z Downloading thanos from repo oci://registry-1.docker.io/bitnamicharts
2023-12-11T18:57:31.1880354Z Downloading grafana from repo https://grafana.github.io/helm-charts
2023-12-11T18:57:31.1883066Z Downloading loki from repo https://grafana.github.io/helm-charts
2023-12-11T18:57:31.1884691Z Downloading promtail from repo https://grafana.github.io/helm-charts
2023-12-11T18:57:31.1886538Z Downloading kubernetes-event-exporter from repo oci://registry-1.docker.io/bitnamicharts
2023-12-11T18:57:31.1889347Z Downloading prometheus-blackbox-exporter from repo oci://ghcr.io/prometheus-community/charts
2023-12-11T18:57:31.1891452Z Downloading jiralert from repo oci://ghcr.io/prometheus-community/charts
2023-12-11T18:57:31.1893051Z Downloading cert-manager from repo https://charts.jetstack.io
2023-12-11T18:57:31.1894985Z Downloading ingress-nginx from repo https://kubernetes.github.io/ingress-nginx
2023-12-11T18:57:31.1897665Z Downloading external-dns from repo https://kubernetes-sigs.github.io/external-dns
2023-12-11T18:57:31.1899503Z Downloading velero from repo https://vmware-tanzu.github.io/helm-charts/
2023-12-11T18:57:31.1901225Z Downloading oauth2-proxy from repo https://oauth2-proxy.github.io/manifests
2023-12-11T18:57:31.1902852Z Deleting outdated charts
2023-12-11T18:57:31.1905239Z 
2023-12-11T18:57:31.1905810Z Listing releases matching ^opsstack-crds$
2023-12-11T18:57:31.2398791Z confirming if the release is already installed or not: command "/opt/hostedtoolcache/helm/3.13.2/x64/helm" exited with non-zero status:
2023-12-11T18:57:31.2403425Z 
2023-12-11T18:57:31.2403985Z PATH:
2023-12-11T18:57:31.2405045Z   /opt/hostedtoolcache/helm/3.13.2/x64/helm
2023-12-11T18:57:31.2405917Z 
2023-12-11T18:57:31.2406816Z ARGS:
2023-12-11T18:57:31.2407684Z   0: helm (4 bytes)
2023-12-11T18:57:31.2466759Z   1: list (4 bytes)
2023-12-11T18:57:31.2467731Z   2: --filter (8 bytes)
2023-12-11T18:57:31.2468594Z   3: ^opsstack-crds$ (15 bytes)
2023-12-11T18:57:31.2469512Z   4: --namespace (11 bytes)
2023-12-11T18:57:31.2471186Z   5: opsstack-crds (13 bytes)
2023-12-11T18:57:31.2472092Z   6: --uninstalling (14 bytes)
2023-12-11T18:57:31.2472951Z   7: --deployed (10 bytes)
2023-12-11T18:57:31.2473772Z   8: --failed (8 bytes)
2023-12-11T18:57:31.2474568Z   9: --pending (9 bytes)
2023-12-11T18:57:31.2475045Z 
2023-12-11T18:57:31.2475281Z ERROR:
2023-12-11T18:57:31.2475895Z   exit status 1
2023-12-11T18:57:31.2476309Z 
2023-12-11T18:57:31.2476578Z EXIT STATUS
2023-12-11T18:57:31.2477169Z   1
2023-12-11T18:57:31.2479252Z 
2023-12-11T18:57:31.2479508Z STDERR:
2023-12-11T18:57:31.2497816Z   Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused
2023-12-11T18:57:31.2499240Z 
2023-12-11T18:57:31.2499531Z COMBINED OUTPUT:
2023-12-11T18:57:31.2501067Z   Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused
2023-12-11T18:57:31.2502772Z Listing releases matching ^opsstack$
2023-12-11T18:57:31.2964720Z confirming if the release is already installed or not: command "/opt/hostedtoolcache/helm/3.13.2/x64/helm" exited with non-zero status:
2023-12-11T18:57:31.2967093Z 
2023-12-11T18:57:31.2967493Z PATH:
2023-12-11T18:57:31.2968526Z   /opt/hostedtoolcache/helm/3.13.2/x64/helm
2023-12-11T18:57:31.2971705Z 
2023-12-11T18:57:31.2972030Z ARGS:
2023-12-11T18:57:31.2972772Z   0: helm (4 bytes)
2023-12-11T18:57:31.2973672Z   1: list (4 bytes)
2023-12-11T18:57:31.2975081Z   2: --filter (8 bytes)
2023-12-11T18:57:31.2976004Z   3: ^opsstack$ (10 bytes)
2023-12-11T18:57:31.2977001Z   4: --namespace (11 bytes)
2023-12-11T18:57:31.2977907Z   5: opsstack (8 bytes)
2023-12-11T18:57:31.3028153Z   6: --uninstalling (14 bytes)
2023-12-11T18:57:31.3029096Z   7: --deployed (10 bytes)
2023-12-11T18:57:31.3029910Z   8: --failed (8 bytes)
2023-12-11T18:57:31.3030708Z   9: --pending (9 bytes)
2023-12-11T18:57:31.3031196Z 
2023-12-11T18:57:31.3031426Z ERROR:
2023-12-11T18:57:31.3032062Z   exit status 1
2023-12-11T18:57:31.3032475Z 
2023-12-11T18:57:31.3032759Z EXIT STATUS
2023-12-11T18:57:31.3033352Z   1
2023-12-11T18:57:31.3033693Z 
2023-12-11T18:57:31.3033922Z STDERR:
2023-12-11T18:57:31.3036759Z   Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused
2023-12-11T18:57:31.3038134Z 
2023-12-11T18:57:31.3038419Z COMBINED OUTPUT:
2023-12-11T18:57:31.3039943Z   Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused
2023-12-11T18:57:31.3041621Z Affected releases are:
2023-12-11T18:57:31.3042473Z   opsstack (../../charts/opsstack) UPDATED
2023-12-11T18:57:31.3043684Z   opsstack-crds (../../charts/opsstack-crds) UPDATED
2023-12-11T18:57:31.3044426Z 
2023-12-11T18:57:31.3044750Z Identified at least one change

@jkroepke I review the logic. it's expected behaver. you can see the logs like: "confirming if the release is already installed or not", please try to find why do helm can't access k8s.

In conclusion, if the Kubernetes cannot be reach, its the expected behavior has helmfile ends with exit code 0?

@jkroepke you can post a issue in helmfile/helmfile. helmfile will check whether release be installed by running helm list when installed is false. if has error. it only print an warn log.

@jkroepke My english is not good. I wanna know whether you understand me.

Thanks, you moved this already.

helmfile will check whether release be installed by running helm list when installed is false. if has error. it only print an warn log.

I would like to ask here, why?

Because, if helm list does not find any releases, it will return exit code zero, even if the remote namespace does not exist.

% helm list --filter '^opsstack$' --namespace opsstack2 --uninstalling --deployed --failed --pending; echo $?
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
0

@jkroepke I don't konw the reason. but I will try to explain that.

		v, err := st.isReleaseInstalled(st.createHelmContext(r, 0), helm, *r)
		if err != nil {
			st.logger.Warnf("confirming if the release is already installed or not: %v", err)
		} else {
			installedReleases[id] = v
		}

/cc @mumoshu WDYT? it only logs a warning log when it has an error.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

No stale

@mumoshu could you review this issue? thanks so much.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

not stale

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Not stale

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Not stale

@yxxhero would it possible to mark this as lifecycle frozen? I will keep this open anyways.

@jkroepke do you have some good idea for this case? share it with us.

The label "in progress" should sufficient.

# Issues with these labels will never be considered stale
exemptLabels:
- in progress
- pinned
- security
- bug

Other labels are lifecycle/frozen. At the end, its always a specific label with is getting added to the exclusion list.

@jkroepke oh. I mean that the idea about how to fix the issue.

		v, err := st.isReleaseInstalled(st.createHelmContext(r, 0), helm, *r)
		if err != nil {
			st.logger.Warnf("confirming if the release is already installed or not: %v", err)
		} else {
			installedReleases[id] = v
		}

/cc @mumoshu WDYT? it only logs a warning log when it has an error.

I guess replace warn with error should cover this.

I test the helm list command and it also return exit code 0, if no releases has been matched. But I have no idea about regressions..