Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.19.1 introduces a bug with error reporting - Please do not use the Logging::Appenders::Console class directly #306

Open
jessereynolds opened this issue Feb 16, 2021 · 2 comments
Labels

Comments

@jessereynolds
Copy link
Collaborator

jessereynolds commented Feb 16, 2021

When a catalog compilation failure occurs, onceover hits an exception in gems/logging-2.3.0/lib/logging/appenders/console.rb while trying to present a friendly error message. The error in full:

Please do not use the Logging::Appenders::Console class directly - use Logging::Appenders::Stdout and Logging::Appenders::Stderr instead [class MakeMakefile::Logging::Appenders::Stdout] (RuntimeError)

once more with stack trace:

Traceback (most recent call last):
	20: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/exe/rspec:4:in `<main>'
	19: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/runner.rb:45:in `invoke'
	18: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/runner.rb:71:in `run'
	17: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/runner.rb:89:in `run'
	16: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/runner.rb:115:in `run_specs'
	15: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/reporter.rb:76:in `report'
	14: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/reporter.rb:174:in `finish'
	13: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/reporter.rb:194:in `close_after'
	12: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/reporter.rb:178:in `block in finish'
	11: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/reporter.rb:208:in `notify'
	10: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/reporter.rb:208:in `each'
	 9: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib/rspec/core/reporter.rb:209:in `block in notify'
	 8: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/onceover-3.19.1/lib/onceover/rspec/formatters.rb:70:in `dump_failures'
	 7: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/onceover-3.19.1/lib/onceover/rspec/formatters.rb:70:in `each'
	 6: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/onceover-3.19.1/lib/onceover/rspec/formatters.rb:71:in `block in dump_failures'
	 5: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/onceover-3.19.1/lib/onceover/controlrepo.rb:563:in `evaluate_template'
	 4: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/onceover-3.19.1/lib/onceover/logger.rb:18:in `logger'
	 3: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/logging-2.3.0/lib/logging/appenders/console.rb:82:in `stdout'
	 2: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/logging-2.3.0/lib/logging/appenders/console.rb:82:in `new'
	 1: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/logging-2.3.0/lib/logging/appenders/console.rb:29:in `initialize'
/opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/logging-2.3.0/lib/logging/appenders/console.rb:61:in `open_fd': Please do not use the `Logging::Appenders::Console` class directly - use `Logging::Appenders::Stdout` and `Logging::Appenders::Stderr` instead [class MakeMakefile::Logging::Appenders::Stdout] (RuntimeError)
/opt/puppetlabs/puppet/bin/ruby -I/opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/lib:/opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-support-3.10.2/lib /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/rspec-core-3.10.1/exe/rspec --pattern spec/\{aliases,classes,defines,functions,hosts,integration,plans,tasks,type_aliases,types,unit\}/\*\*/\*_spec.rb failed

Reverting to version 3.19.0 fixes this

@jessereynolds
Copy link
Collaborator Author

I can't reproduce this on a more vanilla control-repo so it seems specific to this particular control-repo or its test environment. Test environment is:

  • centos:7 docker container
  • ruby is from puppet agent 6.21.0 package (ruby 2.5.8)
  • bundler

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    backticks (1.0.2)
    blockenspiel (0.5.0)
    colored (1.2)
    colored2 (3.1.2)
    concurrent-ruby (1.1.8)
    cri (2.15.11)
    deep_merge (1.2.1)
    diff-lcs (1.4.4)
    facter (4.0.51)
      hocon (~> 1.3)
      thor (>= 1.0.1, < 2.0)
    faraday (0.17.4)
      multipart-post (>= 1.2, < 3)
    faraday_middleware (0.14.0)
      faraday (>= 0.7.4, < 1.0)
    fast_gettext (1.1.2)
    gettext (3.2.9)
      locale (>= 2.0.5)
      text (>= 1.3.0)
    gettext-setup (0.34)
      fast_gettext (~> 1.1.0)
      gettext (>= 3.0.2, < 3.3.0)
      locale
    git (1.8.1)
      rchardet (~> 1.8)
    hiera (3.6.0)
    hocon (1.3.1)
    httpclient (2.8.3)
    little-plugger (1.1.4)
    locale (2.1.3)
    log4r (1.1.10)
    logging (2.3.0)
      little-plugger (~> 1.1)
      multi_json (~> 1.14)
    minitar (0.9)
    mocha (1.12.0)
    multi_json (1.15.0)
    multipart-post (2.1.1)
    onceover (3.19.1)
      backticks (>= 1.0.2)
      colored (~> 1.2)
      cri (>= 2.6)
      deep_merge (>= 1.0.0)
      git
      logging (>= 2.0.0)
      multi_json (~> 1.10)
      parallel_tests (>= 2.0.0)
      puppet (>= 4.0)
      puppetlabs_spec_helper (>= 0.4.0)
      r10k (>= 2.1.0)
      rake (>= 10.0.0)
      rspec (>= 3.0.0)
      rspec-puppet (>= 2.4.0)
      rspec_junit_formatter (>= 0.2.0)
      terminal-table (>= 1.8.0)
      versionomy (>= 0.5.0)
    parallel (1.20.1)
    parallel_tests (3.4.0)
      parallel
    pathspec (0.2.1)
    puppet (6.21.0)
      concurrent-ruby (~> 1.0)
      deep_merge (~> 1.0)
      facter (>= 2.4.0, < 5)
      fast_gettext (~> 1.1)
      hiera (>= 3.2.1, < 4)
      httpclient (~> 2.8)
      locale (~> 2.1)
      multi_json (~> 1.13)
      semantic_puppet (~> 1.0)
    puppet-lint (2.4.2)
    puppet-syntax (3.1.0)
      puppet (>= 5)
      rake
    puppet_forge (2.3.4)
      faraday (>= 0.9.0, < 0.18.0, != 0.13.1)
      faraday_middleware (>= 0.9.0, < 0.15.0)
      gettext-setup (~> 0.11)
      minitar
      semantic_puppet (~> 1.0)
    puppetlabs_spec_helper (3.0.0)
      mocha (~> 1.0)
      pathspec (>= 0.2.1, < 1.1.0)
      puppet-lint (~> 2.0)
      puppet-syntax (>= 2.0, < 4)
      rspec-puppet (~> 2.0)
    r10k (3.7.0)
      colored2 (= 3.1.2)
      cri (>= 2.15.10, < 3.0.0)
      fast_gettext (~> 1.1.0)
      gettext (>= 3.0.2, < 3.3.0)
      gettext-setup (~> 0.24)
      log4r (= 1.1.10)
      multi_json (~> 1.10)
      puppet_forge (~> 2.3.0)
    rake (12.3.3)
    rchardet (1.8.0)
    rspec (3.10.0)
      rspec-core (~> 3.10.0)
      rspec-expectations (~> 3.10.0)
      rspec-mocks (~> 3.10.0)
    rspec-core (3.10.1)
      rspec-support (~> 3.10.0)
    rspec-expectations (3.10.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-mocks (3.10.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-puppet (2.8.0)
      rspec
    rspec-support (3.10.2)
    rspec_junit_formatter (0.4.1)
      rspec-core (>= 2, < 4, != 2.12.0)
    semantic_puppet (1.0.3)
    terminal-table (3.0.0)
      unicode-display_width (~> 1.1, >= 1.1.1)
    text (1.3.1)
    thor (1.1.0)
    unicode-display_width (1.7.0)
    versionomy (0.5.0)
      blockenspiel (~> 0.5)

PLATFORMS
  x86_64-linux

DEPENDENCIES
  onceover (= 3.19.1)
  puppet (= 6.21.0)
  rake (= 12.3.3)

BUNDLED WITH
   2.2.10

The error that I get when I switch onceover back to 3.19.0 is:

role::foo: failed
  errors:
    error during compilation: Evaluation Error: Error while evaluating a Function Call, Class[Splunk_uf]:
  expects a value for parameter 'deployment_server_name'
  expects a value for parameter 'admin_password'
  expects a value for parameter 'deployment_client_name_prefix' (file: /onceover/.onceover/etc/puppetlabs/code/environments/p
source "https://rubygems.org"
roduction/site-modules/role/manifests/damha621.pp, line: 17, column: 3) on node 4d6ab05ddbcf
      factsets: foo.example

@jessereynolds
Copy link
Collaborator Author

Reproduced this with the ruby25 (debian based) docker container also.

I have found that facter 4 seems to be the common element in turning up this bug. If facter is set to 3.x or 2.x then the problem goes away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants