Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?'

asked 2017-10-18 00:42:38 -0600

jamwu2 gravatar image

If I run this command, which use a local hieraconfig, then it will work: [root@shn-ops2 etc]# puppet apply -e 'include cdsmaster' --hieraconfig=/etc/hiera.yaml.bak Warning: Variable access via 'operatingsystem' is deprecated. Use '@operatingsystem' instead. template[/etc/puppet/modules/cdsmaster/template/auto.direct.erb]:1 (at /usr/lib/ruby/siteruby/1.8/puppet/parser/templatewrapper.rb:77:in `methodmissing') Notice: Compiled catalog for shn-ops2.cisco.com in environment production in 0.20 seconds Notice: /Stage[main]/Cdsmaster::Cdss/File[/etc/auto.master]/content: content changed '{md5}6165fb9b5003e3bdb2c0b99761aded75' to '{md5}f6772d737c6e6045338b913e6c601b8d' Notice: the cdsmaster is shn-ops2 Notice: /Stage[main]/Cdsmaster::Cdss/Notify[display]/message: defined 'message' as 'the cdsmaster is shn-ops2' Notice: /Stage[main]/Cdsmaster::Cdss/Cdsmaster::Sendmail::Message[AUTO.MASTER]/Exec[AUTO.MASTER]: Triggered 'refresh' from 1 events Notice: /Stage[main]/Cdsmaster::Cdss/Exec[mountcheck]/returns: executed successfully Notice: /Stage[main]/Cdsmaster::Cdss/Cdsmaster::Sendmail::Message[MOUNTCHECK]/Exec[MOUNTCHECK]: Triggered 'refresh' from 1 events Notice: Finished catalog run in 0.42 seconds [root@shn-ops2 etc]#

Means, the test is passed locally on the client side.

but if I run as below,then get error:

[root@shn-ops3 ~]# puppet agent -t Warning: Local environment: "production" doesn't match server specified node environment "ecsdevelopment", switching agent to "ecsdevelopment". Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?' for nil:NilClass at /cpos-shared/cpos-env/ecsdevelopment/modules/cdsmaster/manifests/cdss.pp:4 on node shn-ops3.cisco.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run [root@shn-ops3 ~]#

the code is: class cds_master::cdss{

$cdsmastersrv = hiera('cdsmaster::cdsmastersrv') $cdsdevsrv = hiera('cdsmaster::cdsdevsrv') ......

and the hiera data is simply: cdsmaster::cdsmastersrv: 'fud-lnx' cdsmaster::cdsdevsrv: 'shn-ops2'

I really don't know what happened. so really need some help here.

Thanks!

edit retag flag offensive close merge delete