Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip cannot clone from https anymore - error 128

Tags:

git

pip

gitea

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.

like image 707
CL40 Avatar asked Oct 17 '19 03:10

CL40


People also ask

How to fix Git clone HTTPS protocol is not supported?

Use git clone Times in Git Bash fatal: protocol 'https' is not supported. Used copy and paste address. Whether it is shift+ins or right-click paste, there are hidden symbols in the space between https and clone. Delete the space and manually enter the space to solve it. Please make sure you have the correct access rights and the repository exists.

How do I ignore SSL certificate in Pip?

Pip Install – Ignore SSL Certificate. Warning: Adding the repositories to the trusted sources disables SSL certificate verification and exposes a vulnerability to a man-in-the-middle attack. To configure pip to ignore SSL certificate verification, add the required repositories to the trusted sources, for example: $ pip install --trusted-host pypi.

Is it possible to use TLS/SSL with Pip?

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. ERROR: Could not find a version that satisfies the requirement pandas (from versions: none) WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Why am I unable to clone a private repository?

If you are trying to clone a private repository but do not have permission to view the repository, you will receive this error. In rare circumstances, you may not have the proper SSH access to a repository.


3 Answers

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.

like image 92
sinoroc Avatar answered Oct 21 '22 16:10

sinoroc


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                   
like image 28
Jim K. Avatar answered Oct 21 '22 16:10

Jim K.


Change the code in the file.

The original code is:

pip install git+https://github.com/snkas/[email protected] | | exit 1
pip install git+https://github.com/snkas/[email protected] | | exit 1

Change to:

pip install git+git://github.com/snkas/[email protected] | | exit 1
pip install git+git://github.com/snkas/[email protected] | | exit 1
like image 1
custCJ Avatar answered Oct 21 '22 14:10

custCJ