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

Crash when fixing ensure_first_param #938

Open
felixdoerre opened this issue Apr 5, 2021 · 1 comment
Open

Crash when fixing ensure_first_param #938

felixdoerre opened this issue Apr 5, 2021 · 1 comment

Comments

@felixdoerre
Copy link

felixdoerre commented Apr 5, 2021

Whoops! It looks like puppet-lint has encountered an error that it doesn't
know how to handle.


puppet-lint version: 2.4.2
ruby version: 2.5.5-p157
platform: x86_64-linux-gnu
file path: test.pp
file contents:

node 'test' {
  
  
  file{'/path':
    target =>'/target',
    ensure => link
  }
}

error:

NoMethodError: undefined method `next_token_of' for nil:NilClass
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/plugins/check_resources/ensure_first_param.rb:31:in `fix'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/checkplugin.rb:42:in `block in fix_problems'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/checkplugin.rb:38:in `each'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/checkplugin.rb:38:in `fix_problems'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/checks.rb:67:in `block in run'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/checks.rb:65:in `each'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/checks.rb:65:in `run'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint.rb:205:in `run'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/bin.rb:66:in `block in run'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/bin.rb:62:in `each'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/lib/puppet-lint/bin.rb:62:in `run'
/var/lib/gems/2.5.0/gems/puppet-lint-2.4.2/bin/puppet-lint:7:in `<top (required)>'
/usr/local/bin/puppet-lint:23:in `load'
/usr/local/bin/puppet-lint:23:in `<main>'

Please note the two lines with empty spaces in the beginning of the manifest. Without them the error does not occur.

@felixdoerre
Copy link
Author

Additionally, even without the two empty lines, puppet-lint fails to "--fix" the issue for ensure_first_param

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

No branches or pull requests

1 participant