Cannot see Inventory in Dashboard & failed to use facer variable in manifest

127 views
Skip to first unread message

shlo....@gmail.com

unread,
Dec 11, 2013, 3:00:06 PM12/11/13
to puppet...@googlegroups.com


Hi,

In Dashboard, in the 'Inventory' section I get nothing but the error:
    Could not retrieve facts from inventory service: 403 "Forbidden"

When I tried to use facter variables in the manifest, it look like it's not working. (I new in that so I never tried it before).
I have something like this:
    case ${hostname} {
         'puppetagent': {include sendmail}
    }
But when I run puppet on the agent, I get the error: 
    Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Could not match ${hostname} at    
    /etc/puppet/manifests/nodes.pp:17 on node puppetagent


Is it possible that the problems are connected? How can I solve that problem?
Any help welcome.

Jeff Bachtel

unread,
Dec 11, 2013, 3:06:04 PM12/11/13
to puppet...@googlegroups.com
Try

case $hostname {
'puppetagent': {include sendmail}
}

BUT, that's really the wrong pattern to be following, you should instead
create a node definition for "puppetagent" that includes the sendmail class.

node puppetagent.yourdomain {
include sendmail
}

Jeff
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/80e4abd7-1bad-48d3-94ac-1c61b00fae74%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

shlo....@gmail.com

unread,
Dec 12, 2013, 6:35:22 AM12/12/13
to puppet...@googlegroups.com

Hi,
Thank you very much for your quick response.

I tried it and now I get:
    Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find default node or by name with 'puppetagent.weizmann.ac.il,   
    puppetagent.weizmann.ac, puppetagent.weizmann, puppetagent' on node puppetagent.weizmann.ac.il

It can be that the Dashboard and the above problem connected and I have something wrong in my puppet configuration?
Any idea are welcome.

Felix Frank

unread,
Dec 12, 2013, 8:55:33 AM12/12/13
to puppet...@googlegroups.com
Hi,

please be aware that "puppetagent.yourdomain" is a contrived example.
Try "node puppetagent.weizmann.ac.il" or just "node puppetagent".

HTH,
Felix

On 12/12/2013 07:35 AM, shlo....@gmail.com wrote:
> I tried it and now I get:
> Error: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Could not find default node or by name with
> 'puppetagent.weizmann.ac.il,
> puppetagent.weizmann.ac, puppetagent.weizmann, puppetagent' on
> node puppetagent.weizmann.ac.il
...
> node puppetagent.yourdomain {
> include sendmail
> }

shlo....@gmail.com

unread,
Dec 12, 2013, 9:09:20 AM12/12/13
to puppet...@googlegroups.com
Hi,

When I write the name of the agent explicitly :
    node puppetagent.yourdomain { 
        include sendmail 
    } 
it's work. 

I get the mention error when I try to use the facter and use $hostname in my manifest file node.pp

Thanks a lot.

Felix Frank

unread,
Dec 12, 2013, 9:13:50 AM12/12/13
to puppet...@googlegroups.com
This is getting confusing.

Please share what your nodes.pp looks like now and what error that yields.

Thanks,
Felix

shlo....@gmail.com

unread,
Dec 12, 2013, 9:33:17 AM12/12/13
to puppet...@googlegroups.com
Hi,

1.  When I have in node.pp:
         case $hostname {
             'puppetagent': {include sendmail}
         }
    I got the error:
        Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find default node or by name with 'puppetagent.weizmann.ac.il,   
        puppetagent.weizmann.ac, puppetagent.weizmann, puppetagent' on node puppetagent.weizmann.ac.il

2.  When I have:
         node puppetagent.weizmann.ac.il
             include sendmail 
         } 
     it's work okay.

3.  I also don't have the 'Inventory' section in Dashboard and I have only the error:
        Could not retrieve facts from inventory service: 403 "Forbidden"
     under the 'Inventory' title.

Thank you for your promptly answer.

Felix Frank

unread,
Dec 12, 2013, 9:53:16 AM12/12/13
to puppet...@googlegroups.com
Ah, OK, you lack a default node. The puppet master expects to find some
node, a simple workaround could be 'node default {}' anywhere in site.pp
or node.pp.

But, as Jeff pointed out - don't do that, there is no reason to prefer
the silly-ish case pattern in this context.

As gor the 403 error wrt. the inventory service - that may be an
auth.conf issue. Does the dashboard keep an error log or log of any
sort? Try looking in its rack home. You may get a clue what the specific
request is that is getting blocked.

HTH,
Felix

On 12/12/2013 10:33 AM, shlo....@gmail.com wrote:
> 1. When I have in node.pp:
> case $hostname {
> 'puppetagent': {include sendmail}
> }
> I got the error:
> /Error: Could not retrieve catalog from remote server: Error 400
> on SERVER: Could not find default node or by name with
> 'puppetagent.weizmann.ac.il <http://puppetagent.weizmann.ac.il/>, /
> / puppetagent.weizmann.ac
> <http://puppetagent.weizmann.ac/>, puppetagent.weizmann, puppetagent' on
> node puppetagent.weizmann.ac.il <http://puppetagent.weizmann.ac.il/>/

shlo....@gmail.com

unread,
Dec 12, 2013, 10:42:24 AM12/12/13
to puppet...@googlegroups.com
Hi,
I add 'node default {}'. 
Now I don't get any errors but it don't execute the 
      case $hostname { 
           'puppetagent': {include sendmail} 
      } 
Puppet don't use the value in $hostname.

I understood that it's not recommended way to use $hostname as variable, but it should work. Am I right?

About the Dashboard, I use Puppet with Passenger.
In /etc/httpd/logs/error_logs I have a lot of (I think each time Dashboard refreshed) warning:
[ 2013-12-12 12:34:30.0426 24489/7f1dac713700 Pool2/Implementation.cpp:1291 ]: [App 29486 stderr] warning: peer certificate won't be verified in this SSL session
[ 2013-12-12 12:34:30.0427 24489/7f1dac713700 Pool2/Implementation.cpp:1280 ]: [App 29486 stderr] 

I don't know how to find the ruby logs.

Thanks a lot.

Felix Frank

unread,
Dec 12, 2013, 10:45:49 AM12/12/13
to puppet...@googlegroups.com
On 12/12/2013 11:42 AM, shlo....@gmail.com wrote:
> case $hostname {
> 'puppetagent': {include sendmail}
> }
> Puppet don't use the value in $hostname.

Is this in the top scope, i.e. not inside a class {}, node {} or define
{} block?

> About the Dashboard, I use Puppet with Passenger.
> In /etc/httpd/logs/error_logs I have a lot of (I think each time
> Dashboard refreshed) warning:
> [ 2013-12-12 12:34:30.0426 24489/7f1dac713700
> Pool2/Implementation.cpp:1291 ]: [App 29486 stderr] warning: peer
> certificate won't be verified in this SSL session

This looks weird. Implementation.cpp? Is dashboard written in C++, or am
I misreading this?
This may not be related to your issues at all.

How and where did you install dashboard?

shlo....@gmail.com

unread,
Dec 12, 2013, 11:59:52 AM12/12/13
to puppet...@googlegroups.com
In the end of the file I add :
    node default {
     }

Thanks again

shlo....@gmail.com

unread,
Dec 12, 2013, 12:52:50 PM12/12/13
to puppet...@googlegroups.com


Sorry I had a spelling mistake in the hostname. Now the manifest file work okay with the $hostname variable.

I left with the problem with Dashboard that don't give me the 'Inventory' details.

Sorry & Thanks again for the promptly answers.

shlo....@gmail.com

unread,
Dec 15, 2013, 10:10:57 AM12/15/13
to puppet...@googlegroups.com


Hi,
For installing Dashboard, I follow the instruction in:
  In section 'Serving Dashboard With Passenger and Apache' I use the default port 80. 
  I tried to change it to port 3000, but all the Dashboard stop working.

I search the file Implementation.cpp and I find it in 
/usr/lib64/ruby/gems/1.8/gems/passenger-4.0.25/ext/common/ApplicationPool2/Implementation.cpp
I'm using Apache + Passenger. It look that this error appear in the error_log each time the Dashboard refresh.
But it can be that it not directly connect to my problem.

In the file /etc/puppet/auth.conf I add:
  path /facts
  auth yes
  method find, search
  allow dashboard

Any idea why I'm still getting, in the 'Inventory' section,  the error:
  Could not retrieve facts from inventory service: 403 "Forbidden"

Thanks a lot.


On Thursday, December 12, 2013 12:45:49 PM UTC+2, Felix.Frank wrote:

.... 
Reply all
Reply to author
Forward
0 new messages