gorillamania
2008-Jun-15 18:08 UTC
[Puppet Users] all exec''s return exit code 1 insead of 0
Hello, All of my "exec" calls fail. It''s probably PEBCACK, but I''ve searched and searched and I''m stuck. I created the following simple test script to illustrate: class test_exec { file { "testme": path => "/tmp/testfile", source => "puppet://$puppet_server/files/etc/rc.d/rc.firewall", ensure => present } # Can''t any exec''s to work via puppet. Even "/bin/true" returns exit code 1 exec { "/bin/true": subscribe => File["testme"], refreshonly => true } } And here is the error I get from /var/log/messages: Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/ File[testme]/ensure) created Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/Exec[/ bin/true]) Triggering ''refresh'' from 1 dependencies Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/Exec[/ bin/true]) Failed to call refresh on Exec[/bin/true]: /bin/true returned 1 instead of 0 at /etc/puppet/manifests/includes/test_exec.pp: 14 Jun 15 10:52:35 xxxxxx puppetd[32360]: (//Node[xxxxxx]/dbslave/ dbserver/baseclass/tidy/File[/home/tempfiles/3hours]/ensure) created I used /bin/true to make sure it wasn''t an issue with environment variables. I know that /bin/true returns an exit code of 0. ;-) # /bin/true # echo $? 0 This happens with every command that I ''exec''. The commands in question all work fine from command line. Furthermore, it appears that it isn''t executing the command at all. When I execute "/bin/touch /tmp/ testme", the file is not created. Any ideas? Any tips on how to debug? Thanks, -Nick PS. Version info: # puppet --version 0.24.4 # ruby --version ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux] # facter --version 1.3.8 # uname -a Linux gummibear.xxxxx.com 2.6.18-53.1.4.el5 #1 SMP Fri Nov 30 00:45:16 EST 2007 i686 i686 i386 GNU/Linux --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Nick Sullivan
2008-Jun-15 20:48 UTC
[Puppet Users] Re: all exec''s return exit code 1 insead of 0
A little more info, when I run puppetd with --no-daemonize, I see "wrong number of arguments" right before the exec: wrong number of arguments (2 for 1) err: //.....]/returns: change from notrun to 0 failed: cat /etc/..._svn_release > /tmp/svnupdated returned 1 instead of 0 at /etc/puppet/manifests/includes/..._svn.pp:22 Does anyone know what this is? On Sun, Jun 15, 2008 at 11:08 AM, gorillamania <gorillamania@gmail.com> wrote:> > Hello, > > All of my "exec" calls fail. It''s probably PEBCACK, but I''ve searched > and searched and I''m stuck. I created the following simple test script > to illustrate: > > class test_exec { > > file { "testme": > path => "/tmp/testfile", > source => "puppet://$puppet_server/files/etc/rc.d/rc.firewall", > ensure => present > } > > # Can''t any exec''s to work via puppet. Even "/bin/true" returns > exit code 1 > exec { "/bin/true": > subscribe => File["testme"], > refreshonly => true > } > > } > > > And here is the error I get from /var/log/messages: > > Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/ > File[testme]/ensure) created > Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/Exec[/ > bin/true]) Triggering ''refresh'' from 1 dependencies > Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/Exec[/ > bin/true]) Failed to call refresh on Exec[/bin/true]: /bin/true > returned 1 instead of 0 at /etc/puppet/manifests/includes/test_exec.pp: > 14 > Jun 15 10:52:35 xxxxxx puppetd[32360]: (//Node[xxxxxx]/dbslave/ > dbserver/baseclass/tidy/File[/home/tempfiles/3hours]/ensure) created > > I used /bin/true to make sure it wasn''t an issue with environment > variables. I know that /bin/true returns an exit code of 0. ;-) > > # /bin/true > # echo $? > 0 > > This happens with every command that I ''exec''. The commands in > question all work fine from command line. Furthermore, it appears that > it isn''t executing the command at all. When I execute "/bin/touch /tmp/ > testme", the file is not created. > > Any ideas? Any tips on how to debug? > > Thanks, > > -Nick > > PS. Version info: > # puppet --version > 0.24.4 > # ruby --version > ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux] > # facter --version > 1.3.8 > # uname -a > Linux gummibear.xxxxx.com 2.6.18-53.1.4.el5 #1 SMP Fri Nov 30 00:45:16 > EST 2007 i686 i686 i386 GNU/Linux > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Nick Sullivan
2008-Jun-15 21:01 UTC
[Puppet Users] Re: all exec''s return exit code 1 insead of 0
RESOLVED: Apparently version 1.8.6 and greater versions of ruby cause this problem. I downgraded to 1.8.5 and it works now. -Nick On Sun, Jun 15, 2008 at 1:48 PM, Nick Sullivan <gorillamania@gmail.com> wrote:> A little more info, when I run puppetd with --no-daemonize, I see "wrong > number of arguments" right before the exec: > > wrong number of arguments (2 for 1) > err: //.....]/returns: change from notrun to 0 failed: cat > /etc/..._svn_release > /tmp/svnupdated returned 1 instead of 0 at > /etc/puppet/manifests/includes/..._svn.pp:22 > > Does anyone know what this is? > > > On Sun, Jun 15, 2008 at 11:08 AM, gorillamania <gorillamania@gmail.com> > wrote: > >> >> Hello, >> >> All of my "exec" calls fail. It''s probably PEBCACK, but I''ve searched >> and searched and I''m stuck. I created the following simple test script >> to illustrate: >> >> class test_exec { >> >> file { "testme": >> path => "/tmp/testfile", >> source => "puppet://$puppet_server/files/etc/rc.d/rc.firewall", >> ensure => present >> } >> >> # Can''t any exec''s to work via puppet. Even "/bin/true" returns >> exit code 1 >> exec { "/bin/true": >> subscribe => File["testme"], >> refreshonly => true >> } >> >> } >> >> >> And here is the error I get from /var/log/messages: >> >> Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/ >> File[testme]/ensure) created >> Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/Exec[/ >> bin/true]) Triggering ''refresh'' from 1 dependencies >> Jun 15 10:52:33 xxxxxx puppetd[32360]: (//Node[xxxxxx]/test_exec/Exec[/ >> bin/true]) Failed to call refresh on Exec[/bin/true]: /bin/true >> returned 1 instead of 0 at /etc/puppet/manifests/includes/test_exec.pp: >> 14 >> Jun 15 10:52:35 xxxxxx puppetd[32360]: (//Node[xxxxxx]/dbslave/ >> dbserver/baseclass/tidy/File[/home/tempfiles/3hours]/ensure) created >> >> I used /bin/true to make sure it wasn''t an issue with environment >> variables. I know that /bin/true returns an exit code of 0. ;-) >> >> # /bin/true >> # echo $? >> 0 >> >> This happens with every command that I ''exec''. The commands in >> question all work fine from command line. Furthermore, it appears that >> it isn''t executing the command at all. When I execute "/bin/touch /tmp/ >> testme", the file is not created. >> >> Any ideas? Any tips on how to debug? >> >> Thanks, >> >> -Nick >> >> PS. Version info: >> # puppet --version >> 0.24.4 >> # ruby --version >> ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux] >> # facter --version >> 1.3.8 >> # uname -a >> Linux gummibear.xxxxx.com 2.6.18-53.1.4.el5 #1 SMP Fri Nov 30 00:45:16 >> EST 2007 i686 i686 i386 GNU/Linux >> >> >> >> >> >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---