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

go-getter failed in some cases #257

Open
Shell32-Natsu opened this issue Jun 1, 2020 · 3 comments
Open

go-getter failed in some cases #257

Shell32-Natsu opened this issue Jun 1, 2020 · 3 comments

Comments

@Shell32-Natsu
Copy link

Shell32-Natsu commented Jun 1, 2020

Some sub directories cannot be gotten

❯ go-getter 'github.com/hashicorp/go-getter/testdata' ./test
2020/06/01 11:04:41 Error downloading: read /tmp/getter245563257/temp/testdata/detect-file-symlink-pwd/syml/pwd: is a directory

Meanwhile some sub dirs work

❯ go-getter 'github.com/hashicorp/go-getter/helper/url' ./test
2020/06/01 11:06:18 success!

ref doesn't work when get sub directory

❯ go-getter 'github.com/hashicorp/go-getter/helper/url?ref=master' ./test
2020/06/01 11:05:40 Error downloading: subdir "helper/url%253Fref=master" not found

Force protocol doesn't work with sub dir

❯ go-getter 'git::https://github.com/hashicorp/go-getter/helper/url' ./test
2020/06/01 11:11:27 Error downloading: error downloading 'https://github.com/hashicorp/go-getter/helper/url': /usr/bin/git exited with 128: Cloning into './test'...
remote: Not Found
fatal: repository 'https://github.com/hashicorp/go-getter/helper/url/' not found

In my experiments, // and / have same behavior. Is that expected?

@azr
Copy link
Contributor

azr commented Jun 8, 2020

Hey @Shell32-Natsu, thanks for reporting, quick question; are these bugs happening in a stable manner ? Or is this random ? Because if this is randomly happening this could may be due to the fact that the getters are in a map on the v1 versions. #255 will at least make this stable ( and probably fix this ).
Note that #255 is on the v2 branch and not the master one.

@Shell32-Natsu
Copy link
Author

Yes these issues can be reproduced stably.

lentzi90 added a commit to lentzi90/personal-cloud that referenced this issue Jun 20, 2020
lentzi90 added a commit to lentzi90/personal-cloud that referenced this issue Jun 20, 2020
@jgustie
Copy link

jgustie commented Sep 15, 2020

It looks like query parameters are being put on the path which results in a percent encoded ?. In detect_github_test.go the following test case would illustrate the issue (this currently fails with bad: "git::https://github.com/hashicorp/foo.git//bar%3Ffoo=bar"):

		{
			"github.com/hashicorp/foo/bar?foo=bar",
			"git::https://github.com/hashicorp/foo.git//bar?foo=bar",
		},

I am working around the issue using an alternate implementation of the GitHub detector that preserves the query parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants