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?
There are a few possible causes for this problem: You typed an incorrect password. Make sure you are using the correct GitHub password for the account. The Git client on the A2 Hosting server requires a modified HTTPS URL to work correctly.
The first is relatively simple to resolve and simply involves checking to ensure your GitHub password is correct. If the error persists, it is likely that you have to use a different HTTPS address in your Git client. For this error, you will not even be prompted to enter a password, making it simpler to diagnose.
To get started, you'll need to install and configure Git on your system and create an account on GitLab and install GitBash for windows. Note: Before pushing the code into Gitlab, you need to make sure that all the files must be placed into one folder.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With