git annex / ssh : ControlPath too long
Asked Answered
B

1

11

when running the command : git annex sync, I get the following error:

ControlPath too long
Command ssh ["-S","<local path to git repo>/.git/annex/ssh/git@<git url>","-o","ControlMaster=auto","-o","ControlPersist=yes","git@<git url>","git-annex-shell 'configlist' '<local path to git repo>'"] failed; exit code 255

according to this , the issue is not git but ssh (but the solution proposed there did not work).

Anything I could to to avoid this issue ?

Brettbretz answered 4/9, 2015 at 8:35 Comment(0)
J
9
"-S","<local path to git repo>/.git/annex/ssh/git@<git url>"

This path shouldn't be longer then 92 characters, as unix(7) proposes:

When coding portable applications, keep in mind that some implementations have sun_path as short as 92 bytes.

If you know you dive too deep in the directory structure and the path will extend this limit, you can do one of these things, based on man git-anex in your .git/config:

  1. Turn off connection sharing completely using annex.sshcaching=off. Warning: This will significantly increase the time and resources that are required to do all operations!

  2. Specify your own path for shared connections, using annex.ssh-options="-S=~/.ssh/control-%l.%r@%h:%p" -oControlMaster=auto

Jurado answered 4/9, 2015 at 8:56 Comment(3)
sshcaching=false (note: not 'off') leads to : 'GitLab: Disallowed command'. Playing with ssh-options does change anything (I tried various things, including your suggestion), especially the list displayed after 'Command ssh' does not change.Brettbretz
I edited the answer a bit, because I missed ControlMaster option. But it is possible it is getting overwritten by the annex. What happens if you specify both points I posted? If nothing helps, provide the output with annex.ssh-options="-vvv"Jurado
sshcaching=off and ssh-options="-vvv"/"-S=~/.ssh/control-%l.%r@%h:%p" -oControlMaster=auto" leads to no changes to the output. sshcaching=false leads to [start]GitLab: Disallowed command Command ssh ["<git host url>","git-annex-shell 'configlist' '<local path to git repo>'"] failed; exit code 1[end]. ssh-options seem to be indeed ignoredBrettbretz

© 2022 - 2024 — McMap. All rights reserved.