{"thread":{"id":"45075","subject":"git push - 401 unauthorized","startedAt":"2017-02-07T20:56:21Z","lastAt":"2017-03-03T08:16:11Z","messageCount":2,"participants":["Alessio Rocchi","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"311008","messageId":"017901d28183$6fb72c60$4f258520$@gmail.com","threadId":"45075","inReplyTo":null,"subject":"git push - 401 unauthorized","fromName":"Alessio Rocchi","fromEmail":"alexrocchi@gmail.com","sentAt":"2017-02-07T20:47:45Z","receivedAt":"2017-02-07T20:56:21Z","isPatch":false,"sender":{"key":"alexrocchi@gmail.com","avatar":null},"body":"I try to push my commit on a private repository (which has been working\nsince about five years).\nThis is the output of git push:\n\nme@superstar:/var/www/scorte$ git push --verbose\nPushing to http://isisenscorte:mypassword@mymachine/scorte_git\nGetting pack list\nFetching remote heads...\n  refs/\n  refs/tags/\n  refs/heads/\nupdating 'refs/heads/master'\n  from d9fd2e49cb0c32a6d8fddcff2954f04b4104d176\n  to   23d8edfb7fa70bce44c21a7f93064c08a7288e23\n    sending 6 objects\nMOVE 33fcba80fdec82f43f995e5c693255da075358be failed, aborting (52/0)\nMOVE 60e1a097d50fe62319413ed20129580cf175d1ca failed, aborting (52/0)\nMOVE cfea41ef02f9aef5cecfbf7eac5a9e55975113f4 failed, aborting (52/0)\nMOVE 3d87ab6ff7652f2b30e48612b70c8335d4625699 failed, aborting (52/0)\nMOVE 4adb1b39e0446e0bfc3182258ff1cd7077871f7f failed, aborting (52/0)\nUpdating remote server info\nfatal: git-http-push failed\n\nLooking at apache logs, I've got this output\n\n192.168.240.127 - myusername [07/Feb/2017:19:57:01 +0100] \"PROPFIND\n/scorte_git/objects/23/ HTTP/1.1\" 207 6003 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - myusername [07/Feb/2017:19:57:01 +0100] \"PROPFIND\n/scorte_git/objects/60/ HTTP/1.1\" 207 7651 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - myusername [07/Feb/2017:19:57:02 +0100] \"PROPFIND\n/scorte_git/objects/4a/ HTTP/1.1\" 207 3640 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - myusername [07/Feb/2017:19:57:02 +0100] \"PROPFIND\n/scorte_git/objects/3d/ HTTP/1.1\" 207 13742 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - myusername [07/Feb/2017:19:57:02 +0100] \"PROPFIND\n/scorte_git/objects/cf/ HTTP/1.1\" 207 13799 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - myusername [07/Feb/2017:19:57:02 +0100] \"PROPFIND\n/scorte_git/objects/33/ HTTP/1.1\" 207 13783 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - - [07/Feb/2017:19:57:02 +0100] \"PUT\n/scorte_git/objects/3d/87ab6ff7652f2b30e48612b70c8335d4625699_8d42f74642dae7\n7465d1fbfafbd720f67a1919f4 HTTP/1.1\" 401 810 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - - [07/Feb/2017:19:57:02 +0100] \"PUT\n/scorte_git/objects/cf/ea41ef02f9aef5cecfbf7eac5a9e55975113f4_8d42f74642dae7\n7465d1fbfafbd720f67a1919f4 HTTP/1.1\" 401 810 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - myusername [07/Feb/2017:19:57:02 +0100] \"PUT\n/scorte_git/objects/33/fcba80fdec82f43f995e5c693255da075358be_8d42f74642dae7\n7465d1fbfafbd720f67a1919f4 HTTP/1.1\" 201 809 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - - [07/Feb/2017:19:57:02 +0100] \"PUT\n/scorte_git/objects/4a/db1b39e0446e0bfc3182258ff1cd7077871f7f_8d42f74642dae7\n7465d1fbfafbd720f67a1919f4 HTTP/1.1\" 401 810 \"-\" \"git/1.7.0.4\"\n192.168.240.127 - - [07/Feb/2017:19:57:02 +0100] \"PUT\n/scorte_git/objects/60/e1a097d50fe62319413ed20129580cf175d1ca_8d42f74642dae7\n7465d1fbfafbd720f67a1919f4 HTTP/1.1\" 401 810 \"-\" \"git/1.7.0.4\"\n\nIt looks like I'm getting 401 errors on every line where username is\nmissing.\n\nPermissions on the unauthorized object folders are 777 everywhere. My git\nversion is 1.7.0.4 on both client and server. Do you have any clue of this\nstrange behaviour?\n\nThank you in advance, Alex\n\n"},{"id":"313141","messageId":"20170303080738.ez3ztmev2vhlnjfu@sigill.intra.peff.net","threadId":"45075","inReplyTo":"017901d28183$6fb72c60$4f258520$@gmail.com","subject":"Re: git push - 401 unauthorized","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-03-03T08:07:38Z","receivedAt":"2017-03-03T08:16:11Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 07, 2017 at 09:47:45PM +0100, Alessio Rocchi wrote:\n\n> I try to push my commit on a private repository (which has been working\n> since about five years).\n\nIt wasn't clear to me from your email, but did this work with a\nprevious version of Git and is now broken?\n\n> me@superstar:/var/www/scorte$ git push --verbose\n> Pushing to http://isisenscorte:mypassword@mymachine/scorte_git\n> Getting pack list\n> Fetching remote heads...\n>   refs/\n>   refs/tags/\n>   refs/heads/\n> updating 'refs/heads/master'\n>   from d9fd2e49cb0c32a6d8fddcff2954f04b4104d176\n>   to   23d8edfb7fa70bce44c21a7f93064c08a7288e23\n>     sending 6 objects\n> MOVE 33fcba80fdec82f43f995e5c693255da075358be failed, aborting (52/0)\n> MOVE 60e1a097d50fe62319413ed20129580cf175d1ca failed, aborting (52/0)\n> MOVE cfea41ef02f9aef5cecfbf7eac5a9e55975113f4 failed, aborting (52/0)\n> MOVE 3d87ab6ff7652f2b30e48612b70c8335d4625699 failed, aborting (52/0)\n> MOVE 4adb1b39e0446e0bfc3182258ff1cd7077871f7f failed, aborting (52/0)\n> Updating remote server info\n> fatal: git-http-push failed\n\nOK, that looks like the old dumb-http protocol. And you said here:\n\n> Permissions on the unauthorized object folders are 777 everywhere. My git\n> version is 1.7.0.4 on both client and server. Do you have any clue of this\n> strange behaviour?\n\n...that you're using v1.7.0.4. There were tons of auth-related corner\ncases that have been fixed since then. Can you try a more recent version\nof Git on the client side (preferably v2.12.0)?\n\nThe version on the server shouldn't matter; the 401 is generated by\nApache, and as you are using the dumb-http protocol, git is not involved\non the server side of the request at all.\n\nI'd also suggest that you move to the smart-http protocol on the server\nif possible. It's much more efficient, and the dumb-http code paths are\nnot nearly as well tested, especially around things like authentication.\nRunning \"git help http-backend\" gives some sample Apache config.\n\n-Peff\n"}]}