aws-actions / configure-aws-credentials

Configure AWS credential environment variables for use in other GitHub Actions.
MIT License
2.43k stars 466 forks source link

Proxy support does not work when moving from v2 to v4 #1061

Open RaviVadera opened 4 months ago

RaviVadera commented 4 months ago

Describe the bug

We are using v2 behind a proxy. Proxy is setup through env vars and not explicitly on the action inputs. We are attempting to move to v4 because of deprecation of Node 16 actions and since Node 20 support is only available on v4. Proxy support on v4 does not work and fails with Error: connect ETIMEDOUT xxx.xxx.xxx.xxx:443.

Expected Behavior

Update to v4 should would without any changes to the action as I do not see that there is any breaking change from changelog.

Current Behavior

Updating action from v2 to v4 fails with Error: connect ETIMEDOUT xxx.xxx.xxx.xxx:443.

Reproduction Steps

  1. Use the v2 action behind a proxy, set the env vars in GH action, the action should be successful.
    
    env:
    http_proxy: xxxx
    https_proxy: xxxx
    no_proxy: xxxx

jobs: test: name: Test runs-on: group: xxxx environment: name: ${{ inputs.environment-name }} container: image: xxxx

steps:
  - name: Configure AWS Credentials
    uses: aws-actions/configure-aws-credentials@v2
    with:
      aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      aws-region: ${{ vars.AWS_REGION }}
2. Update the action by just changing the version to v4.
```diff
env:
  http_proxy: xxxx
  https_proxy: xxxx
  no_proxy: xxxx

jobs:
  test:
    name: Test
    runs-on:
      group: xxxx
    environment:
      name: ${{ inputs.environment-name }}
    container:
      image: xxxx

    steps:
      - name: Configure AWS Credentials
-        uses: aws-actions/configure-aws-credentials@v2
+        uses: aws-actions/configure-aws-credentials@v4
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: ${{ vars.AWS_REGION }}

Possible Solution

From the comment at https://github.com/aws-actions/configure-aws-credentials/issues/861#issuecomment-1730183352, it looks like there is a change in proxy implementation on v3 which can be the cause of failure. We tried updating from v2 to v3 and can confirm that proxy does not work even on v3.

Additional Information/Context

No response

tim-finnigan commented 2 months ago

Here is documentation on proxy configuration: https://github.com/aws-actions/configure-aws-credentials?tab=readme-ov-file#proxy-configuration

Have you tried using http-proxy as documented there? What error are you getting?

RaviVadera commented 2 months ago

@tim-finnigan all infromation included above already. But to reiterate,

We are relying on action to take the proxy from env (as indicated by documentation Additionally this action will always consider the HTTP_PROXY environment variable.), so not configuring http-proxy explicitly.

As for the error,

Proxy support on v4 does not work and fails with Error: connect ETIMEDOUT xxx.xxx.xxx.xxx:443.