Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with socks5 proxy #1424

Closed
bcersows opened this issue Aug 9, 2016 · 9 comments · Fixed by #3677
Closed

Error with socks5 proxy #1424

bcersows opened this issue Aug 9, 2016 · 9 comments · Fixed by #3677

Comments

@bcersows
Copy link

bcersows commented Aug 9, 2016

Hey there.

I got some problems when using git-lfs behind a socks proxy.
The proxy settings in the git config are as follows:
http.proxy=socks5://127.0.0.1:3334

When git pushing an error is thrown:

$ git push
Git LFS: (0 of 1 files) 0 B / 154.28 MB
Post https://_username_@_ip_/binaries/lfs.git/info/lfs/objects/batch: http: error connecting to proxy http://socks5://127.0.0.1:3334: dial tcp: lookup socks5: getaddrinfow: No such host is known.

So the config is read, but git-lfs tries to connect to the proxy while appending another protocol (http://). When there's already one in place it should be used, imo.

KR,
bcersows

@technoweenie
Copy link
Contributor

Thanks for the report, Git LFS only supports http(s) proxies right now. I've added this to the roadmap for v1.4.

@technoweenie technoweenie added this to the v2.0.0-maybe milestone Feb 9, 2017
@ttaylorr ttaylorr modified the milestones: v2.0.0-maybe, v2.0.0 Feb 14, 2017
@ttaylorr ttaylorr modified the milestones: v2.0.0, v2.1.0 Feb 21, 2017
@technoweenie technoweenie moved this from Roadmap Backlog to Enhancements in Backlog Mar 13, 2017
@ttaylorr ttaylorr modified the milestone: v2.1.0 Apr 4, 2017
@ttaylorr ttaylorr removed this from Enhancements in Backlog Apr 4, 2017
@technoweenie technoweenie added this to Enhancements in Backlog Apr 19, 2017
@KjellMorgenstern
Copy link

What can be done to push this forward? Are there any blockers?

I think I have a similar problem: tsocks is configured on port 9500. I can run git commands through the proxy with
tsocks git fetch --all without problems.
However tsocks git lfs pull fails, I see
Downloading LFS objects: 0% (0/1), 0 B | 0 B/s,
and there is no timeout, or at least a very long one.

My git lfs --version is
git-lfs/2.5.0 (GitHub; linux amd64; go 1.10.3)

@ttaylorr
Copy link
Contributor

ttaylorr commented Jul 30, 2018 via email

@paulo-raca
Copy link

paulo-raca commented Aug 7, 2018

+1, had problems with Socks proxy today :(

I'm actually trying to push (First commit using LFS), and I get this:

$ git push
Git LFS: (0 of 23 files) 0 B / 841.19 MB
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
batch response: Post https://me@example.com/somerepo.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5h on 127.0.0.53:53: server misbehaving
error: failed to push some refs to 'https://me@example.com/somerepo.git'

@coding-pandaren
Copy link

same problem

_POST git-upload-pack (175 bytes)
remote: Counting objects: 1159, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 1159 (delta 0), reused 0 (delta 0), pack-reused 1156
Receiving objects: 100% (1159/1159), 3.29 MiB | 622.00 KiB/s, done.
Resolving deltas: 100% (326/326), done.
Downloading third_party/glfw/libs/mac/libglfw3.a (784 KB)
Error downloading object: third_party/glfw/libs/mac/libglfw3.a (05429db): Smudge error: Error downloading third_party/glfw/libs/mac/libglfw3.a (05429db19a57ac7ff7fac2b61cc1a036fcc9ea013191fa0dde39ff8f1486f076): batch response: Post https://github.com/CaiHuan/self_study.git/info/lfs/objects/batch: proxyconnect tcp: dial tcp: lookup socks5: no such host

Errors logged to G:\github\self_study.git\lfs\logs\20180830T144757.7638638.log
Use git lfs logs last to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: third_party/glfw/libs/mac/libglfw3.a: smudge filter lfs failed
_

@ruffapuffa
Copy link

What can be done to push this forward? Are there any blockers?
Thanks for asking. I don't have an environment set up to simulate this sort of failure, so we would need to get in touch with someone who (1) does have this sort of thing set up and (2) has the time to look into and fix this bug. If (1) and (2) are you, I would be more than happy to point you in the right direction to figure out what's going on here.

I have (1) fulfilled and is willing to look into it (to at least some extent depending on the size of the fix).
Please message me about any details. I have not been involved with any previous git-lfs development and not that much with go either (I know quite many other languages though).
Anyhow. If you can point me in the right direction I might give it a go (pun not intended;).

@bk2204
Copy link
Member

bk2204 commented Feb 12, 2019

I think this may have been fixed in golang/go#18508 if your protocol scheme is socks5. If you're using socks5h, then it may not have been fixed. A solution that uses a custom dialer depending on the setting of the http_proxy environment variable is probably the correct approach if you want to fix this in Git LFS.

@capraynor
Copy link

Same problem here. When I run git clone with a socks5 proxy setup, git LFS won't download the file, because it cannot identify socks5:// scheme.

lookup socks5: no such host

@bk2204
Copy link
Member

bk2204 commented Jun 6, 2019

Okay, I think there are two issues here. One is that we don't support socks5h, which is known and is a limitation in Go. The other is that we seem to prepend http:// to the proxy if it doesn't contain it, which is probably not a good idea if we want SOCKS support to work. I can easily fix the latter in this case, and I've opened #3677 to do so. The socks5h support will come automatically when Go supports it.

If somebody would like to test that commit using the following, then that would give me more confidence that there isn't some other underlying issue:

$ go get github.com/git-lfs/git-lfs
$ cd "$GOPATH/src/github.com/git-lfs/git-lfs"
$ git remote add bk2204 https://github.com/bk2204/git-lfs.git"
$ git fetch bk2204
$ git checkout -t bk2204/socks5
$ make
# Then try bin/git-lfs

@bk2204 bk2204 removed this from Enhancements in Backlog Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants