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?]: Can't fetch Gitlab dependencies via SSH #6503

Closed
1 task done
sensiblepuffin opened this issue Sep 14, 2024 · 2 comments
Closed
1 task done

[Bug?]: Can't fetch Gitlab dependencies via SSH #6503

sensiblepuffin opened this issue Sep 14, 2024 · 2 comments
Labels
bug Something isn't working stale Issues that didn't get attention waiting for feedback Will autoclose in a while unless more data are provided

Comments

@sensiblepuffin
Copy link

sensiblepuffin commented Sep 14, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

Yarn (v2.4.3) is unable to fetch Gitlab repos via SSH because (I think) the namespaces cause URL parsing to fail.

After experimenting with different node versions (and not having much luck), I found the WHATWG standard (which Node has moved to) that clearly rejects a URL that resembles a Gitlab SSH URL:

image

The specific deprecation in question is here.

Example:

# $ node --version && node yarn install
v20.17.0
➤ YN0000: ┌ Resolution step
➤ YN0000: │ DeprecationWarning: The URL ssh://git@code.company.com:person/babel-plugin-make-defer-hydration-imports-eager.git is invalid. Future versions of Node.js will throw an error.
➤ YN0001: │ TypeError: babel-plugin-make-defer-hydration-imports-eager@git+ssh://git@code.company.com:person/babel-plugin-make-defer-hydration-imports-eager.git#hash: Invalid URL
    at new URL (node:internal/url:797:36)
    at Module.d (/var/www/project/yarn.js:2:420910)
    at b (/var/www/project/yarn.js:2:144699)
    at v (/var/www/project/yarn.js:2:145213)
    at F.resolvers.getCandidates (/var/www/project/yarn.js:2:148889)
    at n.getCandidates (/var/www/project/yarn.js:2:344526)
    at n.getCandidates (/var/www/project/yarn.js:2:344526)
    at /var/www/project/yarn.js:2:366182
    at Module.w (/var/www/project/yarn.js:2:425653)
    at C (/var/www/project/yarn.js:2:366145)
➤ YN0000: └ Completed in 0s 399ms
➤ YN0000: Failed with errors in 0s 404ms

After the offending colons are replaced with slashes, it obviously can't fetch the packages but yarn doesn't complain.

# $ node --version && node yarn install | grep git@
v20.17.0
➤ YN0013: │ chartiq@git+ssh://git@code.company.com/its/chartiq.git#commit=hash can't be found in the cache and will be fetched from the remote repository
➤ YN0013: │ babel-plugin-make-defer-hydration-imports-eager@git+ssh://git@code.company.com/person/babel-plugin-make-defer-hydration-imports-eager.git#commit=hash can't be found in the cache and will be fetched from the remote repository

To reproduce

  • Create a new yarn project with yarn init
  • Add any dependency that points to a Gitlab repo via SSH (no need for a specific commit hash)
  • Run yarn install
  • You should see the TypeError: Invalid URL error as above.

Environment

System:
    OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (4) x64 Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz
  Binaries:
    Node: 19.2.0 - /tmp/xfs-c9fb61a5/node
    Yarn: 2.4.3 - /tmp/xfs-c9fb61a5/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v19.2.0/bin/npm

Additional context

No response

@sensiblepuffin sensiblepuffin added the bug Something isn't working label Sep 14, 2024
@clemyan
Copy link
Member

clemyan commented Sep 17, 2024

I can reproduce on 2.4.3 but not on 4.5.0. Probably fixed in #5100. Please upgrade your Yarn version.

@clemyan clemyan added the waiting for feedback Will autoclose in a while unless more data are provided label Sep 17, 2024
@yarnbot
Copy link
Collaborator

yarnbot commented Oct 17, 2024

Hi! 👋

It seems like this issue as been marked as probably resolved, or missing important information blocking its progression. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it.

@yarnbot yarnbot added the stale Issues that didn't get attention label Oct 17, 2024
@yarnbot yarnbot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that didn't get attention waiting for feedback Will autoclose in a while unless more data are provided
Projects
None yet
Development

No branches or pull requests

3 participants