bitbucket ssh error setsockopt IPV6_TCLASS 8 Operation - windows

I'm having issues connecting to a Bitbucket repository using SSH. I have the public and private keys set up correctly. I'm worried that the issue is due to the fact that I"m working on a Windows 10 machine. Does anyone know how to get around the following error:
*setsockopt IPV6_TCLASS 8: Operation not permitted:
repository access denied. deployment key is not associated with the requested repository.
fatal: Could not read from remote repository .
Please make sure you have the correct access rights and the repository exists.*
I know I am in the repository. I can check out different branches in the repository and commands such as "git add" and "git commit" appear to work, however, "git push" is failing due to the above mentioned error.
Thank you

Make sure to use the latest Git for Windows (2.19.1) and, as I mentioned here, try a git push -4 ...
That will force the use of IPV4, to check if that would work better.
As detailed in this thread:
For me it's an IPv6 issue.
BitBucket doesn't respond to IPv6 ssh requests, so you have to wait for it to timeout.
I fixed it by adding:
AddressFamily inet
to /etc/ssh/ssh_config and git pull responds within seconds not minutes.
The last part is only valid if you are using an SSH URL, and for git pull, but might still have an effect for git push.
As noted by xpt in the comments, WSL issue 1869 says it OK to put AddressFamily inet into ~/.ssh/config, but I've just tried it, and it was not working for me, until I put it into /etc/ssh/ssh_config instead.

Thank you everyone for your help. There were two issues causing this.
First, the IPV6 warning itself was resolved once I upgraded from git version 2.7.4 to 2.19.1.
After making this adjustment I still saw an error "Permission denied (publickey)..."
I resolved this error by moving the private key, id_rsa, to the following location:
/c/Users//.ssh/
Everything seems to be in order now.

Related

Unable to pull and push to git via cmd

I got a problem. A am trying to learn git. I initialized my local repo, added everything, committed. I'm using atom cmd and bash, because there are some commands, that are unavailable in atom cmd. I created an ssh-key, added it and everything works fine. I am trying to synchronize everything and pull from the remote repo, but I am getting an error:
PS C:\Users\keldranase\Documents\Obsidian Vaults> git pull origin master --allow-unrelated-histories
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
At the same time, when I am doing same using bash, everything works fine:
keldranase#DESKTOP-SH6U8NC MINGW64 /c/users/keldranase/documents/Obsidian Vaults (master)
$ git pull origin master --allow-unrelated-histories
Whats the reason behind this? How to solve this problem? What am I doing wrong? Your help would be appreciated.
Screenshot:
Your SSH key is not loaded. You need first to start the ssh client and then add the ssh key, you can find more information here. And here you can find some useful troubleshooting information for your error and other issues you might experience with SSH - Error Permission Denied.

git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054

I'm having trouble cloning a repo on git. I've been trying for to days and have tried quite a few solutions (in most the problem was slightly different but seemed to apply) but nothing has done anything to make a difference.
I've tried switching off the anti-virus and firewall but that didn't help.
I've also tried uninstalling and reinstalling the network adapter drivers (and restarting the computer) and that didn't work.
From what I understand it's a network issue somewhere as the remote server keeps hanging up but I'm not managing to get anywhere with the issue.
Using git clone -v --progress seemed to give the same output as git clone.
Output from git clone -v --progress https://github.com/mit-cml/appinventor-sources.git
Cloning into 'appinventor-sources'...
POST git-upload-pack (gzip 1425 to 774 bytes)
remote: Counting objects: 41649, done.
remote: Compressing objects: 100% (7/7), done.
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
I've now tried increasing the buffer again
git config --global http.postBuffer 1048576000
but still nothing.
I'm following the solution from The remote end hung up unexpectedly while git cloning for troubleshooting.
I resolved the same problem by this:
git config http.postBuffer 524288000
It might be because of the large size of repository and default buffer size of git so by doing above(on git bash), git buffer size will get increase.
I had the same issue, and I have solved it by changing my net connection.
In fact, my last internet connection was too slow (45 kbit/s).
So you should try again with a faster net connection.
I had the same problem, and #ingyhere 's answer solved my problem .
follow his instructions told in his answer here.
git config --global core.compression 0
git clone --depth 1 <repo_URI>
# cd to your newly created directory
git fetch --unshallow
git pull --all
you need to increase the buffer size (it's due to the large repository size),
so you have to increase it
git config http.postBuffer 524288000
Althought you must have an initializd repository, just porceed as the following
git init
git config http.postBuffer 524288000
git remote add origin <REPO URL>
git pull origin master
...
git config --global http.postBuffer 524288000
Work in my case - AWS code commit
This happens when you push first time without net connection or poor net connection.But when you try again using good connection 2,3 times problem will be solved.
I have tried "git init" and it worked like charm for me.
I got it from the link Git push error: RPC failed; result=56, HTTP code = 200 fatal: The remote end hung up unexpectedly fatal
(based on anser from Hakan Fıstık)
You can also set the postBuffer globally, which might be necessary, if you haven't checkout out the repository yet!
git config http.postBuffer 524288000
Uninstalling(version: 2.19.2) and installing(version: 2.21.0) git client fixed the issue for me.
just Disable the Firewall and start again. it worked for me
It could be an issue with your network (i.e. not an issue with any of your git configs, firewall, or any other machine settings). To confirm this, you could test the following:
See if this issue persists on the same network on different machines (this was true for me).
Try running the problematic git command (for me it was git pull) on a different network and see if it works. I brought my desktop over to a friend's and confirmed that the command did indeed work without any modifications. I also tested the command from my laptop on an open network nearby and the command also started suddenly working (so this was also true for me)
If you can confirm #1 and #2 above, it may be time to schedule an appointment with a technician from your ISP. I have fiber internet in a fairly newish building and when the technician arrived they went to my building's telecom room and switched my internet port. That somehow seemed to fix the issue. He also let me know that there were other issues at large going on in my building (so it could have nothing to do with your machine or things in your control!).
If that fails, maybe consider switching internet providers if that's an option for you. Else, just keep calling your ISP to send in more and more senior technicians until it gets resolved.
I'm hoping nobody actually has to resort to what I did to find the problem.
tl;dr: Give your ISP a call as the issue could be one with your network.
All these tips did not work for me,
what worked was cloning over ssh rather than http
Following steps helped me to fix this issue,
Solution 1:
git checkout master
git pull
git checkout [you current branch]
git pull
You can also set git config http.postBuffer 524288000 to increase the network buffer
Solution 2:
Sometimes it happens when you are cloning your repo using VPN and it fails to verify the SSL
Try this out it may help:
git config http.sslVerify "false"
I had the same issue and found out the problem was with my internet speed, after getting on a better connection the problem was solved solved.
Before cloning just run "git init". It will create local .git and it will allow for clone.
If you have VPN opened, close and try it again.
It's mentioned as SSL_ERROR_SYSCALL, errno 10054.
To resolve this SSL issue I went to .gitconfig file (which is located in c drive in my desktop) I changed sslverify to false and added my username and email id.
sslVerify = `false` //make sslVerify as false
[user]
name = `***<Enter your name>**`
email = `**<Email Id>**`
I had the exact same problem while trying to setup a Gitlab pipeline executed by a Docker runner installed on a Raspberry Pi 4
Using nload to follow bandwidth usage within Docker runner container while pipeline was cloning the repo i saw the network usage dropped down to a few bytes per seconds..
After a some deeper investigations i figured out that the Raspberry temperature was too high and the network card start to dysfunction above 50° Celsius.
Adding a fan to my Raspberry solved the issue.
What I did is moved the dependencies list to the end of
#Pods for <app>
In Podfile. Like this:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target '<app>' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for <app>
target '<app>Tests' do
inherit! :search_paths
# Pods for testing
end
target '<app>UITests' do
inherit! :search_paths
# Pods for testing
end
pod 'Firebase/Core'
pod 'Firebase/Database'
end
In my case, its something wrong with my DNS server, after i add a new github.com record in the hosts, the problem solved.
13.114.40.48 github.com
1. Go to https://gitforwindows.org
2. Download
3. Install (no need to uninstall)
4. That's it! No more error: RPC failed; curl 56 OpenSSL SSL_read: No error
I too have faced this issue today. I have tried all the options shared in this thread but I was still having the issue.
I tried cloning after connecting to my corporate VPN and cloning got completed successfully. So, guys it might have to do with your local firewall policy. Factor in that as well :)
This is what works for me.
git config --global http.sslVerify "false"
For me, git config --global http.postBuffer 524288000 alone did not fix it, I had to run git config --global core.compression 0 as well.
this issue is resolved by cloning using SSH key.
first of all set the ssh key and then add it to your git/github account. and then try to clone using ssh instead of using http.
in my case this solved my problem.
i tried all the other solution including increasing the buffer size, changing the git version, etc.
none of these solution works in my case.
I've tried postBuffer, core.compression and --depth 1, nothing is working perfectly, I mean sometimes, I could clone but most of the time, I got the same error. For me, it got worked out by cloning using SSH url. You can follow below steps to clone in ssh way
create ssh key
create .ssh folder in your user directory (C:\Users\Rence Abishek\) and inside .ssh folder, create a file named id_rsa
Open your terminal from user dir and execute below commands to create ssh private and public key
ssh-keygen -t rsa -b 4096 -C "renceabishek#abc.com"
press y to override existing file i.e id_rsa and not require to give passphrase, just hit enter
eval $(ssh-agent -s)
ssh-add ./.ssh/id_rsa
copy ssh key to your git version control(gitlab,bitbucket,github..etc)
Execute cat ./.ssh/id_rsa.pub command in terminal to get public key in console, now copy that and go to your GIT version control setting and add your copied public key.
Github -> click on your profile(top right cornor) -> setting -> SSH and GPG Keys -> New SSH Key button
clone repo
Now clone using ssh url git clone YOUR_SSH_URL
try this,
git init first/reinitialize
then, global http.postBuffer 157286400
after that, just set/add ur remote like before
add, commit, push. this solves mine
For me the issue was with my wifi extender. When I connect directly to my wifi without using extender, it started working.

Xcode - Authentication failed error when adding repository with SSH auth

I am trying to add repository via Xcode > Settings > Accounts and I am stuck on the proper address. Address of our repo is quite simple: my.domain.com:port/project-name. Authentication via SSH Keys. Could someone help me to understand what's going on here? See screenshot below.
By the way running git clone git+ssh://git#my.domain.com:port/project-name works fine.
EDIT
Running git clone without git+ssh//
git clone git#my.domain.cz:2222/project-name
or
git clone git#my.domain.cz:22/project-name
is giving me same error:
ssh: connect to host my.domain.cz port 22: Connection refused
fatal: Could not read from remote repository
Please make sure you have the correct access rights and the repository exists.
Xcode accepts just ssh://git#my.domain.cz:2222/project-name.
The git protocol is somehow redundant in this case. Raw git tools don't have a problem with it, but Xcode does not like it for some reason.
It always fails for me when I use existing ssh keys.
I created a new ssh key pair through Xcode and uploaded the public key to the git server (in my case, Phabricator), and it works.

Tortoise git fails with No supported authentication methods available (server sent: publickey)

I'm at a loss here. I had tortoise working fine but something changed. Now whenever I try to commit or pull from a remote repo I get
git.exe push --progress "origin" master:master
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git did not exit cleanly (exit code 128) (1250 ms # 3/23/2014 10:18:15 AM)
I have the GIT_SSH env var set to C:\Program Files (x86)\PuTTY\plink.exe and I have pagaent.exe running with my loaded private keys. github has my public keys.
Running the same command in the console
git.exe push --progress "origin" master:master works just fine though! I've tried uninstalling tortoise, upgrading git, creating a new ssh key, nothing seems to work.
Can anyone point me in the right direction?
I found the problem. I had installed Gow at some point which came with a version of pageant which I was spawning. This version of pagaent is somehow different than the one that comes with Putty and so tortoise was failing. When I ran the version of pagaent that comes with Putty everything finally worked again.
It is better to use the one from TortoiseGit.
It is called TortoiseGitPlink.
More QA is done tightly with TortoiseGit.

"no address associated with name" error when cloning github.com's repo under Windows using ssh

Searching google for +github +ssh "no address associated with name" gives the following SO questions as the 4 top results:
github no address associated with name
Github push origin master not working
Syncing with github
GITHUB setup - no address associated with name
None of them gives answer to my problem, though.
c:\Program Files (x86)\Git\bin>git --version
git version 1.7.7.1.msysgit.0
c:\Program Files (x86)\Git\bin>ssh git#github.com
Enter passphrase for key '/c/Users/Piotr/.ssh/id_rsa':
Hi piotr-dobrogost! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
c:\Program Files (x86)\Git\bin>git clone ssh://git#github.com:piotr-dobrogost/requests.git
Cloning into requests...
ssh: github.com:piotr-dobrogost: no address associated with name
fatal: The remote end hung up unexpectedly
I guess the problem is caused by git passing github.com:piotr-dobrogost as the hostname to ssh instead just github.com only. Why does git do this and what's the solution?
You answered it yourself - the problem is that you're passing github.com:piotr-dobrogost as the hostname, which is, in fact, not a valid hostname. git will understand either proper URLs to a repository, or a repository path in SCP format (see man 1 scp.) For a proper URL, try:
git clone ssh://git#github.com/piotr-dobrogost/requests.git
Which is equivalent to the following in SCP path format:
git clone git#github.com:piotr-dobrogost/requests.git
I had this same problem, and it's turn out it was DNS problem.
The DNS settings were wrong and the machines simply could not reach the remote git repository.
I am running a private git server with an address assigned by DHCP; this address seems to remain static. From time to time, authenticating with the remote host gives the "no address associated with this name" error.
However, I edit the known_hosts file for my client (which for me resides at C:\Users\MyUserName\.ssh\known_hosts) and delete the line that refers to the private git server:
gitserver.local,10.0.0.10 ssh-rsa AAAABCAAAA....
I then connect again to the git server and issue a pull request. This time, git asks whether to cache the SSH key and the pull concludes successfully, without the "no address associated with name" error.
So, I suspect that something about the RSA key, or how that key relates to DNS, is getting screwed up. If nothing else gives joy, try manually deleting and automatically reinstalling the RSA key on the client. This should not actually work, but it seems to work in my case. I have no clear idea why this should be so.

Resources