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

yarn 0.23.2 unable to install from git+ssh repo #3203

Closed
cskeppstedt opened this issue Apr 20, 2017 · 18 comments
Closed

yarn 0.23.2 unable to install from git+ssh repo #3203

cskeppstedt opened this issue Apr 20, 2017 · 18 comments
Labels

Comments

@cskeppstedt
Copy link

cskeppstedt commented Apr 20, 2017

Do you want to request a feature or report a bug?

bug

What is the current behavior?

When trying to add a dependency with the git+ssh specification, yarn is unable to read from the remote repository. The repository is an internal Bitbucket server, where the read-access is controlled via ssh keys. The previous yarn-version I used (0.21.3) could install the package. The only difference between the two examples below is the version of yarn. Everything else (ssh keys, node version, etc) is the same.

$ yarn add git+ssh://git@internal-stash-server:7999/prj/repo.git
yarn add v0.23.2
[1/4] 🔍  Resolving packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone git@internal-stash-server:7999/prj/repo.git /Users/chris.skeppstedt/Library/Caches/Yarn/v1/.tmp/b625ca2d4e9ba1f4eb42d720d250ce14
Directory: /Users/chris.skeppstedt/code/my-test-project
Output:
Cloning into '/Users/chris.skeppstedt/Library/Caches/Yarn/v1/.tmp/b625ca2d4e9ba1f4eb42d720d250ce14'...
Repository not found
The requested repository does not exist, or you do not have permission to access it.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

What is the expected behavior?

The package should be installed from the git+ssh specification. Here's a working example using yarn 0.21.3.

$ yarn add git+ssh://git@internal-stash-server:7999/prj/repo.git
yarn add v0.21.3
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ repo@1.0.0
✨  Done in 6.28s.

Please mention your node.js, yarn and operating system version.
node.js: 7.9.0
yarn: 0.23.2 (and 0.21.3)
os: macOS Sierra 0.12.4

@Nyoroon
Copy link

Nyoroon commented Apr 20, 2017

Same on CentOS 7.

@Nyoroon
Copy link

Nyoroon commented Apr 20, 2017

I thing that PR is causing problem: #2990

@webark
Copy link

webark commented Apr 22, 2017

Ran into this as well. Had to change to just using "ssh://" which seems to work for yarn, but not for npm which does want the "git+ssh://".

@andrewhavens
Copy link

I'm having this issue also, but changing to ssh:// as @webark mentioned did not solve the problem for me. This was working for me previously, but now it is not in version 0.23.2.

@webark
Copy link

webark commented Apr 28, 2017

@andrewhavens really? huh. We're using a private hosted stash repo for some packages. And with doing a "ssh://git@stash:7999/ccfe/cc-paths" seemed to work for us. ONLY for yarn though.. npm doesn't know what to do with it.

@driesvints
Copy link

I can confirm that this is also broken for us. Upgrading to the latest Yarn version (0.23.3) has broken our CI builds.

@driesvints
Copy link

Using ssh:// instead didn't fix the problem for us unfortunately. Getting the same issues.

@raido
Copy link
Contributor

raido commented May 2, 2017

Ran into this with v0.22 on CI after upgrading git+ssh:// linked package version. v0.23.3 fixed the issue.

@jarekb84
Copy link

jarekb84 commented May 2, 2017

Same as others have mentioned, upgraded to v0.23.3 caused the issue and removing 'git+' fixed it as @webark mentioned.

@TynesideGroup
Copy link

After spending several hours today trying to figure out what was going wrong, it turns out an old Pageant (one of the PuTTY apps) config had manipulated my GIT_SSH environment variable so it was ignoring my known_hosts file.

Removing that environment variable has resolved the issue for me with using a private GitHub repository and using a URL in the format git+ssh://git@github.com/{organisation}/{repo} with Yarn v0.23.3.

@yuricus
Copy link

yuricus commented May 4, 2017

yarn 0.23.4 does not work for us, package specified with git+ssh://git@myhost:myport/repo.git. When yarn generates git command it omits the protocol, resulting in connection timeout to default port

error Command failed.
Exit code: 128
Command: git
Arguments: clone git@myhost:myport/repo.git the-dir
Cloning into '...'...
ssh: connect to host myhost port 22: Connection timed out
fatal: Could not read from remote repository.```



@fpauser
Copy link

fpauser commented May 10, 2017

Same problems here. I installed the current release candidate (0.24.2) via
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.24.2, which solved the problem for me.

Going back to current "stable" via curl -o- -L https://yarnpkg.com/install.sh | bash -s and doing yarn cache clean && yarn install triggered the error again (stalled yarn / hidden git+ssh password prompt).

@foxymoron
Copy link

Yup!...
With v0.23.4 , yarn install fails with git+ssh private repos.
With v0.24.2, yarn install works well!!

@stephanieder
Copy link

stephanieder commented May 24, 2017

Hello,
Someone has try with a port number on v0.24.5 ?
It seems I have the error too.
When I write "yarn install" I have that :

yarn install v0.24.5
info No lockfile found.
[1/5] Resolving packages...
error Command failed.
Exit code: 1
Command: git
Arguments: archive --remote=ssh://git@{host}:{port}/foo.git master package.json

But when I remove the :{port} it doen't show any error. But it try with port 22 which, of course, termines with a timeout because it's not the port I need.

@bestander
Copy link
Member

We just landed this PR #3735 (will be in 0.28).
Can anyone check if it works?

@chrisdukey
Copy link

I've just built from master and it's fixed the problem for me. Thanks!

@francoispluchino
Copy link

@bestander I use Yarn 0.28.4 (currently in RC), and I have an error Couldn't find match for "master" in "" for "ssh://git@github.com/<username>/<repository>.git". in the step 2.5 'Resolving packages...'. This error is random, And after a dozen immediate attempts (it can be less at times), Yarn install the dependencies.

The problem also exists for the 0.27.5 version. I can no longer tell you from which version of Yarn the problem is present, but it's been a few months now.

My url in package.json:

{
    "dependencies": {
        "@vendor/package": "git+ssh://git@github.com/<username>/<repository>.git#master"
    }
}

@BYK
Copy link
Member

BYK commented Aug 9, 2017

@francoispluchino I'd check if your SSH keys being made available to SSH agent at the time of yarn install since yarn uses ssh in batch mode which doesn't allow prompting.

You may also check your proxy and try using git+https urls to see if it fixes your problem. As a last resort I'd use one of the latest nightlies and see if it happens there. If it does, then please create a new issue with a reproduction script so we can reliably reproduce it and then fix.

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

No branches or pull requests