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

[BUG] Unable to use got or any got dependent libraries due to outdated https-proxy-agent #1155

Closed
locomike opened this issue Sep 25, 2021 · 2 comments · Fixed by #1307
Closed
Labels
bug You Can Do This This idea is well spec'd and ready for a PR

Comments

@locomike
Copy link

Describe the bug
I discovered this bug when trying to integrate gitbeaker in my danger script. The error I get when trying to connect to Gitlab with gitbeaker is

Error:  RequestError: connect ECONNREFUSED 127.0.0.1:443
    at ClientRequest.<anonymous> (/Users/miguelcohnen/dev/ixigo/android/node_modules/got/dist/source/core/index.js:956:111)
    at Object.onceWrapper (events.js:520:26)
    at ClientRequest.emit (events.js:412:35)
    at ClientRequest.origin.emit (/Users/miguelcohnen/dev/ixigo/android/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
  code: 'ECONNREFUSED',
  timings: {
    start: 1632510293779,
    socket: 1632510293779,
    lookup: 1632510293780,
    connect: ,
    secureConnect: ,
    upload: undefined,
    response: undefined,
    end: undefined,
    error: 1632510293780,
    abort: undefined,
    phases: {
      wait: 0,
      dns: 1,
      tcp: undefined,
      tls: undefined,
      request: undefined,
      firstByte: undefined,
      download: undefined,
      total: 1
    }
  }
}

gitbeaker uses got package. According to this issue, the problem is an outdated version of https-proxy-agent that is incompatible with Node 10.
See https://forums.meteor.com/t/solved-problems-with-using-the-got-http-package/54297 and sindresorhus/got#876 (comment)

My Gitlab instance is under a VPN proxy.

To Reproduce
Steps to reproduce the behavior:

  1. Integrate got in a danger script.
  2. Try to connect to a Gitlab Service using got that is behind a proxy
  3. Verify an error is thrown RequestError: connect ECONNREFUSED 127.0.0.1:443

Expected behavior

  • After upgrading http(s)-proxu-agent packages, using got to connect to a Gitlab URL behind a VPN proxy works correctly.

** Your Environment**

software version
danger.js 10.6.6
node v14.17.6
npm 6.14.15
Operating System Mac OS

Additional context
Add any other context about the problem here.

@locomike locomike added the bug label Sep 25, 2021
@orta
Copy link
Member

orta commented Sep 25, 2021

Cool, you're welcome to send a PR 👍🏻

@orta orta added the You Can Do This This idea is well spec'd and ready for a PR label Sep 25, 2021
@opensorceror
Copy link

I'm hitting this issue as well, SO glad to find out that I'm not alone.

The version of gitbeaker that does work for me is 14.2.2 (that package is named gitlab though...this is before it became gitbeaker). Looking to use a newer version though, because this older one has horrible TypeScript support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug You Can Do This This idea is well spec'd and ready for a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants