{"thread":{"id":"30665","subject":"bug? Python traceback on git push","startedAt":"2012-05-30T22:11:38Z","lastAt":"2012-05-31T01:08:20Z","messageCount":2,"participants":["Pedro Werneck","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"192520","messageId":"CA+u+8CLcUtTCkWN2bZvR8JNmgnCoX+TwRK3_e64zWaV__jOo7A@mail.gmail.com","threadId":"30665","inReplyTo":null,"subject":"bug? Python traceback on git push","fromName":"Pedro Werneck","fromEmail":"pjwerneck@gmail.com","sentAt":"2012-05-30T22:11:38Z","receivedAt":"2012-05-30T22:11:38Z","isPatch":false,"sender":{"key":"pjwerneck@gmail.com","avatar":null},"body":"git 1.7.9.5\n\nI was pushing to a repository\n\npush actually seems to have worked, but popped this weird python traceback\n\n\n(tcf-env)werneck@werneck:~/devel/tcf-api/src/tcf$ git push\nWarning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to\nthe list of known hosts.\nCounting objects: 15, done.\nDelta compression using up to 4 threads.\nCompressing objects: 100% (8/8), done.\nWriting objects: 100% (8/8), 860 bytes, done.\nTotal 8 (delta 7), reused 0 (delta 0)\nremote: Traceback (most recent call last):\nremote:   File \"/opt/python/domains/bitbucket.org/current/bitbucket/scripts/git/hooks/pre-receive\",\nline 9, in <module>\nremote:     from bitbucket.apps.repo2.hooks import prehooks\nremote:   File \"/data/vol1/www/venvs/deployed/bitbucket/apps/repo2/hooks.py\",\nline 4, in <module>\nremote:     from orochi.hooks import failonerror, HookError, HookManager\nremote:   File \"/opt/python/domains/bitbucket.org/current/bitbucket/local/env/lib/python2.7/site-packages/orochi/hooks.py\",\nline 9, in <module>\nremote:     from orochi.git import githook\nremote:   File \"/opt/python/domains/bitbucket.org/current/bitbucket/local/env/lib/python2.7/site-packages/orochi/git.py\",\nline 23, in <module>\nremote:     from orochi.lock import lock\nremote:   File \"/opt/python/domains/bitbucket.org/current/bitbucket/local/env/lib/python2.7/site-packages/orochi/lock.py\",\nline 9, in <module>\nremote:     from mercurial.lock import lock as mlock\nremote: ImportError: No module named mercurial.lock\nTo git@bitbucket.org:titansgroup/tcf-api.git\n ! [remote rejected] master -> master (pre-receive hook declined)\nerror: failed to push some refs to 'git@bitbucket.org:titansgroup/tcf-api.git'\n\n(tcf-env)werneck@werneck:~/devel/tcf-api/src/tcf$ git pull\nWarning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to\nthe list of known hosts.\nAlready up-to-date.\n\n(tcf-env)werneck@werneck:~/devel/tcf-api/src/tcf$ git push\nWarning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to\nthe list of known hosts.\nCounting objects: 15, done.\nDelta compression using up to 4 threads.\nCompressing objects: 100% (8/8), done.\nWriting objects: 100% (8/8), 860 bytes, done.\nTotal 8 (delta 7), reused 0 (delta 0)\nremote: bb/acl: pjwerneck is allowed. accepted payload.\nTo git@bitbucket.org:titansgroup/tcf-api.git\n   16b3b54..a50f671  master -> master\n\n\n-- \n---\nPedro Werneck\n"},{"id":"192529","messageId":"20120531010820.GB5488@sigill.intra.peff.net","threadId":"30665","inReplyTo":"CA+u+8CLcUtTCkWN2bZvR8JNmgnCoX+TwRK3_e64zWaV__jOo7A@mail.gmail.com","subject":"Re: bug? Python traceback on git push","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-05-31T01:08:20Z","receivedAt":"2012-05-31T01:08:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 30, 2012 at 07:11:38PM -0300, Pedro Werneck wrote:\n\n> git 1.7.9.5\n> \n> I was pushing to a repository\n> \n> push actually seems to have worked, but popped this weird python traceback\n\nNot a bug in git. There is no python code at all in the push code path\n(the only python in git these days is in the experimental svn\nremote-helper). However, the remote side may have a hook that is written\nin python...\n\n> remote: Traceback (most recent call last):\n> remote:   File \"/opt/python/domains/bitbucket.org/current/bitbucket/scripts/git/hooks/pre-receive\",\n> line 9, in <module>\n> remote:     from bitbucket.apps.repo2.hooks import prehooks\n> [...]\n> remote: ImportError: No module named mercurial.lock\n> To git@bitbucket.org:titansgroup/tcf-api.git\n>  ! [remote rejected] master -> master (pre-receive hook declined)\n> error: failed to push some refs to 'git@bitbucket.org:titansgroup/tcf-api.git'\n\n...and that is exactly what happened. Bitbucket's custom python hook\nfailed, and git did not allow the push to go through.\n\n> (tcf-env)werneck@werneck:~/devel/tcf-api/src/tcf$ git pull\n> Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to\n> the list of known hosts.\n> Already up-to-date.\n\nI don't know that this shows anything conclusive; depending on your\nconfiguration, you may or may not be pulling from the same ref you were\ntrying to push to a moment ago.\n\n> (tcf-env)werneck@werneck:~/devel/tcf-api/src/tcf$ git push\n> Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to\n> the list of known hosts.\n> Counting objects: 15, done.\n> Delta compression using up to 4 threads.\n> Compressing objects: 100% (8/8), done.\n> Writing objects: 100% (8/8), 860 bytes, done.\n> Total 8 (delta 7), reused 0 (delta 0)\n> remote: bb/acl: pjwerneck is allowed. accepted payload.\n> To git@bitbucket.org:titansgroup/tcf-api.git\n>    16b3b54..a50f671  master -> master\n\nAnd here you repeat the push, and you see that we had to send the data\nagain (because the push did not go through last time). No clue why their\nhook failed the first time but not the second.\n\nSo as far as I can tell, git is operating as advertised. You might want\nto file a report with bitbucket about their hook failing.\n\n-Peff\n"}]}