On execution of
go get bitbucket.org/../..
I get this error
yash.jain projectname % go get bitbucket.org/../..
go: bitbucket.org/../..
https://api.bitbucket.org/2.0/repositories/../..?fields=scm: 403 Forbidden
go: error loading module requirements
What I tried
Setup the ssh key (Working as expected, tested by pushing and pulling the code)
Set the go env variables to this:
GOPRIVATE="" GOPROXY="direct" GOSUMDB="off"
.gitconfig looks like this
[url "[email protected]:"] insteadOf = https://bitbucket.org/ [user] email = [email protected] name = yashjain
Added keys to ssh-agent
ssh-add -l ssh-add -k
.ssh/config file looks like this
Host bitbucket.org HostName bitbucket.org User git IdentityFile ~/.ssh/id_rsa UseKeychain yes StrictHostKeyChecking no
Still, I get the same error. Please let me know If I'm doing something wrong.
Check first what
ssh -Tv [email protected]
returns, specifically the user mentioned in the Welcome message: it could be an account, which does not have access to the private repository.As mentioned in "What's the proper way to “go get” a private repository?", try also with a private ssh key not protected by a passphrase, to make sure there is no prompt for said passphrase in the middle of the
go get
process.