[Puppet Users] Re: debugging external node scripts

2009-06-24 Thread Nicolas Szalay

Le mercredi 24 juin 2009 à 10:02 +0200, Dan Bode a écrit :
> Hi all,
> 
> How can I debug external node script errors? I cant seem to figure out
> what is wrong with my script. It appears to work from the command
> line, but not from puppet.

Run your master with --debug --trace 


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~--~~~~--~~--~--~---



[Puppet Users] Re: debugging external node scripts

2009-06-24 Thread Dan Bode
I just had to solve it the old fashion way. Write statements to a log file,
and find the broken line. The issue was that a file did not have proper read
permissions for the puppet user.

trace is not very helpful

here is the server on trace:

#puppetmasterd --no-daemonize --verbose --debug --trace
debug: Executing '/etc/puppet/conf/node_classifier HOST.com'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:18:in
`find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:210:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:49:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/network/handler/master.rb:65:in
`getconfig'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/inflector.rb:257:in
`to_proc'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `call'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in
`protect_service'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/processor.rb:85:in
`setup_processor'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `call'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `each'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:366:in `call_method'
/usr/lib/ruby/1.8/xmlrpc/server.rb:378:in `handle'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/processor.rb:44:in
`process'
/usr/lib/ruby/site_ruby/1.8/puppet/network/xmlrpc/webrick_servlet.rb:68:in
`service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:293:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:144:in `newthread'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `newthread'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:291:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:290:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:290:in `start'
/usr/sbin/puppetmasterd:285
err: Could not call: Could not find node NODE.com'; cannot compile


Here is the script run from the command line:

# /etc/puppet/conf/node_classifier HOST.com
/etc/puppet/conf/node_classifier:26:in `initialize': No such file or
directory - /etc/puppet/conf/inventory.csv (Errno::ENOENT)
from /etc/puppet/conf/node_classifier:26:in `new'
from /etc/puppet/conf/node_classifier:26:in `getHost'
from /etc/puppet/conf/node_classifier:133



On Wed, Jun 24, 2009 at 10:12 AM, Nicolas Szalay wrote:

>
> Le mercredi 24 juin 2009 à 10:02 +0200, Dan Bode a écrit :
> > Hi all,
> >
> > How can I debug external node script errors? I cant seem to figure out
> > what is wrong with my script. It appears to work from the command
> > line, but not from puppet.
>
> Run your master with --debug --trace
>
>
> >
>

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~--~~~~--~~--~--~---



[Puppet Users] Re: debugging external node scripts

2009-06-24 Thread Nicolas Szalay

