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 get" breaks with git/http between 0.9.x and 0.10.x (URL changes?) #4226
Comments
Sometimes user could simply request wrong URL, but if that wrong URL has nothing related Git HTTP operations, HTTP Basic Authentication should not prompted. Instead, clean 404 page should be presented. The patch also supports Git HTTP operations without '.git' suffix to the repository name, which addresses #4226 and #4189.
Patch has pushed to fix this issue, please test on |
I built from source on the
Is my gogs setup misconfigured or is this bug still open? |
This is what I get:
Which downloads package correctly. |
Thanks. I have now fixed my config error and can confirm you fix works. Long story short, my repo is setup as a local mirror and I incorrectly set the server.DOMAIN in app.ini. |
[x]
):log/gogs.log
):Drone test build with gogs 0.9.141
[Macaron] 2017-03-02 14:52:56: Started GET /api/v1/repos/Ian/test/raw/v0.6/drone.yml for 192.168.2.134
[Macaron] 2017-03-02 14:52:56: Completed /api/v1/repos/Ian/test/raw/v0.6/drone.yml 200 OK in 59.789438ms
[Macaron] 2017-03-02 14:52:56: Started GET /api/v1/repos/Ian/test/raw/v0.6/drone.yml.sig for 192.168.2.134
[Macaron] 2017-03-02 14:52:56: Completed /api/v1/repos/Ian/test/raw/v0.6/drone.yml.sig 404 Not Found in 68.977499ms
[Macaron] 2017-03-02 14:52:58: Started GET /Ian/test.git/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:52:58: Completed /Ian/test.git/info/refs?service=git-upload-pack 401 Unauthorized in 5.056218ms
[Macaron] 2017-03-02 14:52:58: Started GET /Ian/test.git/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:52:59: Completed /Ian/test.git/info/refs?service=git-upload-pack 200 OK in 207.832553ms
[Macaron] 2017-03-02 14:52:59: Started POST /Ian/test.git/git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:52:59: Completed /Ian/test.git/git-upload-pack 200 OK in 216.990109ms
[Macaron] 2017-03-02 14:52:59: Started GET /devel/lflag/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:52:59: Completed /devel/lflag/info/refs?service=git-upload-pack 401 Unauthorized in 4.995317ms
[Macaron] 2017-03-02 14:52:59: Started GET /devel/lflag/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:52:59: Completed /devel/lflag/info/refs?service=git-upload-pack 200 OK in 173.165033ms
[Macaron] 2017-03-02 14:52:59: Started GET /devel/lflag/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:52:59: Completed /devel/lflag/info/refs?service=git-upload-pack 401 Unauthorized in 3.947597ms
[Macaron] 2017-03-02 14:52:59: Started GET /devel/lflag/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:53:00: Completed /devel/lflag/info/refs?service=git-upload-pack 200 OK in 197.229813ms
[Macaron] 2017-03-02 14:53:00: Started POST /devel/lflag/git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 14:53:00: Completed /devel/lflag/git-upload-pack 200 OK in 161.1855ms
Same test build with gogs 0.10.1
[Macaron] 2017-03-02 10:22:52: Started GET /api/v1/repos/Ian/test/raw/v0.6/drone.yml for 192.168.2.134
[Macaron] 2017-03-02 10:22:52: Completed GET /api/v1/repos/Ian/test/raw/v0.6/drone.yml 200 OK in 82.855318ms
[Macaron] 2017-03-02 10:22:52: Started GET /api/v1/repos/Ian/test/raw/v0.6/drone.yml.sig for 192.168.2.134
[Macaron] 2017-03-02 10:22:52: Completed GET /api/v1/repos/Ian/test/raw/v0.6/drone.yml.sig 404 Not Found in 71.046125ms
[Macaron] 2017-03-02 10:22:54: Started GET /Ian/test.git/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 10:22:54: Completed GET /Ian/test.git/info/refs?service=git-upload-pack 401 Unauthorized in 5.017977ms
[Macaron] 2017-03-02 10:22:54: Started GET /Ian/test.git/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 10:22:54: Completed GET /Ian/test.git/info/refs?service=git-upload-pack 200 OK in 193.957579ms
[Macaron] 2017-03-02 10:22:54: Started POST /Ian/test.git/git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 10:22:54: Completed POST /Ian/test.git/git-upload-pack 200 OK in 158.866432ms
[Macaron] 2017-03-02 10:22:55: Started GET /devel/lflag/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 10:22:55: Completed GET /devel/lflag/info/refs?service=git-upload-pack 404 Not Found in 7.975791ms
[Macaron] 2017-03-02 10:23:12: Started GET /devel/lflag/info/refs?service=git-upload-pack for 192.168.2.134
[Macaron] 2017-03-02 10:23:12: Completed GET /devel/lflag/info/refs?service=git-upload-pack 404 Not Found in 5.075256ms
Description
Hello,
I recently upgraded the gogs version I use at work from 0.9.97 to 0.10.1 and the upgrade appeared to go smoothly albeit for two things (the second one I think needs to be its own issue I'll make after this).
Our gogs setup is configured with webhooks that trigger drone (0.5) builds. After upgrading gogs versions it seems
go get
from inside the docker containers has stopped working and I'm having a hard time figuring out why. Reverting gogs to 0.9.97 and up to 0.9.141 fixes the problem.Drone has a clone step that clones the repo that triggered the build before the rest of the build takes place, and currently this step works on 0.10.1 (so git is cloning/authing correctly with gogs) however the next step in the build is to run
go get
on the repo to pull the other Go deps (most of which are other gogs repos) and it is here where it fails. We use HTTP and SSH (not HTTPS) with gogs but the drone server simply pulls the http url (uses -insecure flag with go get) and uses a .netrc file with a users credentials in order to clone the repo (gogs is set to have registration closed which means you cannot clone without being a user)In the log snippets above the 401 Unauthorized I believe come from the fact that git tries pulling the url first without the netrc and when it fails adds the auth info from netrc and tries again (why afterwards it succeeds with 200). I think the key URL is this one
/devel/lflag/info/refs?service=git-upload-pack
(where lflag is a Go dep of the test repo I setup). For versions 0.9.141 and below that URL exists and succeeds, but for 0.10.1 it returns 404.Idk 100% if thats the issue, and I did look for similar issues here and through the release notes of the versions between 0.9.97 and 0.10.1 and didn't see why this would change. Below is a small snippet of the output from the build on drone
go get -v -d -insecure cd .; git ls-remote git://192.168.2.14:3000/devel/lflag fatal: repository 'http://192.168.2.14:3000/devel/lflag/' not found
The http url above does exist and works for older versions of gogs. I can reproduce this outside of drone by simply running the commands
go get
is. Let me know if there is more information needed, thank you....
The text was updated successfully, but these errors were encountered: