semantic-release / semantic-release/github

http proxy is not working on Openshift

Open
#696 9 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
534
Forks
150
Avg merge
1m
Merged PRs (30d)
3

Description

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/semantic-release/lib/plugins/pipeline.js:55:13
    at async pluginsConfigAccumulator.<computed> [as verifyConditions] (file:///usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:87:11)
    at async run (file:///usr/local/lib/node_modules/semantic-release/index.js:106:3)
    at async Module.default (file:///usr/local/lib/node_modules/semantic-release/index.js:275:22)
    at async default (file:///usr/local/lib/node_modules/semantic-release/cli.js:55:5) {
  errors: [
    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: [Object],
      pluginName: '@semantic-release/github'
    }
  ]
}

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the @semantic-release/github verifyConditions entry point and trace its @octokit/request call to the GitHub API, using the shown proxy configuration and environment variables. Reproduce the failure on OpenShift and compare the proxy agent behavior; done means authentication succeeds and release verification works behind the corporate proxy.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, javascript, node.js
Domain
api, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.