Apply class fail from hiera

128 views
Skip to first unread message

mike

unread,
May 15, 2014, 1:14:41 PM5/15/14
to puppet...@googlegroups.com
Hi everyone,
I'm setting in my Puppet the MySQL module with Hiera but when i run the node agent i give the error. 

--------------
[root@node1 ~]# puppet agent --test
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: wrong header line format
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
--------------

My configuration is the next 

My site.pp

--------------
        hiera_include('classes')
}
--------------

And my hiera node file (yaml) 

--------------
[root@master puppet]# cat hieradata/nodesdb/node1.example.com.yaml  (only have this node)
---
classes: mysql
mysql::server::root_password: 'mypassword'
mysql::server::override_options:
   max_connections: '1024'  
   query_cache_size: '64M'
[root@master puppet]# 
--------------

I try change the value "classes" from classes: mysql to classes: 'mysql' but i have the same result.

When i check the value is ok, for example:
--------------
[root@master nodesdb]# hiera mysql::server::override_options fqdn=node1.example.com
[{"max_connections"=>"1024"}, {"query_cache_size"=>"64M"}]
--------------

And my syntax
--------------
[root@master nodesdb]# ruby -e "require 'yaml'; YAML.parse(File.open('node1.example.com.yaml'))" ### is ok, no error. 
--------------

Thanks.


jcbollinger

unread,
May 16, 2014, 9:29:40 AM5/16/14
to puppet...@googlegroups.com


On Thursday, May 15, 2014 12:14:41 PM UTC-5, mike wrote:
Hi everyone,
I'm setting in my Puppet the MySQL module with Hiera but when i run the node agent i give the error. 

--------------
[root@node1 ~]# puppet agent --test
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: wrong header line format
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
--------------



To me, that says the agent successfully connects to the server on the expected port, but the response is not what it expects.  Yours is not one of the usual error messages attending SSL problems, so I'm supposing that the agent and master are satisfied with each other's credentials.  After that, though, the server responds with something different from what the agent expects.

Supposing that the master is running in an external Rack server such as Passenger, my guess would be that the server's container (e.g. Apache) is returning an HTML page -- maybe an error page -- instead of a catalog.

You can test all that by monitoring network traffic between agent and master via Wireshark or a similar tool.

 
My configuration is the next 



Your manifest set and data are unlikely to be the problem.  The agent / master protocol has provisions for the master to return error messages to the agent, which it will use when it has any problem compiling a catalog.  The error message you present is from a different, lower, agent-side layer.


John

Miguel Angel Coa M.

unread,
May 16, 2014, 10:34:22 AM5/16/14
to puppet...@googlegroups.com
Hi,
The strange is that problem appears only use hiera (hiera_include), when i comment this line in my site.pp and create any simple manifest this is applicate without problem in my node. 


--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/E7zcv-QyBzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d94ffc3d-e93f-4cf8-a9fa-0d35ceff4946%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jcbollinger

unread,
May 19, 2014, 9:04:05 AM5/19/14
to puppet...@googlegroups.com


On Friday, May 16, 2014 9:34:22 AM UTC-5, mike wrote:
Hi,
The strange is that problem appears only use hiera (hiera_include), when i comment this line in my site.pp and create any simple manifest this is applicate without problem in my node. 



So maybe your hiera is broken (or somehow absent), or for some other reason Puppet is crashing when it tries to look up the classes for your hiera_include().  The container might reasonably respond to such an event by serving up an HTTP 500 error page.  But that's speculative.  You really need to find out what the agent is receiving from the master, that it considers erroneous.


John

jcbollinger

unread,
May 19, 2014, 9:05:42 AM5/19/14
to puppet...@googlegroups.com


Also, check your master's logs.


John
 

Miguel Angel Coa M.

unread,
May 19, 2014, 10:18:37 AM5/19/14
to puppet...@googlegroups.com
Hi,
I try configure the NTP Hiera class (http://docs.puppetlabs.com/hiera/1/complete_example.html) and run ok and i dont have any errors in my node client. I believe that my error is a some problem with the MySQL configuration Hiera Class (some variable, some params).

Thanks. 


--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/E7zcv-QyBzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.

jcbollinger

unread,
May 20, 2014, 9:02:56 AM5/20/14
to puppet...@googlegroups.com


On Monday, May 19, 2014 9:18:37 AM UTC-5, mike wrote:
Hi,

I try configure the NTP Hiera class (http://docs.puppetlabs.com/hiera/1/complete_example.html) and run ok and i dont have any errors in my node client. I believe that my error is a some problem with the MySQL configuration Hiera Class (some variable, some params).



Last try: you are not giving us the information we would need to diagnose your unusual problem.  Find out what the master is delivering to the agent, that the agent rejects as erroneous.  Also check your master's logs for Puppet and whatever container it is running in.  Moreover, turn on debug logging at both master and agent so as to glean as much information as possible from those logs.

You may be right that the problem is centered around some problem with your hiera data, but I don't see anything structurally wrong with what you presented, and the error you report is not indicative of an ordinary catalog compilation failure.

You could also check the versions of master and agent.  As a rule, the agent should not be a later Puppet version than the master is.  With a problem along those lines, however, the agent and master usually don't work together at all.


John

Reply all
Reply to author
Forward
0 new messages