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

no_proxy env setting not taken in consideration #222

Open
denizhoxha opened this issue Dec 9, 2021 · 2 comments
Open

no_proxy env setting not taken in consideration #222

denizhoxha opened this issue Dec 9, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@denizhoxha
Copy link

denizhoxha commented Dec 9, 2021

Describe the bug
The no_proxy environement settings is not taken in consideration when executing github

To Reproduce
Steps to reproduce the behavior:

  1. configure github self-hosted runner with proxy .
  2. configure a action runner workflow which make use of the latest version of github-script to create a team
  3. it throws the following error: Error: Unhandled error: HttpError: request to https://xxxxx/api/v3/orgs/xxxxx/teams failed, reason: tunneling socket could not be established, statusCode=403

Expected behavior
Honoring the no_proxy config

Screenshots
Setup Job:
Current runner version: '2.279.0'
Runner name: 'ip-.........'
Runner group name: '.........'
Machine name: 'ip-.........'
GITHUB_TOKEN Permissions
Runner is running behind proxy server 'htt.........' for all HTTPS requests.
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2'
Download action repository 'actions/github-script@v5'

github-script-task:

Run actions/github-script@v5
  with:
    github-token: ***
    result-encoding: string
    script: await github.rest.teams.create({
            org: 'xxxxx',
            name: 'xxxxx',
            maintainers: [ context.payload.sender.id ]
          });
  
    debug: false
    user-agent: actions/github-script
  env:
    no_proxy: localhost,127.0.0.1,xxxx,xxxx,xxx,xxx,xxx
    NODE_EXTRA_CA_CERTS: ...xxxxx...
(node:10011) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
RequestError [HttpError]: request to https://xxxx/api/v3/orgs/xxxx/teams failed, reason: tunneling socket could not be established, statusCode=403
    at /home/runner/actions-runner/_work/_actions/actions/github-script/v5/dist/index.js:4636:11
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async eval (eval at callAsyncFunction (/home/runner/actions-runner/_work/_actions/actions/github-script/v5/dist/index.js:4942:56), <anonymous>:3:1)
    at async main (/home/runner/actions-runner/_work/_actions/actions/github-script/v5/dist/index.js:4997:20) {
  name: 'HttpError',
  status: 500,
  request: {
    method: 'POST',
    url: 'https://xxxxx/api/v3/orgs/xxxxx/teams',
    headers: {
      accept: 'application/vnd.github.-preview+json',
      'user-agent': 'actions/github-script octokit-core.js/3.5.1 Node.js/12.13.1 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"name":"xxxxx","maintainers":[xxxxx]}',
    request: { agent: [TunnelingAgent], hook: [Function: bound bound register] }
  }
}
Error: Unhandled error: HttpError: request to https://xxxxx/api/v3/orgs/xxxxx/teams failed, reason: tunneling socket could not be established, statusCode=403
@denizhoxha denizhoxha changed the title no_proxy env settings not taken in consideration no_proxy env setting not taken in consideration Dec 9, 2021
@github-actions
Copy link

github-actions bot commented Feb 8, 2022

This issue is stale because it has been open for 60 days with no activity. Remove the "Stale" label or comment on the issue, or it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Feb 8, 2022
@joshmgross joshmgross added bug Something isn't working and removed Stale labels Jan 21, 2023
@mjpieters
Copy link
Contributor

I think this is a actions/toolkit bug instead, since it's the @actions/http-client package that takes care of the proxy configuration (via @actions/github).

In fact, I see that that package has recently had work done to honour no_proxy better, (see actions/toolkit@8d92c9c and actions/toolkit#1172).

So, I'm sure that when a new release for @actions/github is available that includes @actions/http-client version 2.1.0 or newer, then this issue can be fixed by updating a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants