Azure / setup-helm

Github Action for installing Helm
MIT License
141 stars 48 forks source link

Failed to download Helm in proxy based environments #51

Closed burakhoban closed 3 years ago

burakhoban commented 3 years ago

We are attempting to leverage azure/setup-helm@v1 in a self-hosted runner environment which requires proxy configuration if wanting to access artifacts from the Internet. What we're seeing is that the actual download of the Helm charts is timing out and it looks like the proxy configuration isn't being applied. I've worked with GitHub in attempting to troubleshoot the issue however they've hit a road block and advised to raise an issue due to not being able to further troubleshoot because of typed-rest-client being used to connect to the proxy.

The error we're seeing (debug logs from workflow output):

##[debug]Evaluating condition for step: 'Set up Helm'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Set up Helm
##[debug]Loading inputs
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run azure/setup-helm@v1
##[debug]Downloading v3.2.4
##[debug]isExplicit: 3.2.4
##[debug]explicit? true
##[debug]checking cache: /home/actions/actions-runner/_work/_tool/helm/3.2.4/x64
##[debug]not found
##[debug]Downloading https://get.helm.sh/helm-v3.2.4-linux-amd64.zip
##[debug]Downloading /home/actions/actions-runner/_work/_temp/bb2c4ca1-8372-4782-a925-632994ef13e3
##[debug]Enhanced Annotations not enabled on the server. The 'title', 'end_line', and 'end_column' fields are unsupported.
Error: Error: Failed to download Helm from location  https://get.helm.sh/helm-v3.2.4-linux-amd64.zip
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Set up Helm

We are able to validate that we have no issues downloading the .zip file via curl via the proxy.

Logs of our workload run (taken from runner) show the following:

2021-09-11T07:20:19.3964028Z HTTP 22811: call onSocket 0 0
2021-09-11T07:20:19.3982478Z HTTP 22811: createConnection proxy.xxxx.yyyy:zzzz: {
2021-09-11T07:20:19.3983726Z   host: 'proxy.xxxx.yyyy',
2021-09-11T07:20:19.3984463Z   port: '8080',
2021-09-11T07:20:19.3984984Z   method: 'CONNECT',
2021-09-11T07:20:19.3985396Z   path: null,
2021-09-11T07:20:19.3985790Z   agent: false,
2021-09-11T07:20:19.3986584Z   servername: 'proxy.xxxx.yyyy',
2021-09-11T07:20:19.3987617Z   _agentKey: 'proxy.xxxx.yyyy:zzzz:'
2021-09-11T07:20:19.3988213Z }
2021-09-11T07:20:19.4000321Z HTTP 22811: sockets proxy.xxxx.yyyy:zzzz: 1
2021-09-11T07:20:19.4010898Z HTTP 22811: outgoing message end.
2021-09-11T07:20:19.4014411Z HTTP 22811: outgoing message end.
2021-09-11T07:20:19.4021290Z (node:22811) Warning: Setting the NODE_DEBUG environment variable to 'http' can expose sensitive data (such as passwords, tokens and authentication headers) in the resulting log.
2021-09-11T07:20:59.2894936Z HTTP 22811: AGENT incoming response!
2021-09-11T07:20:59.2900502Z HTTP 22811: CLIENT socket onRemove
2021-09-11T07:20:59.2904182Z HTTP 22811: removeSocket proxy.xxxx.yyyy:zzzz: writable: true

We can see that GitHub Actions passed the proxy configuration to the action, however node.js refuses to connect to the proxy server.

I believe a successfully connection would look something like the below:

HTTP 7594: call onSocket 0 0
HTTP 7594: createConnection 127.0.0.1:9090: {
  host: '127.0.0.1',
  port: '9090',
  method: 'CONNECT',
  path: null,
  agent: false,
  headers: { host: 'pipelines.actions.githubusercontent.com:443' },
  servername: 'pipelines.actions.githubusercontent.com',
  _agentKey: '127.0.0.1:9090:'
}
HTTP 7594: sockets 127.0.0.1:9090: 1
HTTP 7594: outgoing message end.
HTTP 7594: write ret = true
HTTP 7594: outgoing message end.
(node:7594) Warning: Setting the NODE_DEBUG environment variable to 'http' can expose sensitive data (such as passwords, tokens and authentication headers) in the resulting log.
HTTP 7594: AGENT incoming response!
HTTP 7594: CLIENT socket onRemove
HTTP 7594: removeSocket 127.0.0.1:9090: writable: true
HTTP 7594: AGENT incoming response!
HTTP 7594: AGENT socket keep-alive
##[debug]Upload Resource URL: <redacted>
##[debug]File Concurrency: 2, and Chunk Size: 8388608
HTTP 7594: call onSocket 0 0
HTTP 7594: createConnection 127.0.0.1:9090: {
  host: '127.0.0.1',
  port: '9090',
  method: 'CONNECT',
  path: null,
  agent: false,
  headers: { host: 'pipelines.actions.githubusercontent.com:443' },
  servername: 'pipelines.actions.githubusercontent.com',
  _agentKey: '127.0.0.1:9090:'
}
burakhoban commented 3 years ago

Looks like a configuration issue with the Runner. Closing this issue.