Skip to content

cmd/go: go get fails with private bitbucket repositories #27344

Closed
@savaki

Description

@savaki

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOOS="linux"
GOARCH="amd64"

What did you do?

I attempted to go get from a private bitbucket repository.

  1. add the following to ~/.gitconfig
[url "[email protected]:"]
	insteadOf = https://bitbucket.org/
  1. add the following to ~/.ssh/config
Host bitbucket.org
  HostName bitbucket.org
  User git
  IdentityFile ~/.ssh/id_bitbucket
  StrictHostKeyChecking no
  1. ensure that a valid ssh key exists for bitbucket, ~/.ssh/id_bitbucket

  2. use go get on a private bitbucket repo with modules enabled

What did you expect to see?

I expected the private repository to be pulled to the appropriate ${GOPATH}/pkg/mod
directory.

What did you see instead?

go: bitbucket.org/myprivaterepo/[email protected]: https://api.bitbucket.org/2.0/repositories/myprivaterepo/projectname?fields=scm: 403 Forbidden

In the golang-nuts group, Russ had previous posted that this was an issue and could be resolved by hand. With the advent of modules, manually checking out the correct version and putting it into the correct location becomes way more problematic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions