Closed sedyh closed 3 hours ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
go get -v -x gitlab.private.com/gamedev/commons
# get https://gitlab.private.com/?go-get=1
# get https://gitlab.private.com/gamedev/commons?go-get=1
# get https://gitlab.private.com/gamedev?go-get=1
# get https://gitlab.private.com/gamedev/commons?go-get=1: 200 OK (0.819s)
get "gitlab.private.com/gamedev/commons": found meta tag vcs.metaImport{Prefix:"gitlab.private.com/gamedev/commons", VCS:"git", RepoRoot:"https://gitlab.private.com/gamedev/commons.git"} at //gitlab.private.com/gamedev/commons?go-get=1
mkdir -p /home/sedyh/.local/share/go/path/go1.23.1/pkg/mod/cache/vcs # git3 https://gitlab.private.com/gamedev/commons.git
# lock /home/sedyh/.local/share/go/path/go1.23.1/pkg/mod/cache/vcs/b58bd48d22cffaaf92db9d87a71861290aa006affbdfbefce917125ccddb3f60.lock
# /home/sedyh/.local/share/go/path/go1.23.1/pkg/mod/cache/vcs/b58bd48d22cffaaf92db9d87a71861290aa006affbdfbefce917125ccddb3f60 for git3 https://gitlab.private.com/gamedev/commons.git
cd /home/sedyh/.local/share/go/path/go1.23.1/pkg/mod/cache/vcs/b58bd48d22cffaaf92db9d87a71861290aa006affbdfbefce917125ccddb3f60; git ls-remote -q origin
# get https://gitlab.private.com/gamedev?go-get=1: 200 OK (0.955s)
# get https://gitlab.private.com/?go-get=1: 200 OK (1.024s)
0.866s # cd /home/sedyh/.local/share/go/path/go1.23.1/pkg/mod/cache/vcs/b58bd48d22cffaaf92db9d87a71861290aa006affbdfbefce917125ccddb3f60; git ls-remote -q origin
# get https://gitlab.private.com/gamedev/commons.git
# get https://gitlab.private.com/gamedev/commons.git: 200 OK (0.213s)
go: module gitlab.private.com/gamedev/commons: git ls-remote -q origin in /home/sedyh/.local/share/go/path/go1.23.1/pkg/mod/cache/vcs/b58bd48d22cffaaf92db9d87a71861290aa006affbdfbefce917125ccddb3f60: exit status 128:
git@gitlab.private.com: Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
This does not help and not changing the output of go get -x -v
:
https://github.com/golang/go/issues/52942#issuecomment-1129799918
you also need ssh config
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
For questions please refer to https://github.com/golang/go/wiki/Questions
You also need ssh config.
@seankhliao, I think the key is in ssh config, it was added via ssh-add. So it may be a bug.
ssh-add -l
3072 SHA256:t7gDkBCuViQVz1k2OG33BwcO3JTlm+Rgot848F/QKa0 sedyh@sedyh-pc (RSA)
Well, that was happening because there was two servers on my machine and git was looking on 22 which is tty, and not gitlab ssh server ._.
So I need to specify the port manually:
cat ~/.gitconfig
[user]
email = sedyh.moto@gmail.com
name = Artem Sedykh
[url "ssh://git@gitlab.private.com:2224/"]
insteadOf = https://gitlab.private.com/
Go version
go version go1.23.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Add ssh key to gitlab and check ssh server address:
Add a new
~/.gitconfig
entry:Export
GOPRIVATE
in~/.zshrc
(also could exportGONOSUMDB
andGONOPROXY
, but not necessary).Trying to get package:
What did you see happen?
What did you expect to see?
Working download. The key is 100% right, I've rechecked it several times. It should work because gamedev is userspace, not the subgroup. I guess its related with ssh server is being on
2224
port and not22
, because it worked on a different gitlab instance with a standard port. I think:
ininsteadof
config should be able to use any port? Also, adding:2224
in exported variables and~/.gitconfig
does not help so I don't know what else can I try to make it work.Related: https://github.com/golang/go/issues/36666 https://github.com/golang/go/issues/26232