-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go get fails with private bitbucket repositories #27344
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
Comments
I had Similar issues in more than one laptop with Ubunto, MacOs and windows, and instead of blind troubleshooting (or reinstall git that sometimes helped mainly on windows), I resolved/worked around with these (temp/troubleshooting) changes/steps :
that would:
In other words - this will not SOLVE your problem but has a good success rate of showing where the issue is. tips: and last ... return your original bin/go :) |
Reason and suggested resolution: When go get command tries to pull a bitbucket repo, it first tries to get the repo details as a public repo, resolving in the "403 Forbidden" reply. Then it tries to check if a private repo is git or hg (as per issue #5375) , first using git, that will also resolve in 403 - if global git config does not include user.name , user.email. vcs.go main problem is not reporting right statuses that will aid the user to resolve the configuration by himself.
git config --global user.name "your-bitbucket-user"
Comments: If no comments, I can probably set some of the above logic coded in place (vcs.go). |
For (1), we shouldn't print anything that looks like an error until we're sure it's actually an error. If we get all the way through the chain of attempts and it's still failing, then we should display a helpful message. For (2), that seems too specific (to git and to BitBucket). Perhaps a URL (such as https://golang.org/doc/faq#git_https or a Wiki page) would be more helpful? That could collect configuration steps for various providers and tools without baking it into the For (3), we should probably pass through the explicit error from the tool. (That's #25982.) |
|
This looks to be a duplicate of #16315. |
Is it possible to have an option to use GOPATH by default and for anything it doesn't find, then vgo the rest? That way, private repo's and others like this one could be set up either manually prior to an automated like build. |
Anyone with a workaround that actually works? (sorry for empty comment) This has been rather painful and I think my next stop is to go back to GOPATH and restore vendoring |
Jonathan, we are constantly working with private bitbucket repos and
modules, and the workarounds I described above works for multiple
developer's on various os.
If you are experiencing a similar, yet not exact issue, please use the
"what I did/expect/actually got" Template to describe the issue, including
what os are you using.
I will try to visit our developer onboarding documents, to see if the
description above is still accurate, and if it's not, post here.
…On Wed, 25 Sep 2019, 6:26 Jonathan ES Lin, ***@***.***> wrote:
Anyone with a workaround that *actually works*? (sorry for empty comment)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27344?email_source=notifications&email_token=ABNEY4VNPGCBJHYTK3GZKXTQLLK6XA5CNFSM4FSHNFYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7QOYTA#issuecomment-534834252>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABNEY4TYRWURSROX4EW3BJTQLLK6XANCNFSM4FSHNFYA>
.
|
I downgraded to 1.12.9 and was able to do a Something is not working right with regard to this in 1.13 |
In Order to be able to help you (and decide if its the same issue as 27344 or need a new related issue), can you complete in the format of this issue details |
I have a similar issue (I think it is the same) |
I can confirm that this issue happened for me too, I recently updated to 1.13.5 and it wasn't working, downgraded to 1.12.14 and it worked first try. |
@harrisa1, @ernsheong: see https://golang.org/wiki/NoPlusOne. Since the original post here was reported against Go 1.11, a failure that occurs with 1.13.5 but not 1.12.14 is unlikely to be the same root cause. Please open a new issue with steps to reproduce the failure. |
Duplicate of #25982 |
The answer for whoever coming here from google search. To setup private bitbucket cloud
Make sure you have setup SSH key access in bitbucket https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html . Your private key |
I did that same thing after that did this export GOPRIVATE="bitbucket.org/YOUR_COMPANY" closed the console window, restarted my IDE and it worked, i had tried everything already but i worked for me. |
What also works is configuring the machine github.com login $GitHubUserName password $GitHubAccessToken
machine bitbucket.org login $BitBucketUserName password $BitBucketAppPassword (In this case I also specify credentials to be use for GitHub private repos) And populating the environment variable |
Expose the variable as given below may solve the given problem. References: |
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.
ensure that a valid ssh key exists for bitbucket,
~/.ssh/id_bitbucket
use
go get
on a private bitbucket repo with modules enabledWhat 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.The text was updated successfully, but these errors were encountered: