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

Error in parameter yaml is very hard to track down #130

Open
andrewjhumphrey opened this issue Sep 26, 2016 · 2 comments
Open

Error in parameter yaml is very hard to track down #130

andrewjhumphrey opened this issue Sep 26, 2016 · 2 comments

Comments

@andrewjhumphrey
Copy link
Contributor

I had an error in a parameter YAML file:

ami:
  latest_ami:
    owners: <SNIP>
      filters:
        name: not-for-public-consumption-*

Note the extra spaces in front of the filters element.

The error that stack_master produces does not reference the file that cause it at all, making it somewhat of a pain to track down.

 sm apply us-west-2 not-for-public-consumption --trace
Executing apply on not-for-public-consumption  in us-west-2
/usr/local/var/rbenv/versions/2.2.4/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): mapping values are not allowed in this context at line 4 column 13 (Psych::SyntaxError)
    from /usr/local/var/rbenv/versions/2.2.4/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
    from /usr/local/var/rbenv/versions/2.2.4/lib/ruby/2.2.0/psych.rb:318:in `parse'
    from /usr/local/var/rbenv/versions/2.2.4/lib/ruby/2.2.0/psych.rb:245:in `load'

Would be nice if there was something in the trace that told you the file that went boom, to avoid having to manually call YAML.load_file on each yaml file in turn to find the culprit.

@simpsora
Copy link
Contributor

simpsora commented Jun 7, 2017

I'm also running into the same problem. In my case it was a very similar problem of incorrect indentation, but in stack_master.yml rather than a parameters file.

@rbayerl
Copy link
Contributor

rbayerl commented Apr 20, 2018

We run a style test suite that consists of rubocop (for Sparkleformation templates), flake8 (for Lambda code), and yamllint (for stack_master configuration and parameter files). Perhaps incorporating something similar in your workflow or CI would be more useful than adding a YAML linter to stack_master.

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

No branches or pull requests

4 participants