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

Syntax error causes 'Whoops!' #740

Closed
bitfield opened this issue Aug 29, 2017 · 1 comment · Fixed by #875
Closed

Syntax error causes 'Whoops!' #740

bitfield opened this issue Aug 29, 2017 · 1 comment · Fixed by #875

Comments

@bitfield
Copy link

As you can see, the hash of options to epp is not closed, and the Puppet parser reports:

Error: Could not parse for environment production: Syntax error at ')' at s3cfg.pp:17:5

puppet-lint says:

Whoops! It looks like puppet-lint has encountered an error that it doesn't
know how to handle. Please open an issue at https://github.com/rodjek/puppet-lint
and paste the following output into the issue description.

puppet-lint version: 2.2.1
ruby version: 2.4.1-p111
platform: x86_64-darwin15
file path: modules/profile/manifests/s3cfg.pp
file contents:

# Deploy S3 credentials
class profile::s3cfg {
  include repo::epel

  ensure_packages('s3cmd',
    {
      'ensure'  => 'installed',
      'require' => Class['repo::epel'],
    }
  )

  file { '/root/.s3cfg':
    content => epp('admin/s3cfg.epp',
      {
        'aws_access_key_id' => lookup('aws_access_key_id', String),
        'aws_secret_key'    => lookup('aws_secret_key', String),
    ),
    owner   => 'root',
  }
}

error:

NoMethodError: undefined method `next_token' for nil:NilClass
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/lexer/token.rb:180:in `find_token_of'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/lexer/token.rb:122:in `next_token_of'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/data.rb:115:in `block in resource_indexes'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/data.rb:111:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/data.rb:111:in `resource_indexes'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/checkplugin.rb:74:in `resource_indexes'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/plugins/check_conditionals.rb:7:in `check'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/checkplugin.rb:21:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/checks.rb:58:in `block in run'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/checks.rb:56:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/checks.rb:56:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint.rb:191:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/bin.rb:59:in `block in run'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/bin.rb:56:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/lib/puppet-lint/bin.rb:56:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/puppet-lint-2.2.1/bin/puppet-lint:7:in `<top (required)>'
/usr/local/bin/puppet-lint:22:in `load'
/usr/local/bin/puppet-lint:22:in `<main>'
@rnelson0
Copy link
Collaborator

@bitfield I suspect this does not pass puppet parser validate, but I am unable to verify on a computer. If that is the case, we have a goal to better handle this in v3.0. If it passes the validator, we can dig into it further. Please let us know if it passes, if you can.

@rodjek rodjek added the bug label Mar 26, 2018
@rodjek rodjek added this to the 2.3.5 milestone Mar 26, 2018
@rodjek rodjek modified the milestones: 2.3.6, 2.3.7 Jun 15, 2018
rodjek added a commit that referenced this issue Sep 25, 2019
Rather than throwing an unhandled exception.

Fixes #740
rodjek added a commit that referenced this issue Sep 25, 2019
Report syntax error on unbalanced braces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants