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

http proxy is not working on Openshift #696

Open
USI-KMD opened this issue Sep 11, 2023 · 6 comments
Open

http proxy is not working on Openshift #696

USI-KMD opened this issue Sep 11, 2023 · 6 comments

Comments

@USI-KMD
Copy link

USI-KMD commented Sep 11, 2023

Creating GitHub release is failing when semantic-release is executed on an Openshift behind a corporate proxy.
When working on an Openshift clusters without a proxy the same configuration works fine. Also, the corporate proxy works fine in all other cases.

I tried configuring the proxy using HTTP_PROXY and HTTPS_PROXY environment variables and via the following .releaserc config:

{
  "branches": [
    "+([0-9])?(.{+([0-9]),x}).x",
    {
      "name": "main",
      "prerelease": false
    }
  ],
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "angular"
      }
    ],
    "@semantic-release/changelog",
    [
      "@semantic-release/github",
      {
        "proxy": {
          "host": "XXXXX [redacted]",
          "port": 3128,
          "secureProxy": false
        }
      }
    ]
  ]
}

However, in all cases I'm getting the following error:

2023-09-11T12:53:48.405Z semantic-release:get-git-auth-url Verifying ssh auth by attempting to push to  https://git:[secure]@github.com/XXXXX.git
2023-09-11T12:53:51.494Z semantic-release:get-tags found tags for branch main: []
2023-09-11T12:53:51.503Z semantic-release:get-tags found tags for branch test-sem-ver-proxy: []
[12:53:51 PM] [semantic-release] › ✔  Run automated release from branch test-sem-ver-proxy on repository https://git:[secure]@github.com/XXXXXX.git
[12:53:51 PM] [semantic-release] › ✔  Allowed to push to the Git repository
[12:53:51 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/exec"
[12:53:51 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/exec"
[12:53:51 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[12:53:51 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[12:53:51 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[12:53:51 PM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication
[12:54:46 PM] [semantic-release] › ✘  Failed step "verifyConditions" of plugin "@semantic-release/github"
[12:54:46 PM] [semantic-release] › ✘  An error occurred while running semantic-release: RequestError [HttpError]: fetch failed
    at /usr/local/lib/node_modules/@semantic-release/github/node_modules/@octokit/request/dist-node/index.js:136:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async requestWithGraphqlErrorHandling (/usr/local/lib/node_modules/@semantic-release/github/node_modules/@octokit/plugin-retry/dist-node/index.js:71:20)
    at async Job.doExecute (/usr/local/lib/node_modules/@semantic-release/github/node_modules/bottleneck/light.js:405:18) {
  status: 500,
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/XXXXXX',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': '@semantic-release/github v9.0.5 octokit-core.js/5.0.0 Node.js/18.17.1 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: {
      agent: [HttpsProxyAgent],
      hook: [Function: bound bound register],
      retryCount: 3,
      retries: 3,
      retryAfter: 16
    }
  },
  pluginName: '@semantic-release/github'
}
AggregateError: 
    HttpError: fetch failed
        at /usr/local/lib/node_modules/@semantic-release/github/node_modules/@octokit/request/dist-node/index.js:136:11
        at async requestWithGraphqlErrorHandling (/usr/local/lib/node_modules/@semantic-release/github/node_modules/@octokit/plugin-retry/dist-node/index.js:71:20)
        at async Job.doExecute (/usr/local/lib/node_modules/@semantic-release/github/node_modules/bottleneck/light.js:405:18)
    at file:///usr/local/lib/node_modules/�[4msemantic-release�[24m/lib/plugins/pipeline.js:55:13
    at async pluginsConfigAccumulator.<computed> [as verifyConditions] (file:///usr/local/lib/node_modules/�[4msemantic-release�[24m/lib/plugins/index.js:87:11)
    at async run (file:///usr/local/lib/node_modules/�[4msemantic-release�[24m/index.js:106:3)
    at async Module.default (file:///usr/local/lib/node_modules/�[4msemantic-release�[24m/index.js:275:22)
    at async default (file:///usr/local/lib/node_modules/�[4msemantic-release�[24m/cli.js:55:5) {
  errors: [
    RequestError [HttpError]: fetch failed
        at /usr/local/lib/node_modules/�[4m@semantic-release�[24m/github/node_modules/�[4m@octokit�[24m/request/dist-node/index.js:136:11
    �[90m    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)�[39m
        at async requestWithGraphqlErrorHandling (/usr/local/lib/node_modules/�[4m@semantic-release�[24m/github/node_modules/�[4m@octokit�[24m/plugin-retry/dist-node/index.js:71:20)
        at async Job.doExecute (/usr/local/lib/node_modules/�[4m@semantic-release�[24m/github/node_modules/�[4mbottleneck�[24m/light.js:405:18) {
      status: �[33m500�[39m,
      request: �[36m[Object]�[39m,
      pluginName: �[32m'@semantic-release/github'�[39m
    }
  ]
}

Is there an error in my configuration? Otherwise, I would greatly appreciate any help with further troubleshooting.

@UDWSU1
Copy link

UDWSU1 commented Nov 1, 2023

@USI-KMD Have you figured it out. Dealing with similar issue.

@travi
Copy link
Member

travi commented Nov 3, 2023

open to a PR to improve documentation or suggestion for a fix if there is a problem with the current implementation, but could use help investigating this. i have no environment to test this scenario from. if someone could provide a public reproduction, that could be a place to start

@channon4
Copy link

I also am finding that proxy settings are not respected. I can reproduce locally while on/off our corporate VPN.

I dont know how to set up a proxy quickly but the easiest way to tell there is an issue is by setting the proxy environment variables to random values and see that it still works which it shouldnt.

export HTTPS_PROXY=http://internet.x.com:4444
export HTTP_PROXY=http://internet.x.com:4444
npm config set proxy http://internet.x.com:4444
npm config set https-proxy http://internet.x.com:4444

This url is fake so we should expect semantic release to fail but yet it works

@travi
Copy link
Member

travi commented Dec 6, 2023

likely related: octokit/request.js#577

@dashuaige2000
Copy link

I also have the same mistake, proxy IP is an internal network

@vmorales-2920
Copy link

Facing same issues, have you found a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants