git commands on GitLab HTTP remote fail with 403

拈花ヽ惹草 提交于 2020-05-27 02:07:53

问题


I have a GitLab 5.0 installation that suddenly, for no apparent reason, started failing git commands on the HTTP URLs. Any command such as git clone/pull/push fails with the following error:

fatal: unable to access 'http://host/user/project.git/': The requested URL returned error: 403

The error happens before any prompt for user/password. This happens for existing and new projects. The SSH URLs continue to work just fine. The GitLab UI on HTTP works fine too.

Any idea what might be wrong or how to troubleshoot it?


回答1:


As is often the case I found what the problem was shortly after posting. The clue was that HTTP worked locally on the hosting machine. Turns out I had HTTP_PROXY variable configured on all Windows boxes I tried (I needed it recently for cabal which doesn't detect proxy automatic setting on Windows). Looks like git was connecting to GitLab endpoint via proxy leading to the error. I went to C:\Users\{User} and removed the line related to Proxy in the file .gitconfig. Leaving the answer in case it helps someone else.



来源:https://stackoverflow.com/questions/28850555/git-commands-on-gitlab-http-remote-fail-with-403

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!