Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 401 when pushing to Git (GitLab)

Tags:

git

gitlab

I am getting the error

Total 4 (delta 2), reused 0 (delta 0)
error: RPC failed; result=22, HTTP code = 401

When pushing to a git repository on GitLab.

It used to work.

like image 592
Alex Avatar asked Jun 18 '13 12:06

Alex


2 Answers

I had the same issue: public repos don't force git to authenticate on the first request, and git doesn't offer authentication (at least as of version 1.7.9) on subsequent requests of the same push.

This pull request for GitLab should fix it; tested on GitLab 6.3 but it may apply fine on older versions too (please let me know if it fails along with the version string).

https://github.com/gitlabhq/gitlabhq/pull/5760

like image 71
Thomas Guyot-Sionnest Avatar answered Sep 20 '22 05:09

Thomas Guyot-Sionnest


After some debugging I realized that I recently activated "Public clone access" on the project. The remote URL is an http:// URL.

Error 401 simply means "access denied" - so even the account is stored in my system, git tries to push without account information which causes this error.

like image 44
Alex Avatar answered Sep 20 '22 05:09

Alex