# Git clone no working after upgrade

**URL:** <https://forum.ansible.com/t/git-clone-no-working-after-upgrade/15212>\
**Category:** Ansible Project\
**Created:** [May 12, 2014, 6:11pm UTC](https://forum.ansible.com/t/git-clone-no-working-after-upgrade/15212 "2014-05-12T18:11:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Goodhouse](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@James\_Goodhouse](https://forum.ansible.com/u/James_Goodhouse)\
**Post date:** [May 12, 2014, 6:11pm UTC](https://forum.ansible.com/t/git-clone-no-working-after-upgrade/15212/1 "2014-05-12T18:11:39Z")

</div>

Hey All,

I just upgraded from 1.5.5 to 1.6.1 and am seeing the following error happen when trying to clone a repo:

failed: [[w4.website.net](http://w4.website.net)] =\> {“failed”: true, “item”: “”, “parsed”: false}  
invalid output was: Traceback (most recent call last):  
File “”, line 1911, in   
File “”, line 503, in main  
File “”, line 184, in write\_ssh\_wrapper  
File “/usr/lib/python2.7/tempfile.py”, line 300, in mkstemp  
return \_mkstemp\_inner(dir, prefix, suffix, flags)  
File “/usr/lib/python2.7/tempfile.py”, line 235, in \_mkstemp\_inner  
fd = \_os.open(file, flags, 0600)  
OSError: [Errno 13] Permission denied: ‘/home/my\_ansible\_user/OKKarN’

My Ansible task for is as follows:

- name: copy code from repository  
sudo\_user: my\_git\_user  
git: repo={{ git[‘repo\_url’] }}  
dest={{ install\_dir }}  
key\_file=“/home/my\_git\_user/.ssh/deploy.key”  
version={{ git[‘branch’] }}  
depth=1  
accept\_hostkey=yes  
register: clone\_result  
notify: restart php5-fpm

I see no reason why I’m now getting a permission denied error when I didn’t before.

Any ideas?

Thanks!

James

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 13, 2014, 3:34pm UTC](https://forum.ansible.com/t/git-clone-no-working-after-upgrade/15212/2 "2014-05-13T15:34:25Z")

</div>

I’m not sure why you are getting this either.

If you can come up with a way to replicate this on a clean system, can you please run this in “-vvvv” mode and file this as a bug ticket with steps to reproduce?

Either way, a traceback in Ansbile is always a bug, so I’d like a bug ticket even if the system was in a state where it didn’t have legitimate permissions.

We just need more info about how how to reproduce this.

---

<div class="post-metadata">

**Author:** ![James\_Goodhouse](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@James\_Goodhouse](https://forum.ansible.com/u/James_Goodhouse)\
**Post date:** [May 13, 2014, 3:59pm UTC](https://forum.ansible.com/t/git-clone-no-working-after-upgrade/15212/3 "2014-05-13T15:59:11Z")

</div>

The best I could do was fire up a clean Vagrant instance and run through things from the start. The result was the same.

Here is the output from the task that failed with “-vvvv” set:

TASK: [deploy | copy code from repository] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<33.33.33.71\> ESTABLISH CONNECTION FOR USER: vagrant  
\<33.33.33.71\> REMOTE\_MODULE git [repo=git@github.com](mailto:repo=git@github.com):company/project.git dest=/srv/project key\_file=“/home/deploy\_user/.ssh/deploy.key” version=master depth=1 accept\_hostkey=yes  
\<33.33.33.71\> EXEC [‘ssh’, ‘-C’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/Users/james/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘IdentityFile=/Users/james/.vagrant.d/insecure\_private\_key’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘User=vagrant’, ‘-o’, ‘ConnectTimeout=10’, ‘33.33.33.71’, u’/bin/sh -c 'sudo -k && sudo -H -S -p “[sudo via ansible, key=bjabkvmkprzchfetqhbbnzyubjbrjjoq] password: " -u deploy\_user /bin/sh -c '”'“'echo SUDO-SUCCESS-bjabkvmkprzchfetqhbbnzyubjbrjjoq; LC\_CTYPE=en\_US.UTF-8 LANG=en\_US.UTF-8 /usr/bin/python'”'"''']  
failed: [prod.project.dev] =\> {“failed”: true, “item”: “”, “parsed”: false}  
invalid output was: Traceback (most recent call last):  
File “”, line 1911, in   
File “”, line 503, in main  
File “”, line 184, in write\_ssh\_wrapper  
File “/usr/lib/python2.7/tempfile.py”, line 300, in mkstemp  
return \_mkstemp\_inner(dir, prefix, suffix, flags)  
File “/usr/lib/python2.7/tempfile.py”, line 235, in \_mkstemp\_inner  
fd = \_os.open(file, flags, 0600)  
OSError: [Errno 13] Permission denied: ‘/home/vagrant/ysynAz’  
debug3: mux\_client\_read\_packet: read header failed: Broken pipe  
debug2: Received exit status from master 1

FATAL: all hosts have already failed – aborting

I will file an official bug ticket shortly. Thanks!

James

---

<div class="post-metadata">

**Author:** ![James\_Goodhouse](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@James\_Goodhouse](https://forum.ansible.com/u/James_Goodhouse)\
**Post date:** [May 13, 2014, 4:11pm UTC](https://forum.ansible.com/t/git-clone-no-working-after-upgrade/15212/4 "2014-05-13T16:11:38Z")

</div>

Here’s a link to the bug I filed.

[https://github.com/ansible/ansible/issues/7383](https://github.com/ansible/ansible/issues/7383)

---

<div class="post-metadata">

**Author:** ![adam2](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@adam2](https://forum.ansible.com/u/adam2)\
**Post date:** [May 13, 2014, 4:52pm UTC](https://forum.ansible.com/t/git-clone-no-working-after-upgrade/15212/5 "2014-05-13T16:52:52Z")

</div>

The sudo\_user is my\_git\_user, but I'm guessing the connection user is my\_ansible\_user. When ansible calls sudo, the temp dir value is passed on unchanged. So, it then tried to create a temp file in the wrong location.

I seem to recall reading in the documentation that direct user-\>user sudo was problematic, due to permission issues with the incoming script+payload; it would end up making the file word readable temporarily. This could be a similar problem.
