Skip to content

[Bug?]: Proxy settings are ignored if redirected #5244

@pustekuchen91

Description

@pustekuchen91

Self-service

  • I'd be willing to implement a fix

Describe the bug

The proxy configuration is only applied to the first request. If you are redirected during the request, the proxy settings are no longer taken into account.

To reproduce

Configure gitlab as registry at instance level
.yarnrc.yml

  not-existing-scope-in-gitlab:
    npmRegistryServer: "http://gitlab.com/api/v4/packages/npm/"

package.json

  "dependencies": {
    "@not-existing-scope-in-gitlab/my-package": "^1.0.0"
}

yarn install

gitlab is forwarding to npmjs.com, because the package was not found
https://docs.gitlab.com/ee/user/packages/npm_registry/#package-forwarding-to-npmjscom

the proxy-settings / networkSettings for this redirect are not applied, so this ends in a ➤ YN0001: │ RequestError: connect ETIMEDOUT 104.16.26.35:443

Environment

System:
    OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
  Binaries:
    Node: 18.13.0 - /tmp/xfs-1512c5b2/node
    Yarn: 3.3.0 - /tmp/xfs-1512c5b2/yarn
    npm: 8.19.3 - /usr/local/bin/npm

Additional context

debugging this error was pain, because yarn install dont show any information which leads to the error.

no --verbose possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions