Error command errored out with exit status 128

I have had a project working with the standard https cloning syntax for a while, and just this afternoon it was working fine. Now, I get error code 128 every time I try to clone: Obtaining myproject

I have had a project working with the standard https cloning syntax for a while, and just this afternoon it was working fine. Now, I get error code 128 every time I try to clone:

Obtaining myproject from git+git://myurl/myuser/myproject.git@master#egg=myproject (from -r requirements.txt (line 28))
  ...
  fatal: unable to connect to myurl:
  myurl[0: x.y.z.q]: errno=Invalid argument

ERROR: Command errored out with exit status 128: git clone -q git://myurl/myuser/myproject.git Check the logs for full command output.

I have confirmed I am able to manually clone using

git clone -q https://myurl/myuser/myproject.git

As well as through SSH.

I am hosting my repositories on gitea, and I haven’t found any errors related to this. This is very strange.

Does anyone know what could be going wrong? I even deleted my virtualenv folder and re-instantiated it with no luck, as well as restart my gitea server.

asked Oct 17, 2019 at 3:11

CL40's user avatar

0

See the pip install doc. If you want to use the https protocol then the syntax is:

git+https://git.example.com/MyProject#egg=MyProject

But from your question it looks like you are using the git protocol instead (git+git://git.example.com/MyProject#egg=MyProject). So this is a different protocol.

answered Oct 17, 2019 at 7:53

sinoroc's user avatar

sinorocsinoroc

15.5k1 gold badge31 silver badges61 bronze badges

1

tl;dr

I had a very similar error, which ended up being missing ca-certs for pulling HTTPS urls. The fix was to:

apt-get install -y --reinstall ca-certificates

Details

After digging a little deeper into the pip output, the underlying git clone -q was erroring out like so:

fatal: unable to access 'https://github.com/blah/blah.git/': server certificate verification failed. CAfile: none CRLfile: none                   

answered Oct 14, 2020 at 22:36

Jim K.'s user avatar

Jim K.Jim K.

8848 silver badges8 bronze badges

Change the code in the file.

The original code is:

pip install git+https://github.com/snkas/exputilpy.git@v1.6 | | exit 1
pip install git+https://github.com/snkas/networkload.git@v1.3 | | exit 1

Change to:

pip install git+git://github.com/snkas/exputilpy.git@v1.6 | | exit 1
pip install git+git://github.com/snkas/networkload.git@v1.3 | | exit 1

buddemat's user avatar

buddemat

3,89512 gold badges23 silver badges47 bronze badges

answered Jul 13, 2021 at 1:51

custCJ's user avatar

I had a same error and only add public key of ssh in my profile settings -> keys ssh and ready!

Note: I installed the repo with this format for python project

pipenv install -e git+ssh://git.example.com/MyProject.git@master#egg=MyProject

answered Nov 4, 2020 at 16:20

pedro.caicedo.dev's user avatar

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

Comments

@loretoparisi

ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@github.com/ludlows/python-pesq' /private/var/folders/_b/szqwdfn979n4fdg7f2j875_r0000gn/T/pip-install-hy9metiy/pesq Check the logs for full command output.

with pip3 install -r requirements.txt with our without python3 -m venv .venv, thus this does not happen when installing with pip.

Thank you

@adefossez

Can you run pip install https://github.com/ludlows/python-pesq@master#egg=pesq instead and see if that works?

@loretoparisi

@adefossez so I get

ip-192-168-178-22:denoiser loretoparisi$ . .venv/bin/activate
(.venv) ip-192-168-178-22:denoiser loretoparisi$ pip3 install https://github.com/ludlows/python-pesq@master#egg=pesq
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting pesq
  ERROR: HTTP error 404 while getting https://github.com/ludlows/python-pesq@master#egg=pesq
  ERROR: Could not install requirement pesq from https://github.com/ludlows/python-pesq@master#egg=pesq because of error 404 Client Error: Not Found for url: https://github.com/ludlows/python-pesq@master
ERROR: Could not install requirement pesq from https://github.com/ludlows/python-pesq@master#egg=pesq because of HTTP error 404 Client Error: Not Found for url: https://github.com/ludlows/python-pesq@master for URL https://github.com/ludlows/python-pesq@master#egg=pesq

By the way, I confirm it works in this way

pip3 install git+https://github.com/ludlows/python-pesq#egg=pesq
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting pesq
  Cloning https://github.com/ludlows/python-pesq to /private/var/folders/_b/szqwdfn979n4fdg7f2j875_r0000gn/T/pip-install-jchj0dmm/pesq
  Running command git clone -q https://github.com/ludlows/python-pesq /private/var/folders/_b/szqwdfn979n4fdg7f2j875_r0000gn/T/pip-install-jchj0dmm/pesq
Building wheels for collected packages: pesq
  Building wheel for pesq (setup.py) ... done
  Created wheel for pesq: filename=pesq-0.0.1-cp37-cp37m-macosx_10_14_x86_64.whl size=107560 sha256=3af32edea2423ead934dc9c349d5ff7a8094b7ae7b29294c37e217fb61ee80ab
  Stored in directory: /private/var/folders/_b/szqwdfn979n4fdg7f2j875_r0000gn/T/pip-ephem-wheel-cache-wpc812ta/wheels/0b/a2/5e/e3c14ca4f8ffc7aefbd5353da9bf0c9352dee971def604df50
Successfully built pesq
Installing collected packages: pesq
Successfully installed pesq-0.0.1

according to PR #5

@adefossez

Yes perfect, I dumbly forgot to remove the «@master» ! I’ll get someone to accept the pull requests :)

2 participants

@loretoparisi

@adefossez

Содержание

  1. Pip install git+, trailing forward slash, gitlab error 128 #7383
  2. Comments
  3. Failed to execute git command: exit status 128 #3294
  4. Comments
  5. FAILURE:
  6. SUCCESS:
  7. git-lfs-migrate broken, always errors out with «exit status 128» to stderr and errcode 2 #2534
  8. Comments
  9. Bug: Yarn fails to install (Exit code: 128) #3303
  10. Comments
  11. Import error: git clone returned non-zero exit status 128 #2435
  12. Comments
  13. Bug Report
  14. Footer

Pip install git+, trailing forward slash, gitlab error 128 #7383

Environment

  • pip version: 19.3.1
  • Python version: 3.6.8, 3.7.4
  • OS: Win 10 Pro 64; Ubuntu 18.04 LXC

Description

The pip install git+ feature adds a forward slash at the end of the git repo url when executing, which causes a generic error 128 by gitlab and prevents the full download of the repo.

Expected behavior

This generic command should work and clone a gitlab repo (apologies for the placeholders):
pip3 install -e git+ssh://****@git.CompanyName.host/GroupName/ProjectName.git/#egg=ProjectName —exists-action s

How to Reproduce

  1. Choose a gitlab repo ssh url
  2. That repo should contain a setup.py file in its root
  3. Run this command in the terminal or command line (apologies for the placeholders):
  1. The error occurs as per the output below.

Output

Proposed solution

Could this be fixed preventing the addition of the forward slash at the end of the git path?

Pip: This causes the error 128 (see slash added at end of git path):
git clone -q ssh://git@git.CompanyName.host/GroupName/ProjectName.git/ test01/src/projectname
Human: In the commandline or terminal directly, this clones the gitlab repo correctly:
git clone -q ssh://git@git.CompanyName.host/GroupName/ProjectName.git test01/src/projectname

The text was updated successfully, but these errors were encountered:

Источник

Failed to execute git command: exit status 128 #3294

I recently upgraded to the most recent docker build. Now when I clone and push to a new repository I get this when running git push :

This is only when using the git protocol. If I use the http protocol I can clone and push, but when pushing I have to specify origin master like this git push origin master . I can’t just write git push , which I think used to work before.

The text was updated successfully, but these errors were encountered:

I figured out the origin master part. My package manager updated git, and it wanted me to run this to get the old behavior back:
git config —global push.default matching

Please show gogs log as required.

I created another test in order to provide the full sequence along with the corresponding log statements:

I then ran git push origin master it it worked OK:

Here’s the part of the log that corresponds to the transaction:

Please dump logs in log/serv.log file.

This is the serv.log

And just in case . this is the gogs.log :

I’m assuming that’s the version. I got it from running docker logs gogs and this printed (See last line):

Your Gogs version is far too old, please upgrade.

Yup — I just realized that it did not pull the upgrade the first time I attempted it. I just did a fresh image pull and I still get this error:

You can only go git push/pull after web UI is available to visit, from the log does not seem so, the migration is not finished.

Yes it did finish. I created the repository ole after the server was back up.

I guess it might be problem with volumed directory. cc @0rax

It seems like it’s a protocol issue. If I do git push origin master it works. I just repeated both tests to make sure. This is the git push origin master test.

Hi there, I have multiple question for you as I am not able to reproduce even the clone via ‘git@realm:orax/repo’.

Using just this url will ask me for a password, using ssh://git@realm:orax/repo will work as expected (incuding git push ).

Via https everything is also working as expected.

What is your local git version as well as your gogs version. What url are you given by Gogs when running it ? In the current version you only have an HTTP / HTTPS one and a SSH one (no old school git@. without any prefix).

I am really wondering how it is registered in your side via git / why you are able to clone without specifying the ssh:// protocol by default.

Can you give us the output of git remote show origin [with any url redacted if you wish] ?

Also can you check your

/.gitconfig for any weird option ?

Gogs version from logs:

So now I’ll visit my gogs URL (203.0.113.1:3000) and create a repo:

Then clone it, etc:

FAILURE:

SUCCESS:

Thanks that’s perfect, I will try to reproduce this with those exact version & git configuration !

Will keep you informed here !

Cool thanks — let me know if you need anything else 👍 I am using an SSH key which I’m sure you already guessed.

Just run this test in a ubuntu:14.04 container and on my Mac. Which contains the same version of git as you.

Note that I have my ssh port set to 2222 on my instance of Gogs, thus requiring me to create an ssh_config telling git & ssh to use port 2222 by default as the syntax you are using to clone does not accept a port.

Источник

git-lfs-migrate broken, always errors out with «exit status 128» to stderr and errcode 2 #2534

In other news: I just read through #2146 and it seemed the consensus was to have convert & revert subcommands . this sounds awesome and like exactly what I want.

Unfortunately, the man page mentions nothing of these; only import . What’s that about?

The text was updated successfully, but these errors were encountered:

Hi @ryran! Thanks for opening this issue, and sorry that you’re having trouble. Can you share a copy of your repository so I can figure out where that exit status 128 is coming from? If not, can you re-run the command with GIT_TRACE=1 in your environment and post the output here?

In other news: I just read through #2146 and it seemed the consensus was to have convert & revert subcommands . this sounds awesome and like exactly what I want.

Unfortunately, the man page mentions nothing of these; only import . What’s that about?

Good question! We decided to name the convert / revert commands import and export respectively. The import migration mode is the only one that we shipped in the latest version, but I am hoping to add support for the export mode soon. It didn’t quite make the first cut 😄 .

Hi @ryran, I’m going to close this issue for now since I haven’t heard from you. Hopefully the issue is resolved on your end. If it isn’t, please comment back here and we can take another look into things.

Hi, I might be having a similar issue but not being too fluent in git in the first place I am not too sure.
When i try to migrate .jpeg i get the exit code 128. message.
$ git lfs migrate import —include=»*.jpeg»
exit status 128
You asked for GIT_TRACE=1, I don’t know to run the command, but I’ll run it if you give me something i can copy-paste into the shell.

You asked for GIT_TRACE=1, I don’t know to run the command, but I’ll run it if you give me something i can copy-paste into the shell.

Hi @MnTronslien — thanks for commenting here 👍 . Here’s something to paste into your shell:

Hello and thanks for the quick reply! It turned out to be a simple thing and I solved it. It was simply missing credentials I think, but it never prompted me for them. Updating the URL with username made it prompt me when migrating, and that made the migrate complete. This is a problem that has been haunting my team for about two weeks now so this was an awesome breakthrough for us!
(Still don’t know where i set the git URL in bash but i managed to change it through SmartGit)

Here is the Git_trace before adding credentials:

$ GIT_TRACE=1 git lfs migrate import —include=»*.jpeg» 16:11:01.754235 git.c:564 trace: exec: ‘git-lfs’ ‘migrate’ ‘import’ ‘—include=*.jpeg’ 16:11:01.754725 run-command.c:336 trace: run_command: ‘git-lfs’ ‘migrate’ ‘import’ ‘—include=*.jpeg’ trace git-lfs: run_command: ‘git’ config -l trace git-lfs: run_command: git cat-file —batch trace git-lfs: run_command: ‘git’ rev-parse HEAD —symbolic-full-name HEAD trace git-lfs: run_command: ‘git’ rev-parse master —symbolic-full-name master exit status 128

And here it is after:

$ GIT_TRACE=1 git lfs migrate import —include=»*.jpeg» 16:12:32.449825 git.c:564 trace: exec: ‘git-lfs’ ‘migrate’ ‘import’ ‘—include=*.jpeg’ 16:12:32.450330 run-command.c:336 trace: run_command: ‘git-lfs’ ‘migrate’ ‘import’ ‘—include=*.jpeg’ trace git-lfs: run_command: ‘git’ config -l trace git-lfs: run_command: git cat-file —batch trace git-lfs: run_command: ‘git’ rev-parse HEAD —symbolic-full-name HEAD trace git-lfs: run_command: ‘git’ rev-parse master —symbolic-full-name master trace git-lfs: run_command: git rev-list —reverse —topo-order —do-walk master ^refs/remotes/origin/feature/[redacted] ^refs/remotes/origin/feature/Networking ^refs/remotes/origin/master — migrate: Sorting commits: . done migrate: Rewriting commits: NaN% (0/0), done migrate: Updating refs: . done trace git-lfs: run_command: ‘git’ rev-parse —is-bare-repository trace git-lfs: run_command: ‘git’ checkout —force

So in the end i might suggest adding some sort of error message for bad credentials other than exit status 128? because that link was hard to find :S Ofc only if its a lfs and not a git thing.

Источник

Bug: Yarn fails to install (Exit code: 128) #3303

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

What is the current behavior?

Yarn fails to install and does not provide any helpful error message for debugging. I have already done this:

..but it has not made any difference.

If the current behavior is a bug, please provide the steps to reproduce.

Yarn seems to install in other projects. Inspecting the directory that is mentioned in the output:

What is the expected behavior?

I expect install to succeed or at least provide an actionable error message.

Please mention your node.js, yarn and operating system version.

  • Node: 7.9.0
  • Yarn: 0.23.3
  • macOS Sierra 10.12.4

The text was updated successfully, but these errors were encountered:

Same thing, happened after yarn cache clean i run yarn

  • node: 7.4.0
  • yarn 0.23.2
  • CentOS release 6.8 (Final)

Oh yes, if you fail to proceed with yarn install because of this error, just delete your lockfile ( yarn.lock ) and run yarn install again

I think this can result from trying to install a deleted git branch as well — I was using a custom fork over here apollographql/graphql-tag#52, but when it got merged/deleted, I started encountering a similar error:

Where on the last line, was the commit hash of the deleted branch. I switched to the main branch since the pull request had been merged, for my fix.

I think I found the reason for my original error. I think one of the packages that was linked to a branch had a commit deleted, or force-pushed updates. Unfortunately, I don’t know for sure and the yarn error message does not make it clear if that was the case or not.

I think there are several issues discussed here.
We have fixed a git related issue in 0.25.
Feel free to open a new issue with steps to reproduce if it still remains.

I was getting the same error when trying to yarn add our common library from bitbucket. After reading this and trying a few things without success I thought I’d try npm to see how it would behave. Also erroring out but I got a better error message :

ENOTEMPTY: directory not empty, rmdir ‘/mnt/c/Users/[user]/Documents/workspace/[project]/node_modules/common-js/dist’

Using WSL. Seems like it cannot remove the old directory properly.

I know this is probably unrelated to yarn, but thought I’d post anyways for information purposes.

I got this same error. I was able to reproduce and fix the issue (it was direct mistake from me).

Basically, I have a git dependency (and it’s pointing a branch) that is tracked in the yarn lockfile. At some point during the day, I force pushed my git branch which clobbered the tracked sha. I verified that the clobbered sha was the git archive CLOBBERED_SHA presented in the error message.

The fix was to yarn upgrade (if you’re on latest). Otherwise, you can yarn add —force .

I tend to get this error when using a github dependency and switching between branches.
For those that run into this issue, you can usually fix it by deleting the cace folder from the output.

Fix it by deleting: /Users/andrew/Library/Caches/Yarn/v1/.tmp/f1b469ac943bb80864be5dfa2512836d then rerun yarn.

I think yarn is reusing the cache directory, but git doesn’t like overwriting one branch with another in that directory.

Источник

Import error: git clone returned non-zero exit status 128 #2435

Bug Report

SUMMARY

Git error 128, but no explanation why it’s using HEAD instead of whatever branch is supposed to be used (in this case ‘master’)

STEPS TO REPRODUCE

ansible-galaxy import Thulium-Drake ansible-role-sshd —role-name=sshd

EXPECTED RESULTS

To import my role to Galaxy.

ACTUAL RESULTS

It borks, see below:
(other roles work just fine, just this one keeps borking out)

The text was updated successfully, but these errors were encountered:

Did you try setting github_branch in role metadata? There’s an example metadata file here.

No, this repo only has a single branch (master) and the import in question is supposed to import the latest tag (2.0.2).

And the interesting part is that the import has worked in the past (I haven’t changed the meta file in 10 months), but stopped working 2 months ago (wasn’t able to look into it earlier)

So I ended up deleting the ‘current’ import of the role and run the import command again om my laptop, presto, import succeeded.

Still not entirely sure what the issue was, but it’s working again 🙂

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

This error occurred when installing git + GitHub web page. The full name is

Collecting git+https://github.com/pytorch/[email protected]
  Cloning https://github.com/pytorch/tnt.git (to revision master) to c:usersleeappdatalocaltemppip-req-build-lbtbze6v
  Running command git clone -q https://github.com/pytorch/tnt.git 'C:UsersleeAppDataLocalTemppip-req-build-lbtbze6v'
  fatal: unable to access 'https://github.com/pytorch/tnt.git/': OpenSSL SSL_read: Connection was reset, errno 10054
WARNING: Discarding git+https://github.com/pytorch/[email protected] Command errored out with exit status 128: git clone -q https://github.com/pytorch/tnt.git 'C:UsersleeAppDataLocalTemppip-req-build-lbtbze6v' Check the logs for fu
ll command output.
ERROR: Command errored out with exit status 128: git clone -q https://github.com/pytorch/tnt.git 'C:UsersleeAppDataLocalTemppip-req-build-lbtbze6v' Check the logs for full command output.

Solution:

 pip install git+git://github.com/ildoonet/pytorch-gradual-warmup-lr.git

Successfully installed

Collecting git+git://github.com/ildoonet/pytorch-gradual-warmup-lr.git
  Cloning git://github.com/ildoonet/pytorch-gradual-warmup-lr.git to c:usersleeappdatalocaltemppip-req-build-ncz3svwe
  Running command git clone -q git://github.com/ildoonet/pytorch-gradual-warmup-lr.git 'C:UsersleeAppDataLocalTemppip-req-build-ncz3svwe'
  Resolved git://github.com/ildoonet/pytorch-gradual-warmup-lr.git to commit 6b5e8953a80aef5b324104dc0c2e9b8c34d622bd
Building wheels for collected packages: warmup-scheduler
  Building wheel for warmup-scheduler (setup.py) ... done
  Created wheel for warmup-scheduler: filename=warmup_scheduler-0.3.2-py3-none-any.whl size=3917 sha256=4cef133c28685f1e5a70364fd6546a3d4d995fe49584781b1024d3707f9f222f
  Stored in directory: C:UsersleeAppDataLocalTemppip-ephem-wheel-cache-m6_t0cflwheelsd2574d3adb5d109151933485f2b4387f61a90ff8e669f50fc8f1fa14
Successfully built warmup-scheduler
Installing collected packages: warmup-scheduler
Successfully installed warmup-scheduler-0.3.2

Read More:

I am trying to add a package to my requirements.txt file that is:

  • From a private GitHub repo
    • I’m a member of the private repo
    • I have ssh configured for the private repo
  • From a branch besides master, whose name has a slash in it
  • Using ssh protocol

All over the internet, there are questions on this topic. Here are the pip docs on this:

pip install -e "vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"

And an answer for GitHub from How to state in requirements.txt a direct github source

git+git://github.com/path/to/package-two@master#egg=package-two


Attempt Method #1

I am trying to use this answer in my requirements.txt file:

-e git+ssh://github.com/Organization/repo-name.git@branch/name#egg=foo

I am getting an error:

ERROR: Command errored out with exit status 128: git clone -q ssh://github.com/Organization/repo-name.git /path/to/venv/src/foo Check the logs for full command output.

And when I view the logs using the --log option:

Using pip 20.2 from /path/to/venv/lib/python3.8/site-packages/pip (python 3.8)
Non-user install because user site-packages disabled
Created temporary directory: /private/var/folders/yl/tnzf__856m90wwx0jrqwmhbw0000gn/T/pip-ephem-wheel-cache-yysggsvl
Created temporary directory: /private/var/folders/yl/tnzf__856m90wwx0jrqwmhbw0000gn/T/pip-req-tracker-ckqzav7i
Initialized build tracking at /private/var/folders/yl/tnzf__856m90wwx0jrqwmhbw0000gn/T/pip-req-tracker-ckqzav7i
Created build tracker: /private/var/folders/yl/tnzf__856m90wwx0jrqwmhbw0000gn/T/pip-req-tracker-ckqzav7i
Entered build tracker: /private/var/folders/yl/tnzf__856m90wwx0jrqwmhbw0000gn/T/pip-req-tracker-ckqzav7i
Created temporary directory: /private/var/folders/yl/tnzf__856m90wwx0jrqwmhbw0000gn/T/pip-install-c9xw78wg
Looking in indexes: https://pypi.org/simple
Obtaining foo from git+ssh://github.com/Organization/repo-name.git@branch/name#egg=foo (from -r requirements.txt (line 6))
  Cloning ssh://github.com/Organization/repo-name.git (to revision branch/name) to ./venv/src/foo
ERROR: Command errored out with exit status 128: git clone -q ssh://github.com/Organization/repo-name.git /path/to/venv/src/foo Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 216, in _main
    status = self.run(options, args)
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 324, in run
    requirement_set = resolver.resolve(
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/resolution/legacy/resolver.py", line 326, in _get_abstract_dist_for
    return self.preparer.prepare_editable_requirement(req)
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 523, in prepare_editable_requirement
    req.update_editable(not self._download_should_save)
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 664, in update_editable
    vcs_backend.obtain(self.source_dir, url=hidden_url)
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/vcs/versioncontrol.py", line 641, in obtain
    self.fetch_new(dest, url, rev_options)
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/vcs/git.py", line 230, in fetch_new
    self.run_command(make_command('clone', '-q', url, dest))
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/vcs/versioncontrol.py", line 771, in run_command
    return call_subprocess(cmd, cwd,
  File "/path/to/venv/lib/python3.8/site-packages/pip/_internal/vcs/versioncontrol.py", line 166, in call_subprocess
    raise SubProcessError(exc_msg)
pip._internal.exceptions.SubProcessError: Command errored out with exit status 128: git clone -q ssh://github.com/Organization/repo-name.git /path/to/venv/src/foo Check the logs for full command output.
Removed build tracker: '/private/var/folders/yl/tnzf__856m90wwx0jrqwmhbw0000gn/T/pip-req-tracker-ckqzav7i'

Attempt Method #2

Another way I try for requirements.txt:

-e git+git@github.com:Organization/repo-name.git#egg=foo

The cloning in this actually works! It also prints this warning: DEPRECATION: This form of VCS requirement is being deprecated

Unfortunately, I cannot figure out how to specify a branch name in this format.


What am I doing wrong? Am I missing something?

FYI, my versions:

Python==3.8.5
pip==20.2
setuptools==47.1.0

Advertisement

Answer

I figured out my problem in both cases… syntax


Attempt #1

Mistake: needed to say git@github.com

Correct method:

-e git+ssh://git@github.com/Organization/repo-name.git@branch/name#egg=foo

Attempt #2

Mistake: didn’t know one can use @ twice

Correct method:

-e git+git@github.com:Organization/repo-name.git@branch/name#egg=foo

4 People found this is helpful

Good evening people,

I am trying to run pip install -r requirements.txt and through that clone some code from a bitbucket repo. When I do that I get the following error:


(my_env) C:Users...tool>pip install -r requirements.txt
Collecting git+ssh://****@bitbucket.org/.../...git@4.19.0#subdirectory=py (from -r requirements.txt (line 8))
Cloning ssh://****@bitbucket.org/.../...git (to revision 4.19.0) to c:users...appdatalocaltemppip-req-build-t9_wrhxh
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@bitbucket.org/.../...git' 'C:Users...AppDataLocalTemppip-req-build-t9_wrhxh' Check the logs for full command output.

The requirements.txt file contains the following text:

git+ssh://git@bitbucket.org/.../...git@4.19.0#subdirectory=py 
git+ssh://git@bitbucket.org/.../...git@c99b7f6f372c92832eecfb90663833ef1fd3dc62
git+ssh://git@bitbucket.org/.../...git@45d2999ce5f6eba5dd728414073a10d1c50616a2
git+ssh://git@bitbucket.org/.../....git@1ba2781cd2beae6d23218565c395b633b0eb5328
#pytest==4.4.0.

#python #git #ssh #pip #bitbucket

Вопрос:

У меня есть следующее requirements.txt файл:

 git ssh://git@bitbucket.org/.../...git@4.19.0#subdirectory=py 
git ssh://git@bitbucket.org/.../...git@c99b7f6f372c92832eecfb90663833ef1fd3dc62
git ssh://git@bitbucket.org/.../...git@45d2999ce5f6eba5dd728414073a10d1c50616a2
git ssh://git@bitbucket.org/.../....git@1ba2781cd2beae6d23218565c395b633b0eb5328
 

Однако, когда я пытаюсь установить его, это не удается:

 $ pip install -r requirements.txt
Collecting git ssh://****@bitbucket.org/.../...git@4.19.0#subdirectory=py (from -r requirements.txt (line 8))
Cloning ssh://****@bitbucket.org/.../...git (to revision 4.19.0) to c:users...appdatalocaltemppip-req-build-t9_wrhxh
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****@bitbucket.org/.../...git' 'C:Users...AppDataLocalTemppip-req-build-t9_wrhxh' Check the logs for full command output.
 

Другие коллеги могут устанавливать требования… в чем причина этого? Если я клонирую то же самое, как показано в этом сообщении об ошибке, оно работает нормально:

 $ git clone ssh://git@bitbucket.org/.../....git
Cloning into '...'... 
Enter passphrase for key '/c/Users/.../.ssh/id_rsa': 
remote: Counting objects: 2053, done. 
remote: Compressing objects: 100% (1648/1648), done. 
remote: Total 2053 (delta 1279), reused 385 (delta 200) 
Receiving objects: 100% (2053/2053), 1.88 MiB | 611.00 KiB/s, done. Resolving deltas: 100% (1279/1279), done.
 

Комментарии:

1. Работает ли обычный клон git с URL-адресом ssh на том же хосте?

2. @ASR Я использовал клон git git@bitbucket.org:…/…git и это сработало. Это означает, что я заменил один / на:, я пропустил часть git ssh:// и все, что находится после символа@. Однако, делая это, я пропускаю указанные параметры после символа@, что приводит к отсутствию файлов или клонированию большего количества файлов.

3. @AD7six В requirements.txt работает. Мой коллега проделал ту же процедуру, что и я, и не получил никаких ошибок. Я не понял, как использовать предложенную вами команду. Если это возможно, не могли бы вы написать это в качестве полного примера? Может быть, мне запустить git-клон —глубина 1 git ssh://git@bitbucket.org/…/…git -в 4.19.0 ? А как насчет других 3 примеров, которые, похоже, не имеют имен параметров? Заранее спасибо за вашу помощь.

4. @AD7six Я запустил git clone ssh://git@bitbucket.org/....git@4.19.0#subdirectory=py и получил следующую ошибку: Repository ....git@4.19.0#subdirectory=py not found fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

5. @AD7six Я запустил (myEnv) C:Users...>git clone ssh://git@bitbucket.org/indoors/....git , И результат был таким: Cloning into '...'... Enter passphrase for key '/c/Users/.../.ssh/id_rsa': remote: Counting objects: 2053, done. remote: Compressing objects: 100% (1648/1648), done. remote: Total 2053 (delta 1279), reused 385 (delta 200) Receiving objects: 100% (2053/2053), 1.88 MiB | 611.00 KiB/s, done. Resolving deltas: 100% (1279/1279), done. я извлек файлы из репозитория, кажется, это сработало, но как насчет тегов после слова git?

Ответ №1:

 $ pip install -r requirements.txt
...
ERROR: Command errored out with exit status 128: 
   git clone -q 'ssh://****@bitbucket.org/.../...git' 'C:Users...AppDataLocalTemppip-req-build-t9_wrhxh'
   Check the logs for full command output.
 

Эта строка из запущенной установки pip включает выполняемую команду. Это просто обычная git clone запись во временный каталог (которую можно игнорировать), которая завершается неудачей. Флаг -q (тихий) подавляет некоторые выходные данные.

 $ git clone ssh://git@bitbucket.org/.../....git
...
Enter passphrase for key '/c/Users/.../.ssh/id_rsa': 
 

Эта строка из клонирования напрямую указывает на то, что, хотя клонирование прошло успешно, ключ, используемый для аутентификации с помощью bitbucket, имеет парольную фразу. При клонировании в интерактивном процессе git может запрашивать его, но это неверно в неинтерактивном процессе (например, pip).

Решение

Существует несколько способов решить эту проблему, но самым простым было бы:

  • Создайте новую пару ключей ssh без парольной фразы
  • Добавьте этот ключ в свою учетную запись bitbucket
  • Настройте ssh для использования этого ключа с bitbucket.org
 Host bitbucket.org
   IdentityFile ~/.ssh/no_passphrase.id_rsa
 
  • успех

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error command encore not found
  • Error command echo
  • Error command dev not found
  • Error command clang failed with exit status 1
  • Error comma colon decorator or end of line expected after operand

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии