[Puppet Users] Re: Debugging execution error with vcsrepo

2014-05-30 Thread Bas van Meurs
I've just encountered and fixed the exact same error message.

The repo (and the .git directory in it) contained files not owned by the 
user specfied in the vcsrepo command. Ensure the ownership of the directory 
before vcsrepo-ing it:

  file { /home/myuser/myrepo:
ensure  = directory,
recurse = true,
owner = 'myrepo',
mode = 0774,
  }

  vcsrepo { /home/myuser/myrepo:
require  = [Class[sshd], File['/home/myuser/myrepo']],
ensure   = present,
provider = git,
source   = 'g...@git.myhostname.com:repos/myrepo.git',
revision = 'master',
user = 'myuser'
  }


Op maandag 23 december 2013 21:12:40 UTC+1 schreef Patrick Gibson:

 If I manually clone the repo, I get a similarly puzzling error:

 Error: /Stage[main]/myuser/Vcsrepo[/home/myuser/myrepo]: Could not 
 evaluate: Execution of '/usr/bin/su myuser -c /usr/local/bin/git config 
 remote.origin.url' returned 127: -su: /usr/local/bin/git config 
 remote.origin.url: No such file or directory



 On Saturday, 21 December 2013 18:33:45 UTC-8, Patrick Gibson wrote:

 I'm using the vcsrepo module to clone a git repo as a particular user, 
 and I'm getting a puzzling error:

 Debug: Executing '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo'
 Error: Execution of '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo' returned 127: 
 su: /usr/local/bin/git clone g...@git.myhostname.com:repos/myrepo.git 
 /home/myuser/myrepo: No such file or directory

 When I copy and paste the exact command and run it, it works fine. I 
 can't figure out what would be complaining about No such file or 
 directory. Every executable and path mentioned in the command exists. 

 My relevant classes look like this:

 class sshd {
   file { /etc/ssh/sshd_config:
 source = puppet:///modules/sshd/sshd_config,
 notify = Service[sshd]
   }

   file { /etc/ssh/ssh_config:
 source = puppet:///modules/sshd/ssh_config,
 notify = Service[sshd]
   }

   service { sshd:
 ensure = running,
   }
 }

 class myuser {
   file { /home/myuser/.ssh:
 ensure = directory,
 mode   = 0700,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/known_hosts:
 source = puppet:///modules/myuser/.ssh/known_hosts,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/id_rsa:
 source = puppet:///modules/myuser/.ssh/id_rsa,
 mode   = 0600,
 owner  = myuser,
 group  = myuser,
   }

   vcsrepo { /home/myuser/myrepo:
 require  = Class[sshd],
 ensure   = present,
 provider = git,
 source   = 'g...@git.myhostname.com:repos/myrepo.git',
 revision = 'master',
 user = 'myuser'
   }
 }

 Any pointers?



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d84f8bdb-587e-45f0-9647-648243c0d70e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Debugging execution error with vcsrepo

2014-01-02 Thread jcbollinger


On Wednesday, December 25, 2013 9:47:39 AM UTC-6, Felix.Frank wrote:

 Hi, 

 for what it's worth - the error seems to indicate that su considers 
 /usr/local/bin/git config remote.origin.url to be the name of an 
 executable file that contains a space. 



I agree that it looks like the whole command argument is being interpreted 
as a file name, but unless the su in question is very different from GNU 
su, that mistake is probably being committed by whatever shell su starts, 
not by su itself.  It is the shell's job to parse the command.  That 
distinction could be very important to tracing down the error.

According to its docs, GNU su uses the shell specified in the target user's 
passwd entry, falling back to /bin/sh if none is specified.  If the target 
user in this case has some weird shell configured, then perhaps it parses 
commands unfavorably.  On the other hand, if the user's shell is anything 
from the Bourne family (e.g. bash or zsh) then I would be inclined to guess 
that there is a problem related to the IFS environment variable.  On the 
third hand, [t]csh always splits words at blanks and tabs, so the problem I 
hypothesize should not occur if that's the configured shell.

I cannot speak directly to the environment Puppet provides to the su 
command, but in general Puppet provides a minimal environment to commands 
it spawns.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/78e749a4-bffc-48b5-9885-10cd344f22f7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Debugging execution error with vcsrepo

2013-12-25 Thread Felix Frank
Hi,

for what it's worth - the error seems to indicate that su considers
/usr/local/bin/git config remote.origin.url to be the name of an
executable file that contains a space.

I cannot fathom why this is inflicting you now, though.

On 12/23/2013 09:12 PM, Patrick Gibson wrote:
 Error: /Stage[main]/myuser/Vcsrepo[/home/myuser/myrepo]: Could not
 evaluate: Execution of '/usr/bin/su myuser -c /usr/local/bin/git config
 remote.origin.url' returned 127: -su: /usr/local/bin/git config
 remote.origin.url: No such file or directory

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52BAFE1B.6000802%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Debugging execution error with vcsrepo

2013-12-24 Thread Patrick Gibson
Does anyone have any advice on simulating the environment and conditions 
under which processes are run by Puppet? I'd really like to get the bottom 
of this, as other commands I'm running via other classes are working fine.

Thanks,

Patrick


On Monday, 23 December 2013 12:12:40 UTC-8, Patrick Gibson wrote:

 If I manually clone the repo, I get a similarly puzzling error:

 Error: /Stage[main]/myuser/Vcsrepo[/home/myuser/myrepo]: Could not 
 evaluate: Execution of '/usr/bin/su myuser -c /usr/local/bin/git config 
 remote.origin.url' returned 127: -su: /usr/local/bin/git config 
 remote.origin.url: No such file or directory



 On Saturday, 21 December 2013 18:33:45 UTC-8, Patrick Gibson wrote:

 I'm using the vcsrepo module to clone a git repo as a particular user, 
 and I'm getting a puzzling error:

 Debug: Executing '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo'
 Error: Execution of '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo' returned 127: 
 su: /usr/local/bin/git clone g...@git.myhostname.com:repos/myrepo.git 
 /home/myuser/myrepo: No such file or directory

 When I copy and paste the exact command and run it, it works fine. I 
 can't figure out what would be complaining about No such file or 
 directory. Every executable and path mentioned in the command exists. 

 My relevant classes look like this:

 class sshd {
   file { /etc/ssh/sshd_config:
 source = puppet:///modules/sshd/sshd_config,
 notify = Service[sshd]
   }

   file { /etc/ssh/ssh_config:
 source = puppet:///modules/sshd/ssh_config,
 notify = Service[sshd]
   }

   service { sshd:
 ensure = running,
   }
 }

 class myuser {
   file { /home/myuser/.ssh:
 ensure = directory,
 mode   = 0700,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/known_hosts:
 source = puppet:///modules/myuser/.ssh/known_hosts,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/id_rsa:
 source = puppet:///modules/myuser/.ssh/id_rsa,
 mode   = 0600,
 owner  = myuser,
 group  = myuser,
   }

   vcsrepo { /home/myuser/myrepo:
 require  = Class[sshd],
 ensure   = present,
 provider = git,
 source   = 'g...@git.myhostname.com:repos/myrepo.git',
 revision = 'master',
 user = 'myuser'
   }
 }

 Any pointers?



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8bb3247d-b2e1-4e98-aa39-8a11c49c2760%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Debugging execution error with vcsrepo

2013-12-23 Thread Patrick Gibson
If I manually clone the repo, I get a similarly puzzling error:

Error: /Stage[main]/myuser/Vcsrepo[/home/myuser/myrepo]: Could not 
evaluate: Execution of '/usr/bin/su myuser -c /usr/local/bin/git config 
remote.origin.url' returned 127: -su: /usr/local/bin/git config 
remote.origin.url: No such file or directory



On Saturday, 21 December 2013 18:33:45 UTC-8, Patrick Gibson wrote:

 I'm using the vcsrepo module to clone a git repo as a particular user, and 
 I'm getting a puzzling error:

 Debug: Executing '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo'
 Error: Execution of '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo' returned 127: 
 su: /usr/local/bin/git clone g...@git.myhostname.com:repos/myrepo.git 
 /home/myuser/myrepo: No such file or directory

 When I copy and paste the exact command and run it, it works fine. I can't 
 figure out what would be complaining about No such file or directory. 
 Every executable and path mentioned in the command exists. 

 My relevant classes look like this:

 class sshd {
   file { /etc/ssh/sshd_config:
 source = puppet:///modules/sshd/sshd_config,
 notify = Service[sshd]
   }

   file { /etc/ssh/ssh_config:
 source = puppet:///modules/sshd/ssh_config,
 notify = Service[sshd]
   }

   service { sshd:
 ensure = running,
   }
 }

 class myuser {
   file { /home/myuser/.ssh:
 ensure = directory,
 mode   = 0700,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/known_hosts:
 source = puppet:///modules/myuser/.ssh/known_hosts,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/id_rsa:
 source = puppet:///modules/myuser/.ssh/id_rsa,
 mode   = 0600,
 owner  = myuser,
 group  = myuser,
   }

   vcsrepo { /home/myuser/myrepo:
 require  = Class[sshd],
 ensure   = present,
 provider = git,
 source   = 'g...@git.myhostname.com:repos/myrepo.git',
 revision = 'master',
 user = 'myuser'
   }
 }

 Any pointers?


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d0efd577-e9f7-432d-bef4-cb388bc526a0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Debugging execution error with vcsrepo

2013-12-21 Thread Patrick Gibson
(I should mention this is on FreeBSD 9.2.)

On Saturday, 21 December 2013 18:33:45 UTC-8, Patrick Gibson wrote:

 I'm using the vcsrepo module to clone a git repo as a particular user, and 
 I'm getting a puzzling error:

 Debug: Executing '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo'
 Error: Execution of '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo' returned 127: 
 su: /usr/local/bin/git clone g...@git.myhostname.com:repos/myrepo.git 
 /home/myuser/myrepo: No such file or directory

 When I copy and paste the exact command and run it, it works fine. I can't 
 figure out what would be complaining about No such file or directory. 
 Every executable and path mentioned in the command exists. 

 My relevant classes look like this:

 class sshd {
   file { /etc/ssh/sshd_config:
 source = puppet:///modules/sshd/sshd_config,
 notify = Service[sshd]
   }

   file { /etc/ssh/ssh_config:
 source = puppet:///modules/sshd/ssh_config,
 notify = Service[sshd]
   }

   service { sshd:
 ensure = running,
   }
 }

 class myuser {
   file { /home/myuser/.ssh:
 ensure = directory,
 mode   = 0700,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/known_hosts:
 source = puppet:///modules/myuser/.ssh/known_hosts,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/id_rsa:
 source = puppet:///modules/myuser/.ssh/id_rsa,
 mode   = 0600,
 owner  = myuser,
 group  = myuser,
   }

   vcsrepo { /home/myuser/myrepo:
 require  = Class[sshd],
 ensure   = present,
 provider = git,
 source   = 'g...@git.myhostname.com:repos/myrepo.git',
 revision = 'master',
 user = 'myuser'
   }
 }

 Any pointers?


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bfccfbf4-ddfd-435a-98da-e54e43272537%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.