Issue #22959 has been reported by Adam Lis. ---------------------------------------- Bug #22959: raising "Error: Could not retrieve catalog from remote server: Error 400 on SERVER" in case module content change on master https://projects.puppetlabs.com/issues/22959
* Author: Adam Lis * Status: Unreviewed * Priority: Normal * Assignee: * Category: modules * Target version: * Affected Puppet version: 3.3.0 * Keywords: * Branch: ---------------------------------------- Related to #16568 Short description - condition to raise error: <pre> 1. puppet master behind unicorn or standalone with only 1 process - both scenario tested 2. a client receives and apply catalog at some point of time, while module MOD is already defined on master node 3. this client uses a custom type defined inside module MOD 4. on master node module MOD is modified by - e.g. adding new params to type defined in this module 5. same client may receive and apply catalog or not - client will be presented changes in module MOD - this does not matter to reproduce error 6. on master node an update in manifests is made so that now client will be presented code that make use of new parameter of module MOD 7. now some attempts made by client to receive and apply catalog will fail due to error: </pre> <pre> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter NEW_PARAM_NAME at /etc/puppet/modules/path_to_module_making_use_of_modified_type/manifests/init.pp:9 on node pclient.test.tld </pre> while some other attempts will not lead to above error. Seems it depends on certain unicorn process on master node that is reached. Some unicorn processes has possibly cached earlier version of module MOD. The problem persist by time restarting puppet master unicorn server. After the restart all requests of retrieve and apply catalog will pass. *** The problem is described in details on pastebin: http://pastebin.com/Jx6cfSkM I also paste here contents of above pastebin. Before outputs, please see puppet version on master and client: <pre> [root@pmaster ~]# puppet --version 3.3.0 [root@pmaster ~]# [root@pclient ~]# puppet --version 3.3.0 [root@pclient ~]# </pre> <pre> Oct 23 12:44:20 pmaster puppet-master[1438]: Starting Puppet master version 3.3.0 Oct 23 12:44:25 pmaster puppet-master[1469]: Compiled catalog for pclient.test.tld in environment production in 1.03 seconds </pre> *** h2. Let a modules with a type - on master node: <pre> [root@pmaster modules]# cat /etc/puppet/modules/module_1/lib/puppet/type/custom_type_1.rb Puppet::Type.newtype(:custom_type_1) do @doc = "Do some stuff" newparam(:name) do desc "The name" end newparam(:month) do desc "Month" end newproperty(:ensure) do desc "Check if is already registered in master or not" defaultto :insync newvalue :outofsync newvalue :insync do print "OK" end def retrieve :outofsync end end end [root@pmaster modules]# </pre> h2. Let a module with a class that refference above type - on master node: <pre> [root@pmaster modules]# cat /etc/puppet/modules/module_2/manifests/init.pp class module_2 { custom_type_1 { "somename": month => "January", } } [root@pmaster modules]# </pre> h2. Restart puppetmaster <pre> [root@pmaster modules]# /etc/init.d/puppet-master restart Stopping unicorn: [ OK ] Starting unicorn: [ OK ] [root@pmaster modules]# </pre> Notice: above is done using unicorn, but normal standalone 1 process master is also affected by this bug as well (example in attached logs). h2. Create site.pp on master to show client what to apply: <pre> [root@pmaster modules]# cat /etc/puppet/manifests/site.pp include module_2 [root@pmaster modules]# </pre> h2. Run client - several times - depending on how many puppet master processes are defined: <pre> # puppet agent --debug -t </pre> h2. Modify the module from step 1st by adding new param (vision in this case): <pre> [root@pmaster modules]# cat /etc/puppet/modules/module_1/lib/puppet/type/custom_type_1.rb Puppet::Type.newtype(:custom_type_1) do @doc = "Do some stuff" newparam(:name) do desc "The name" end newparam(:month) do desc "Month" end newparam(:vision) do desc "Vision" end newproperty(:ensure) do desc "Check if is already registered in master or not" defaultto :insync newvalue :outofsync newvalue :insync do print "OK" end def retrieve :outofsync end end end [root@pmaster modules]# </pre> h2. Make usage of new param in class shown in point 2nd: <pre> [root@pmaster modules]# cat /etc/puppet/modules/module_2/manifests/init.pp class module_2 { custom_type_1 { "somename": month => "January", vision => "bad", } } [root@pmaster modules]# </pre> h2. Run update on puppet client for several times - sometimes it will appear on 1st time :D - below output: <pre> Info: Retrieving plugin Debug: file_metadata supports formats: pson b64_zlib_yaml yaml raw Debug: Executing 'diff -u /var/lib/puppet/lib/puppet/type/custom_type_1.rb /tmp/puppet-file20131023-3192-1u16k97' Notice: /File[/var/lib/puppet/lib/puppet/type/custom_type_1.rb]/content: --- /var/lib/puppet/lib/puppet/type/custom_type_1.rb 2013-10-23 04:09:00.250000043 -0700 +++ /tmp/puppet-file20131023-3192-1u16k97 2013-10-23 04:14:56.310000037 -0700 @@ -10,21 +10,20 @@ desc "Month" end + newparam(:vision) do + desc "Vision" + end + newproperty(:ensure) do desc "Check if is already registered in master or not" - defaultto :insync - newvalue :outofsync - newvalue :insync do print "OK" end - def retrieve :outofsync end - end end Notice: /File[/var/lib/puppet/lib/puppet/type/custom_type_1.rb]/content: content changed '{md5}30b9134b45e2526a5eb7d0e3386c70d1' to '{md5}4c796062525f017c2703708ac1cda19b' Debug: /File[/var/lib/puppet/lib/puppet/type/custom_type_1.rb]: The container /var/lib/puppet/lib will propagate my refresh event Debug: Finishing transaction 14975260 Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb Debug: catalog supports formats: pson b64_zlib_yaml yaml dot raw Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run </pre> h2. Important part is: <pre> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run </pre> Above error will occur on some runs while some other runs will be OK. Example puppet master log: <pre> Oct 23 04:17:13 pmaster puppet-master[16387]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Oct 23 04:17:13 pmaster puppet-master[16387]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Oct 23 04:17:13 pmaster puppet-master[16387]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Oct 23 04:17:30 pmaster puppet-master[16387]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Oct 23 04:17:30 pmaster puppet-master[16387]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Oct 23 04:17:30 pmaster puppet-master[16387]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Oct 23 04:17:32 pmaster puppet-master[16390]: Compiled catalog for pclient.test.tld in environment production in 0.04 seconds Oct 23 04:17:35 pmaster puppet-master[16390]: Compiled catalog for pclient.test.tld in environment production in 0.01 seconds Oct 23 04:17:38 pmaster puppet-master[16390]: Compiled catalog for pclient.test.tld in environment production in 0.01 seconds Oct 23 04:18:04 pmaster puppet-master[16390]: Compiled catalog for pclient.test.tld in environment production in 0.02 seconds Oct 23 04:18:07 pmaster puppet-master[16390]: Compiled catalog for pclient.test.tld in environment production in 0.00 seconds Oct 23 04:24:03 pmaster puppet-master[16393]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:10 on node pclient.test.tld Oct 23 04:24:03 pmaster puppet-master[16393]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:10 on node pclient.test.tld Oct 23 04:24:03 pmaster puppet-master[16393]: Invalid parameter vision at /etc/puppet/modules/module_2/manifests/init.pp:10 on node pclient.test.tld </pre> *** So above is what you can also find in pastebin. And I've also started puppet master process standalone with debug option: <pre> [root@pmaster ~]# puppet master --no-daemonize --debug 2>&1 | tee -a ./puppet-master-standalone-log-20131023-2222.log </pre> So in standalone master with only 1 process, I got on client: <pre> Info: Retrieving plugin Debug: file_metadata supports formats: pson b64_zlib_yaml yaml raw Debug: Executing 'diff -u /var/lib/puppet/lib/puppet/type/custom_type_1.rb /tmp/puppet-file20131023-23726-vrid7e' Notice: /File[/var/lib/puppet/lib/puppet/type/custom_type_1.rb]/content: --- /var/lib/puppet/lib/puppet/type/custom_type_1.rb 2013-10-23 13:38:33.532000042 -0700 +++ /tmp/puppet-file20131023-23726-vrid7e 2013-10-23 13:40:53.278000044 -0700 @@ -14,7 +14,7 @@ desc "Vision" end - newparam(:vision5) do + newparam(:santa) do desc "Vision" end Notice: /File[/var/lib/puppet/lib/puppet/type/custom_type_1.rb]/content: content changed '{md5}8f348a6a03040c556836ce983d7e74e1' to '{md5}5732ae70498fa572ef785db4ed08f29e' Debug: /File[/var/lib/puppet/lib/puppet/type/custom_type_1.rb]: The container /var/lib/puppet/lib will propagate my refresh event Debug: Finishing transaction 25318760 Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb Debug: catalog supports formats: pson b64_zlib_yaml yaml dot raw Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter santa at /etc/puppet/modules/module_2/manifests/init.pp:9 on node pclient.test.tld Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run </pre> I attach master debug log. Please notice - what is not in 2nd log attached - that this standalone master process then fail to compile catalog for client every time. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/groups/opt_out.
