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

rake task now failing #754

Closed
b4ldr opened this issue Sep 27, 2017 · 8 comments · Fixed by #755
Closed

rake task now failing #754

b4ldr opened this issue Sep 27, 2017 · 8 comments · Fixed by #755

Comments

@b4ldr
Copy link

b4ldr commented Sep 27, 2017

Hello,

Sorry i dont have much more information but since the last update to 2.3.1 my rake tasks are failing on linux machines. this can be seen in the travis task hear

https://travis-ci.org/icann-dns/puppet-knot/jobs/280395205

the check bundle exec rake test fails on the on the lint task from puppet-lint with an exit code of 1. changing back to puppet-lint 2.3.0 fixes the problem as can be seen on the following travis-ci job.

https://travis-ci.org/icann-dns/puppet-knot/jobs/280415804

happy to to more testing but not really sure where to start

@ekohl
Copy link
Contributor

ekohl commented Sep 27, 2017

When I run puppet-lint manually I can also get exit 1. Specifying the error level I can get a backtrace:

~/dev/puppet-nginx (master) $ be puppet-lint manifests --error-level all
bundler: failed to load command: puppet-lint (/home/ekohl/bin/puppet-lint)
NoMethodError: undefined method `%' for nil:NilClass
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:109:in `format_message'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:156:in `block in report'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:146:in `each'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:146:in `report'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:205:in `print_problems'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint/bin.rb:60:in `block in run'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint/bin.rb:56:in `each'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/lib/puppet-lint/bin.rb:56:in `run'
  /home/ekohl/.gem/ruby/2.4.0/gems/puppet-lint-2.3.1/bin/puppet-lint:7:in `<top (required)>'
  /home/ekohl/bin/puppet-lint:23:in `load'
  /home/ekohl/bin/puppet-lint:23:in `<top (required)>'

@tphoney
Copy link
Contributor

tphoney commented Sep 27, 2017

Just to add a +1 for also running into this, i am trying to look further into is.

@Darhazer
Copy link
Contributor

It seems that you have to set explicitly the output format

@tphoney
Copy link
Contributor

tphoney commented Sep 27, 2017

It looks like the configuration settings are not sticking:

 145:     def defaults
    146: binding.pry
    147:       settings.clear
    148:       self.with_filename = false
    149: binding.pry
 => 150:       self.fail_on_warnings = false
    151:       self.error_level = :all
    152:       self.log_format = ''
    153:       self.with_context = false
    154:       self.fix = false
    155:       self.json = false
    156:       self.show_ignored = false
    157:       self.ignore_paths = ['vendor/**/*.pp']
    158: binding.pry
    159:     end
[1] pry(#<PuppetLint::Configuration>)> self.with_filename
=> nil
[2] pry(#<PuppetLint::Configuration>)> self.with_filename = false
=> false

rtib added a commit to rtib/puppet-zookeeperd that referenced this issue Sep 27, 2017
@nmaludy
Copy link

nmaludy commented Sep 27, 2017

Workaround depending on how you're invoking it:

Rakefile

If you're running the task via rake you need to add the following to your Rakefile:

PuppetLint.configuration.error_level = :all
PuppetLint.configuration.log_format = '' 

puppet-lint

If you're running puppet-lint on the command line you need to pass in the following additional options:

puppet-lint --log-format '' --error-level all <path>

@tphoney
Copy link
Contributor

tphoney commented Sep 27, 2017

I am about to push a PR with a fix

@alexjfisher
Copy link
Contributor

git bisect says regression is in 6fa8111

@tphoney
Copy link
Contributor

tphoney commented Sep 27, 2017

@alexjfisher thats where the fix is

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

Successfully merging a pull request may close this issue.

6 participants