Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action does not work behind a proxy #949

Open
RaviVadera opened this issue May 25, 2023 · 3 comments
Open

Action does not work behind a proxy #949

RaviVadera opened this issue May 25, 2023 · 3 comments
Labels
area/cicd impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec size/S Estimated effort to complete (1-2 days).

Comments

@RaviVadera
Copy link

RaviVadera commented May 25, 2023

What happened?

When using the action in a GitHub runner which is behind a proxy, the action does not work and times out waiting for connection. Tried setting necessary http_proxy, https_proxy env vars for the action but it still does not help.

/runner/_work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/got/dist/source/core/index.js:970
            error = error instanceof timed_out_1.TimeoutError ? new TimeoutError(error, this.timings, this) : new RequestError(error.message, error, this);
^
RequestError: connect ETIMEDOUT 185.199.108.133:443
    at ClientRequest.<anonymous> (/runner/_work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/got/dist/source/core/index.js:970:1)
    at Object.onceWrapper (node:events:642:26)
    at ClientRequest.emit (node:events:539:35)
    at ClientRequest.origin.emit (/runner/_work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@szmarczak/http-timer/dist/source/index.js:43:1)
    at TLSSocket.socketErrorListener (node:_http_client:454:9)
    at TLSSocket.emit (node:events:527:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)

Expected Behavior

The action is able to run behind the proxy with necessary env vars set.

Steps to reproduce

Run the action on a runner that is behind a proxy.

Output of pulumi about

CLI
Version 3.68.0
Go Version go1.20.4
Go Compiler gc

Plugins
NAME VERSION
aws 5.18.0
awsx 1.0.2
docker 3.6.1
nodejs unknown

Host
OS ubuntu
Version 20.04
Arch x86_64

This project is written in nodejs: executable='/snap/bin/node' version='v18.16.0'

Backend
Name ********
URL s3://********
User *****
Organizations

Dependencies:
NAME VERSION
@pulumi/aws 5.18.0
@pulumi/awsx 1.0.2
@pulumi/pulumi 3.68.0
@types/node 16.18.32
typescript 4.9.5

Pulumi locates its logs in /tmp by default
warning: Failed to get information about the current stack: No current snapshot

Additional context

Upon checking the code, it seems that the error originates when getting matching version info at

const result = await got(

Adding proxy config to 'got' should fix the issue,
https://github.com/sindresorhus/got/blob/main/documentation/tips.md#proxying

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@RaviVadera RaviVadera added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels May 25, 2023
@RobbieMcKinstry
Copy link
Contributor

Hi @RaviVadera thanks for opening this issue! I think you've correctly diagnosed the issue.
Would it be a possible workaround to add https://get.pulumi.com/ to your allow list?

Alternatively, if you're willing, we'd accept a PR to pass along proxy information to got. WDYT?

@RobbieMcKinstry RobbieMcKinstry added impact/usability Something that impacts users' ability to use the product easily and intuitively size/S Estimated effort to complete (1-2 days). area/cicd and removed needs-triage Needs attention from the triage team labels May 25, 2023
@RaviVadera
Copy link
Author

@RobbieMcKinstry most probably not possible to change the proxy config, I will propose a PR soon-ish.

@CmdrSharp
Copy link

Just hit this issue as well. got doesn't seem to natively support proxies without the use of another agent entirely; and from skimming through the issue history there, it doesn't appear like that's bound to change anytime soon.

got only appears to be used for this one request and currently breaks proxy support for the entire action. Is there a good reason to not just use the native fetch API here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cicd impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec size/S Estimated effort to complete (1-2 days).
Projects
None yet
Development

No branches or pull requests

3 participants