mamezou-tech / setup-helmfile

Setup helmfile action
MIT License
41 stars 20 forks source link

helm plugin install failes on private runner #48

Open jkroepke opened 1 year ago

jkroepke commented 1 year ago
2023-02-23T14:31:10.6611119Z ##[group]Run mamezou-tech/setup-helmfile@v1.2.0
2023-02-23T14:31:10.6611464Z with:
2023-02-23T14:31:10.6611706Z   kubectl-version: 1.24.7
2023-02-23T14:31:10.6612005Z   kubectl-release-date: 2022-10-31
2023-02-23T14:31:10.6612304Z   helm-version: v3.10.2
2023-02-23T14:31:10.6612571Z   helmfile-version: v0.148.1
2023-02-23T14:31:10.6612856Z   install-kubectl: yes
2023-02-23T14:31:10.6613124Z   install-helm: yes
2023-02-23T14:31:10.6613390Z   install-helm-plugins: yes
2023-02-23T14:31:10.6613709Z   helm-diff-plugin-version: master
2023-02-23T14:31:10.6614032Z   helm-s3-plugin-version: master
2023-02-23T14:31:10.6614307Z ##[endgroup]
2023-02-23T14:31:10.7575695Z Downloading from : https://amazon-eks.s3-us-west-2.amazonaws.com/1.24.7/2022-10-31/bin/linux/amd64/kubectl
2023-02-23T14:31:10.7652273Z Downloading from : https://get.helm.sh/helm-v3.10.2-linux-amd64.tar.gz
2023-02-23T14:31:12.9156438Z Finish downloading. : /_work/_temp/4ed8f320-ff31-405b-8f15-d694a7f793e6
2023-02-23T14:31:12.9964211Z [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /_work/_temp/1eb68175-ddef-4171-8b9e-49202436a409 -f /_work/_temp/4ed8f320-ff31-405b-8f15-d694a7f793e6
2023-02-23T14:31:14.3491884Z /_work/_temp/1eb68175-ddef-4171-8b9e-49202436a409
2023-02-23T14:31:14.5252258Z [command]/usr/bin/chmod +x /home/runner/bin/helm
2023-02-23T14:31:14.5409678Z Downloading from : https://github.com/helmfile/helmfile/releases/download/v0.148.1/helmfile_0.148.1_linux_amd64.tar.gz
2023-02-23T14:31:14.5813330Z [command]/home/runner/bin/helm plugin install https://github.com/databus23/helm-diff --version master
2023-02-23T14:31:15.3531705Z Error: plugin already exists
2023-02-23T14:31:15.3663307Z /_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010
2023-02-23T14:31:15.3692039Z                 error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
2023-02-23T14:31:15.3692732Z                         ^
2023-02-23T14:31:15.3693732Z 
2023-02-23T14:31:15.3694252Z Error: The process '/home/runner/bin/helm' failed with exit code 1
2023-02-23T14:31:15.3695017Z     at ExecState._setResult (/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010:25)
2023-02-23T14:31:15.3695910Z     at ExecState.CheckComplete (/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:993:18)
2023-02-23T14:31:15.3697199Z     at ChildProcess.<anonymous> (/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:887:27)
2023-02-23T14:31:15.3697805Z     at ChildProcess.emit (node:events:527:28)
2023-02-23T14:31:15.3698325Z     at maybeClose (node:internal/child_process:1092:16)
2023-02-23T14:31:15.3698834Z     at Socket.<anonymous> (node:internal/child_process:451:11)
2023-02-23T14:31:15.3699246Z     at Socket.emit (node:events:527:28)
2023-02-23T14:31:15.3699641Z     at Pipe.<anonymous> (node:net:709:12)

I guess setting the env variable HELM_DATA_HOME to an tmp directory should fix this issue.

kondoumh commented 1 year ago

Thank you for your report.

Does "private runner" mean self-hosted runner?

I guess setting the env variable HELM_DATA_HOME to an tmp directory should fix this issue.

I'm not familiar with the HELM_DATA_HOME environment variable, can't this be set by the user in the workflow?

jkroepke commented 1 year ago

This is true. But it would be great if the Action chrck if the plugin is present, than run helm plugin list or omit the download.

Kalvin2077 commented 1 year ago

Hello @jkroepke!

I meet the same issue but I guess it's because of the network.

I thought of two solutions

Did you use dockerfile to install the helmfile plugins directly?

2023-02-25T02:57:38.5639390Z ##[group]Run mamezou-tech/setup-helmfile@v1.2.0
2023-02-25T02:57:38.5639985Z with:
2023-02-25T02:57:38.5640488Z   helmfile-version: v0.148.1
2023-02-25T02:57:38.5641050Z   helm-version: v3.10.2
2023-02-25T02:57:38.5641788Z   additional-helm-plugins: https://github.com/jkroepke/helm-secrets --version v4.2.1
2023-02-25T02:57:38.5642508Z   kubectl-version: 1.24.7
2023-02-25T02:57:38.5643095Z   kubectl-release-date: 2022-10-31
2023-02-25T02:57:38.5643676Z   install-kubectl: yes
2023-02-25T02:57:38.5644287Z   install-helm: yes
2023-02-25T02:57:38.5644848Z   install-helm-plugins: yes
2023-02-25T02:57:38.5645442Z   helm-diff-plugin-version: master
2023-02-25T02:57:38.5646266Z   helm-s3-plugin-version: master
2023-02-25T02:57:38.5646777Z env:
2023-02-25T02:57:38.5647565Z   VAULT_ADDR: xxx
2023-02-25T02:57:38.5648342Z   VAULT_NAMESPACE: xxx
2023-02-25T02:57:38.5648878Z   VAULT_FORMAT: json
2023-02-25T02:57:38.5649441Z   http_proxy: http://gfw:7890
2023-02-25T02:57:38.5650008Z   https_proxy: http://gfw:7890
2023-02-25T02:57:38.5650538Z ##[endgroup]
2023-02-25T02:57:38.6218834Z Downloading from : https://amazon-eks.s3-us-west-2.amazonaws.com/1.24.7/2022-10-31/bin/linux/amd64/kubectl
2023-02-25T02:57:38.6233190Z Downloading from : https://get.helm.sh/helm-v3.10.2-linux-amd64.tar.gz
2023-02-25T02:57:40.9695341Z Finish downloading. : /runner/_work/_temp/c2592b65-dc65-41af-b46d-6003c52ece7d
2023-02-25T02:57:40.9784904Z [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /runner/_work/_temp/50f30c4b-3f6a-4dd4-be89-197f9db53f20 -f /runner/_work/_temp/c2592b65-dc65-41af-b46d-6003c52ece7d
2023-02-25T02:57:41.3151824Z /runner/_work/_temp/50f30c4b-3f6a-4dd4-be89-197f9db53f20
2023-02-25T02:57:41.3611786Z [command]/usr/bin/chmod +x /home/runner/bin/helm
2023-02-25T02:57:41.3655652Z Downloading from : https://github.com/helmfile/helmfile/releases/download/v0.148.1/helmfile_0.148.1_linux_amd64.tar.gz
2023-02-25T02:57:41.3687805Z [command]/home/runner/bin/helm plugin install https://github.com/databus23/helm-diff --version master
2023-02-25T02:57:41.3729768Z [command]/home/runner/bin/helm plugin install https://github.com/jkroepke/helm-secrets --version v4.2.1
2023-02-25T02:57:43.4736754Z Finish downloading. : /runner/_work/_temp/4902d6ed-d42f-4d0f-a284-f5c1d93056bb
2023-02-25T02:57:43.4791237Z [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /runner/_work/_temp/ae1f1541-753e-4269-b6f6-d4b13e10c5af -f /runner/_work/_temp/4902d6ed-d42f-4d0f-a284-f5c1d93056bb
2023-02-25T02:57:43.8651334Z /runner/_work/_temp/ae1f1541-753e-4269-b6f6-d4b13e10c5af
2023-02-25T02:57:43.9108862Z [command]/usr/bin/chmod +x /home/runner/bin/helmfile
2023-02-25T02:57:44.1719110Z Downloading https://github.com/databus23/helm-diff/releases/latest/download/helm-diff-linux-amd64.tgz
2023-02-25T02:57:45.9925709Z Finish downloading. : /runner/_work/_temp/68417b40-f72a-4300-b092-efdcb6fa814c
2023-02-25T02:57:46.0315204Z [command]/usr/bin/chmod +x /home/runner/bin/kubectl
2023-02-25T02:57:47.7575171Z Error: Unable to get repository: Cloning into '/home/runner/.cache/helm/plugins/https-github.com-jkroepke-helm-secrets'...
2023-02-25T02:57:47.7576813Z fatal: unable to access 'https://github.com/jkroepke/helm-secrets/': gnutls_handshake() failed: Error in the pull function.
2023-02-25T02:57:47.7577782Z : exit status 128
2023-02-25T02:57:47.7659106Z /runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010
2023-02-25T02:57:47.7663189Z                 error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
2023-02-25T02:57:47.7665971Z                         ^
2023-02-25T02:57:47.7666816Z 
2023-02-25T02:57:47.7668351Z Error: The process '/home/runner/bin/helm' failed with exit code 1
2023-02-25T02:57:47.7670125Z     at ExecState._setResult (/runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010:25)
2023-02-25T02:57:47.7672196Z     at ExecState.CheckComplete (/runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:993:18)
2023-02-25T02:57:47.7674178Z     at ChildProcess.<anonymous> (/runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:887:27)
2023-02-25T02:57:47.7675473Z     at ChildProcess.emit (node:events:527:28)
2023-02-25T02:57:47.7677283Z     at maybeClose (node:internal/child_process:1092:16)
2023-02-25T02:57:47.7678667Z     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

and

2023-02-27T06:44:11.1174249Z ##[group]Run mamezou-tech/setup-helmfile@v1.2.0
2023-02-27T06:44:11.1174890Z with:
2023-02-27T06:44:11.1175410Z   helmfile-version: v0.148.1
2023-02-27T06:44:11.1175983Z   helm-version: v3.10.2
2023-02-27T06:44:11.1176699Z   additional-helm-plugins: https://github.com/jkroepke/helm-secrets --version v4.2.1
2023-02-27T06:44:11.1177403Z   kubectl-version: 1.24.7
2023-02-27T06:44:11.1178097Z   kubectl-release-date: 2022-10-31
2023-02-27T06:44:11.1178688Z   install-kubectl: yes
2023-02-27T06:44:11.1179334Z   install-helm: yes
2023-02-27T06:44:11.1179905Z   install-helm-plugins: yes
2023-02-27T06:44:11.1180485Z   helm-diff-plugin-version: master
2023-02-27T06:44:11.1181377Z   helm-s3-plugin-version: master
2023-02-27T06:44:11.1181916Z env:
2023-02-27T06:44:11.1182666Z   VAULT_ADDR: xxx
2023-02-27T06:44:11.1183407Z   VAULT_NAMESPACE: xxx
2023-02-27T06:44:11.1183942Z   VAULT_FORMAT: xxx
2023-02-27T06:44:11.1184538Z   http_proxy: http://gfw:7890
2023-02-27T06:44:11.1185100Z   https_proxy: http://gfw:7890
2023-02-27T06:44:11.1185636Z ##[endgroup]
2023-02-27T06:44:11.1613885Z Downloading from : https://amazon-eks.s3-us-west-2.amazonaws.com/1.24.7/2022-10-31/bin/linux/amd64/kubectl
2023-02-27T06:44:11.1626523Z Downloading from : https://get.helm.sh/helm-v3.10.2-linux-amd64.tar.gz
2023-02-27T06:47:36.3046709Z Finish downloading. : /runner/_work/_temp/3c9cf47b-d356-4ed2-882b-db9dbe7a6875
2023-02-27T06:47:36.3117316Z [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /runner/_work/_temp/eafbda8b-1b53-43f1-b6e6-1371a2e0aaf7 -f /runner/_work/_temp/3c9cf47b-d356-4ed2-882b-db9dbe7a6875
2023-02-27T06:47:36.5797849Z /runner/_work/_temp/eafbda8b-1b53-43f1-b6e6-1371a2e0aaf7
2023-02-27T06:47:36.6009785Z [command]/usr/bin/chmod +x /home/runner/bin/helm
2023-02-27T06:47:36.6037469Z Downloading from : https://github.com/helmfile/helmfile/releases/download/v0.148.1/helmfile_0.148.1_linux_amd64.tar.gz
2023-02-27T06:47:36.6054746Z [command]/home/runner/bin/helm plugin install https://github.com/databus23/helm-diff --version master
2023-02-27T06:47:36.6068248Z [command]/home/runner/bin/helm plugin install https://github.com/jkroepke/helm-secrets --version v4.2.1
2023-02-27T06:48:00.0558996Z Downloading https://github.com/databus23/helm-diff/releases/latest/download/helm-diff-linux-amd64.tgz
2023-02-27T06:48:46.0748603Z Installed plugin: secrets
2023-02-27T06:49:00.5461989Z curl: (35) error:0A000126:SSL routines::unexpected eof while reading
2023-02-27T06:49:00.5465761Z Failed to install helm-diff
2023-02-27T06:49:00.5466567Z    For support, go to https://github.com/databus23/helm-diff.
2023-02-27T06:49:00.5467982Z Error: plugin install hook for "diff" exited with error
2023-02-27T06:49:00.5500771Z /runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010
2023-02-27T06:49:00.5502722Z                 error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
2023-02-27T06:49:00.5503763Z                         ^
2023-02-27T06:49:00.5504208Z 
2023-02-27T06:49:00.5504825Z Error: The process '/home/runner/bin/helm' failed with exit code 1
2023-02-27T06:49:00.5506168Z     at ExecState._setResult (/runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010:25)
2023-02-27T06:49:00.5507600Z     at ExecState.CheckComplete (/runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:993:18)
2023-02-27T06:49:00.5509181Z     at ChildProcess.<anonymous> (/runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:887:27)
2023-02-27T06:49:00.5510468Z     at ChildProcess.emit (node:events:527:28)
2023-02-27T06:49:00.5511701Z     at maybeClose (node:internal/child_process:1092:16)
2023-02-27T06:49:00.5512872Z     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
jkroepke commented 1 year ago

I meet the same issue but I guess it's because of the network.

Yes, it seems like an networking and a different issue compared to my one

jkroepke commented 1 year ago

I'm not familiar with the HELM_DATA_HOME environment variable, can't this be set by the user in the workflow?

Its a bit tricky here, I not able to set this on a workflow level:

env:
  HELM_DATA_HOME: "${{ runner.temp }]"
asomir commented 1 year ago

We faced the 404 Code

Run mamezou-tech/setup-helmfile@v1.2.0
Downloading from : https://amazon-eks.s3-us-west-2.amazonaws.com/1.22.13/2022-10-31/bin/linux/amd64/kubectl
Downloading from : https://get.helm.sh/helm-v3.8.2-linux-amd64.tar.gz
Finish downloading. : /opt/actions-runner/_work/_temp/ca7d03a7-46c7-4b62-9027-699a0e82e2a8
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /opt/actions-runner/_work/_temp/81e2793b-192e-4907-a813-645a55521907 -f /opt/actions-runner/_work/_temp/ca7d03a7-46c7-4b62-9027-699a0e82e2a8
/opt/actions-runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:4871
            const err = new HTTPError(response.message.statusCode);
                        ^

HTTPError: Unexpected HTTP response: 404
    at /opt/actions-runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:4871:[25](https://github.com/ExtendTV/Compulse360_FE/actions/runs/4384015973/jobs/7675880616#step:5:26)
    at Generator.next (<anonymous>)
    at fulfilled (/opt/actions-runner/_work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:4781:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  httpStatusCode: 404
}
jkroepke commented 1 year ago

For unknown reasons, this actions uses an AWS EKS endpoint for fetching kubectl. Seems like AWS drop kubernetes 1.22

this works for me (using latest versions)

      - name: Setup helmfile
        uses: mamezou-tech/setup-helmfile@v1.2.0
        with:
          helmfile-version: v0.153.1
          helm-version: v3.11.3
          # https://docs.aws.amazon.com/de_de/eks/latest/userguide/install-kubectl.html
          # https://github.com/mamezou-tech/setup-helmfile/blob/03023676de72fd8179d6a62fea10fbf41c0a175b/src/setup.js#L9-L13
          kubectl-version: 1.25.7
          kubectl-release-date: 2023-03-17
          install-helm-plugins: false
          additional-helm-plugins: https://github.com/databus23/helm-diff --version v3.7.0
rbabyuk-vs commented 1 year ago

I have literary the same problem Run mamezou-tech/setup-helmfile@v1.2.0 Downloading from : https://github.com/helmfile/helmfile/releases/download/v0.148.1/helmfile_0.148.1_linux_amd64.tar.gz /home/runner/helm plugin install https://github.com/databus23/helm-diff --version v3.7.0 WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/runner/work//a9a5f922-e96c-4f08-b3b9-6d4405d36b3e WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/runner/work/a9a5f922-e96c-4f08-b3b9-6d4405d36b3e Error: plugin already exists /home/runner/work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010 error = new Error(The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); ^

Error: The process '/bin/helm' failed with exit code 1 at ExecState._setResult (/home/runner/work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:1010:25) at ExecState.CheckComplete (/home/runner/work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:993:18) at ChildProcess. (/home/runner/work/_actions/mamezou-tech/setup-helmfile/v1.2.0/dist/index.js:887:27) at ChildProcess.emit (node:events:527:28) at maybeClose (node:internal/child_process:1092:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)`

halkeye commented 1 year ago

btw a workaround is to add something like the following to the top of your workflow.

env:
  HELM_CACHE_HOME: "$RUNNER_TEMP/.helm/cache"
  HELM_CONFIG_HOME: "$RUNNER_TEMP/.helm/config"
  HELM_DATA_HOME: "$RUNNER_TEMP/.helm/data"

The workflow can be fixed by changing those env variables to point to somewhere temp for the length of the run, not the global ones that helm uses by default.

https://github.com/helm/helm/blob/f2c6cb8d011ed243aa984570b61237987655a930/pkg/helmpath/lazypath.go#L24-L35

jkroepke commented 1 year ago

@halkeye

The official helmfile action solves the issue pretty well.

halkeye commented 1 year ago

There's an official one? This one comes up first when googling

halkeye commented 1 year ago

Oh nice. https://github.com/helmfile/helmfile-action looks like the real one