mux_client_request_session: session request failed: Session open refused by peer
Asked Answered
T

2

8

I use bitbucket to host some git repositories.

When I try to do:

git pull && git push

I get:

mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /home/ravi/.ssh/sockets/[email protected]:22 already exists, disabling multiplexing
Tigges answered 25/9, 2018 at 10:29 Comment(0)
T
13

bitbucket.org has intentionally disabled ssh multiplexing, so edit your ~.ssh/config file so ssh doesn't try to multiplex when connecting to it.

If you have ControlMaster at the top level of config, make sure it is removed as it supersedes any Host section configuration.

Then add:

Host bitbucket.???  # .org and .com
  ControlMaster no

Host *
  ControlMaster auto
  ControlPersist yes
  ControlPath ~/.ssh/socket-%r@%h:%p

Note that Host bitbucket.org must come before Host *.

Also, the ControlPath should only be writable by yourself.

Then, if the ControlSocket named in the error message is still there, delete it. (It will auto-delete based upon the timeout in ControlPersist.

Tigges answered 25/9, 2018 at 10:29 Comment(1)
Do you know of any similar issue for gitlab?Joannjoanna
L
3

Another way is to change git ssh command in your local repo configuration and disable multiplexing mode.

git config --local core.sshCommand "ssh -o ControlPath=none"
Lelia answered 23/6, 2020 at 7:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.