Le mercredi 24 juin 2009 à 10:28 +0200, Dan Bode a écrit :
> # /etc/puppet/conf/node_classifier HOST.com
> /etc/puppet/conf/node_classifier:26:in `initialize': No such file or
> directory - /etc/puppet/conf/inventory.csv (Errno::ENOENT)
> from /etc/puppet/conf/node_classifier:26:in `new'
> from /etc/puppet/conf/node_classifier:26:in `getHost'
> from /etc/puppet/conf/node_classifier:133

You previously said it was fine from the command line ?!?


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~--~~~~--~~--~--~---



[Puppet Users] Re: debugging external node scripts

2009-06-24 Thread Dan Bode
This is not my original error, I have fixed that. My original error did not
output to stderr (from the script execution) because it was a permissions
issue with the puppet user.

I created this error as an example to show that error outputs from script
execution are being suppressed at trace level.

regards,

Dan

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~--~~~~--~~--~--~---



[Puppet Users] Re: Debugging external node scripts

2009-06-29 Thread Nicolas Szalay
Le lundi 29 juin 2009 à 01:09 -0700, Curt Micol a écrit :

> When I run the script directly:
> [r...@vpsadmins ~]# python /etc/puppet/tools/external_nodes.py dc2-
> vps1-400b.example.com
> ---
> classes:
> - custom
> - monitoring::base
> - ntpd
> - puppetd
> - rpms
> - sshd
> - yum
> - crontab
> - iptables
> - ldap::client
> - monitoring::vps
> - sudo
> - virtuozzo
> - vpsscripts

Did you try running it as the "puppet" user ? permissions on NODEFILE &
LOGFILE could be source of errors.

Regards,

Nicolas


signature.asc
Description: Ceci est une partie de message numériquement signée


[Puppet Users] Re: Debugging external node scripts

2009-06-29 Thread Curt Micol

2009/6/29 Nicolas Szalay :
> Le lundi 29 juin 2009 à 01:09 -0700, Curt Micol a écrit :
> Did you try running it as the "puppet" user ? permissions on NODEFILE &
> LOGFILE could be source of errors.

Yes, sorry, I get the same results with running as the puppet user.
Just tested once more to verify and received the same error.

-- 
# Curt Micol

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~--~~~~--~~--~--~---



[Puppet Users] Re: Debugging external node scripts

2009-07-03 Thread Martin Wheldon

Hi Curt,

Did you manage to resolve this issue? If not I think it may be the
format of your yaml output.

>---
>classes:
>- custom
>- monitoring::base

Should be this

---
classes:
   - custom
   - monitoring::base

Note the indentation. Having said that I have been unable to persuade
the python yaml module to produce this
as yet.

Hope this helps

Martin



On Mon, Jun 29, 2009 at 10:39 AM, Curt Micol wrote:
>
> 2009/6/29 Nicolas Szalay :
>> Le lundi 29 juin 2009 à 01:09 -0700, Curt Micol a écrit :
>> Did you try running it as the "puppet" user ? permissions on NODEFILE &
>> LOGFILE could be source of errors.
>
> Yes, sorry, I get the same results with running as the puppet user.
> Just tested once more to verify and received the same error.
>
> --
> # Curt Micol
>
> >
>

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~--~~~~--~~--~--~---



[Puppet Users] Re: Debugging external node scripts

2009-07-03 Thread Curt Micol

On Fri, Jul 3, 2009 at 12:05 PM, Martin Wheldon wrote:
>
> Hi Curt,
>
> Did you manage to resolve this issue? If not I think it may be the
> format of your yaml output.
>
>>---
>>classes:
>>- custom
>>- monitoring::base
>
> Should be this
>
> ---
> classes:
>   - custom
>   - monitoring::base
>
> Note the indentation. Having said that I have been unable to persuade
> the python yaml module to produce this
> as yet.
>
> Hope this helps

Hey Martin,

Thanks for the response. I did indeed get this working, it turns out
it wasn't Puppet at all. The path for finding Python was incorrect, so
while I was pointing it at /usr/local/bin/python it wasn't finding it
and using /usr/bin/python which for some reason this script can't use
(version issues). How and why this is, I don't know, but that's about
as close to the reason as I was able to get.

I think YAML is white space agnostic due to the '-' and ':' syntax. I
could be wrong though.

I hope to get some time and send in a patch to update the output on
errors for executing external nodes, 4 days trying to figure out this
issue was quite annoying and the error did little to help remedy the
issue.

Thanks again for the reponse,

-- 
# Curt Micol

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~--~~~~--~~--~--~---



Re: [Puppet Users] Re: Debugging external node scripts

2012-09-28 Thread Virgil
Hi Curt, I realize this is 3 year s later, but do you have any idea how one 
debugs such an issue in 2012?

Cheers,
Virgil

On Friday, July 3, 2009 2:13:14 PM UTC-7, Curt Micol wrote:
>
> On Fri, Jul 3, 2009 at 12:05 PM, Martin 
> Wheldon> 
> wrote:
> >
> > Hi Curt,
> >
> > Did you manage to resolve this issue? If not I think it may be the
> > format of your yaml output.
> >
> >>---
> >>classes:
> >>- custom
> >>- monitoring::base
> >
> > Should be this
> >
> > ---
> > classes:
> >   - custom
> >   - monitoring::base
> >
> > Note the indentation. Having said that I have been unable to persuade
> > the python yaml module to produce this
> > as yet.
> >
> > Hope this helps
>
> Hey Martin,
>
> Thanks for the response. I did indeed get this working, it turns out
> it wasn't Puppet at all. The path for finding Python was incorrect, so
> while I was pointing it at /usr/local/bin/python it wasn't finding it
> and using /usr/bin/python which for some reason this script can't use
> (version issues). How and why this is, I don't know, but that's about
> as close to the reason as I was able to get.
>
> I think YAML is white space agnostic due to the '-' and ':' syntax. I
> could be wrong though.
>
> I hope to get some time and send in a patch to update the output on
> errors for executing external nodes, 4 days trying to figure out this
> issue was quite annoying and the error did little to help remedy the
> issue.
>
> Thanks again for the reponse,
>
> -- 
> # Curt Micol
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/aTahLqqWzIwJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.