Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7171

Undefined Variable trusted.certname

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.0
    • Fix Version/s: PUP 4.9.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Debian wheezy and jessie Puppet Server 2.7.2
      Puppet 4.9.0

    • Template:
    • Acceptance Criteria:
      Hide

      Since the trusted hash is not even in use I would like to avoid getting errors about it.

      Show
      Since the trusted hash is not even in use I would like to avoid getting errors about it.
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-02-08
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      A regression was introduced in the Hiera 5 implementation where an error such as "trusted.certname" is an undefined variable would be the outcome. This was caused by a bug in cache optimization logic and would occur the second time a lookup was performed. This is now fixed.
      Show
      A regression was introduced in the Hiera 5 implementation where an error such as "trusted.certname" is an undefined variable would be the outcome. This was caused by a bug in cache optimization logic and would occur the second time a lookup was performed. This is now fixed.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      regression and covered in unit tests

      Description

      After the update to 4.9.0 and a restart of the Puppet Server all nodes produce errors

       Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Undefined variable 'trusted.certname';  at /etc/puppetlabs/code/environments/production/modules20/saltmail/manifests/init.pp:676:5 on node ...
      

      The trusted hash is not used in any of our manifests. In all our environments the first time the error occurs is the "include sudo" line in our global manifest. If this is commented out another random location shows the error (depicted above), in this case the error message is right in the middle of an else line.

      The error occurs on one Puppet Master on Debian wheezy and an independent Puppet Master (sharing some but not all manifest code) on Debian jessie.

      The string 'trusted' never appears in our manifests or Ruby code in any modules.
      The string certname appears twice as parameter name in certificate related modules but nowhere near the source location indicated.

      The line 676 in the error above looks like this

        } else {
      

      The error with the sudo module occurs once on a simple "include sudo" line and once on the first line of a

      class { 'sudo':
          autoupgrade => false
      }
      

      The puppetserver.log contains errors like this one

      2017-02-03 17:01:20,335 ERROR [qtp1680176683-3570] [puppetserver] Puppet Evaluation Error: Error while evaluating a Resource Statement, Undefined variable 'trusted.certname';  at /etc/puppetlabs/code/environments
      /production/modules20/saltmail/manifests/init.pp:676:5 on node ...
      2017-02-03 17:01:20,335 ERROR [qtp1680176683-3570] [puppetserver] Puppet Server Error: Evaluation Error: Error while evaluating a Resource Statement, Undefined variable 'trusted.certname';  at /etc/puppetlabs/cod
      e/environments/production/modules20/saltmail/manifests/init.pp:676:5 on node...
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:531:in `variable_not_found'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:504:in `lookupvar'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:607:in `lookup_qualified_variable'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:493:in `lookupvar'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/scope.rb:25:in `[]'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/hiera_config.rb:171:in `scope_interpolations_stable?'
      org/jruby/RubyHash.java:1342:in `each'
      org/jruby/RubyEnumerable.java:1414:in `all?'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/hiera_config.rb:171:in `scope_interpolations_stable?'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/configured_data_provider.rb:83:in `data_providers'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/configured_data_provider.rb:49:in `unchecked_key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:116:in `with'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/configured_data_provider.rb:42:in `unchecked_key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/global_data_provider.rb:26:in `unchecked_key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/data_provider.rb:45:in `key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:73:in `check'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/data_provider.rb:45:in `key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:72:in `lookup_global'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:263:in `global_lookup_options'
      org/jruby/RubyKernel.java:1242:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:263:in `global_lookup_options'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:272:in `env_lookup_options'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:242:in `retrieve_lookup_options'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:116:in `with'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:238:in `retrieve_lookup_options'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:58:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:237:in `retrieve_lookup_options'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:139:in `lookup_lookup_options'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:124:in `lookup_merge_options'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:58:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:58:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:50:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:76:in `search_and_merge'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:401:in `inject_external_parameters'
      org/jruby/RubyKernel.java:1242:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:400:in `inject_external_parameters'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:396:in `inject_external_parameters'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:363:in `set_resource_parameters'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:171:in `evaluate_code'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/resource.rb:81:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/resource.rb:73:in `evaluate'
      org/jruby/RubyArray.java:1613:in `each'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:395:in `evaluate_classes'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/runtime3_resource_support.rb:61:in `create_resources'
      org/jruby/RubyArray.java:2414:in `map'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/runtime3_resource_support.rb:37:in `create_resources'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/runtime3_support.rb:321:in `create_resources'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:842:in `eval_ResourceExpression'
      org/jruby/RubyArray.java:2414:in `map'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:839:in `eval_ResourceExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/visitor.rb:69:in `visit_this_1'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:1007:in `eval_IfExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:938:in `with_guarded_scope'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:1003:in `eval_IfExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/visitor.rb:69:in `visit_this_1'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:638:in `eval_BlockExpression'
      org/jruby/RubyArray.java:1613:in `each'
      org/jruby/RubyEnumerable.java:852:in `inject'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:638:in `eval_BlockExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/visitor.rb:69:in `visit_this_1'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/parser/evaluating_parser.rb:63:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/ast/pops_bridge.rb:32:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/ast/pops_bridge.rb:72:in `evaluate'
      org/jruby/RubyKernel.java:1242:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/ast/pops_bridge.rb:71:in `evaluate'
      org/jruby/RubyKernel.java:1242:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/ast/pops_bridge.rb:70:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/ast.rb:31:in `safeevaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/type.rb:184:in `evaluate_code'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/resource.rb:81:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/resource.rb:73:in `evaluate'
      org/jruby/RubyArray.java:1613:in `each'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:395:in `evaluate_classes'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/../../../puppet/functions/include.rb:16:in `include'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/dispatch.rb:47:in `invoke'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/dispatcher.rb:36:in `dispatch'
      org/jruby/RubyKernel.java:1242:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/dispatcher.rb:35:in `dispatch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:46:in `call'
      org/jruby/RubyKernel.java:1242:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/functions/function.rb:45:in `call'
      /etc/puppetlabs/code/environments/production/manifests/10_global.pp:60:in `call_function'
      org/jruby/RubyKernel.java:1079:in `eval'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/runtime3_support.rb:284:in `call_function'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/runtime3_support.rb:282:in `call_function'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:941:in `call_function_with_block'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:910:in `eval_CallNamedFunctionExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/visitor.rb:69:in `visit_this_1'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:1005:in `eval_IfExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/scope.rb:938:in `with_guarded_scope'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:1003:in `eval_IfExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/visitor.rb:69:in `visit_this_1'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:638:in `eval_BlockExpression'
      org/jruby/RubyArray.java:1613:in `each'
      org/jruby/RubyEnumerable.java:852:in `inject'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:638:in `eval_BlockExpression'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/visitor.rb:69:in `visit_this_1'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate'
      /etc/puppetlabs/code/environments/production/manifests/10_global.pp:0:in `stack'
      org/jruby/RubyKernel.java:1079:in `eval'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/puppet_stack.rb:30:in `stack'
      

      We do not make any use of Hiera.

      (node names in errors and log omitted on purpose)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mhoermann Matthias Hörmann
            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support