Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bitbucket ssh error setsockopt IPV6_TCLASS 8 Operation

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

like image 431
Robert Avatar asked Nov 17 '18 21:11

Robert


People also ask

What does setsockopt ipv6_tclass error 8 mean?

"setsockopt IPV6_TCLASS 8: Operation not permitted" (but git fetch command itself eventually finishes correctly) Expected results the setsockopt() function should succeed without warnings.

What happened to gitgit fetch in IPv6 env?

git fetch in IPv6 env now has this warning: "setsockopt IPV6_TCLASS 8: Operation not permitted" (but git fetch command itself eventually finishes correctly)

How do I connect to Bitbucket using SSH?

You can use git or hg to connect to bitbucket. Shell access is disabled. If you receive a Permission denied (publickey) error, and you've already verified that your key is loaded into your SSH agent and into your Bitbucket account, you can get more information about your connection issues:

Why is ipv6_tclass blocked?

IPv6 relies heavily on ICMP, so if ICMP requests are being blocked, that could be your problem. You'd probably still get setsockopt IPV6_TCLASS 16: Operation not permittedmessage once you connect via SSH as @Alkarexmentioned above, though... that's what brought me here.


2 Answers

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.

like image 86
VonC Avatar answered Sep 29 '22 20:09

VonC


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.

like image 45
Robert Avatar answered Sep 29 '22 21:09

Robert