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

Show on which line an error occurred #16

Closed
jyaworski opened this issue May 9, 2016 · 9 comments
Closed

Show on which line an error occurred #16

jyaworski opened this issue May 9, 2016 · 9 comments

Comments

@jyaworski
Copy link

Using the git version, I get this very unhelpful message:

% bundle exec rake --trace yamllint                                                                           :(
** Invoke yamllint (first_time)
** Execute yamllint
Running YamlLint...
Checking 412 files
Excluding 1 files
hieradata/env/qa.yaml
  The same key is defined more than once: DEBUG
YAML lint found 1 errors
YamlLint failed!

Looking in the file, it's not immediately obvious where this occurs; I can't even find a key named debug. Any ideas?

@shortdudey123
Copy link
Owner

Can you update the the newest HEAD (i exposed the debug logging via the CLI now)

Then run bundle exec yamllint hieradata/env/qa.yaml -D
That should help you find something and if not, paste the output here (just keep in mind to sanitize it a bit since it will expose your file contents)

As far as line numbers go, i will need to look a bit more on the best way to do that

@jyaworski
Copy link
Author

Sure. Although it looks like I needed to actually specify 'pry' in my Gemfile:

% bundle exec yamllint hieradata/env/qa.yaml -D
bundler: failed to load command: yamllint 
LoadError: cannot load such file -- pry

Is it listed as a dependency?

Also, I see a metric ton of these:

[#<Psych::Nodes::Scalar:0x007faae31a5168 @value="api_version", @anchor=nil, @tag=nil, @plain=true, @quoted=false, @style
=1>, #<Psych::Nodes::Scalar:0x007faae31a5118 @value="1.0.0", @anchor=nil, @tag=nil, @plain=true, @quoted=false, @style=1>, #<Psych::Nodes::Scalar:0x007faae31a50c8 @value="rails_e
nv", @anchor=nil, @tag=nil, @plain=true, @quoted=false, @style=1>, #<Psych::Nodes::Scalar:0x007faae31a5078 @value="development", @anchor=nil, @tag=nil, @plain=true, @quoted=false
, @style=1>

Is that possibly what I'm after?

@jyaworski
Copy link
Author

Actually, I see here... but it's still not clear:

D, [2016-05-09T15:01:13.969073 #9348] DEBUG -- : add_value: "blah::redis_database", "DEBUG"
D, [2016-05-09T15:01:13.969080 #9348] DEBUG -- : Checking DEBUG for overlap
D, [2016-05-09T15:01:13.969100 #9348] DEBUG -- : Overlapping key DEBUG
D, [2016-05-09T15:01:13.969109 #9348] DEBUG -- : Scalar: blah::redis_database, key: false, last_key: ["DEBUG"]
D, [2016-05-09T15:01:13.969118 #9348] DEBUG -- : Scalar: 5, key: true, last_key: ["5"]

The YAML for that section has the following:

  bar::roles:          [web, worker]
  bar::log_level:      DEBUG
  bar::media_root:     /tmp/
  bar::rabbitmq_host:  *rabbitmq_host
  bar::db_host:        *db_host

  foo::log_level:      DEBUG
  foo::rabbitmq_host:  *rabbitmq_host

  blah::bind_address:    0.0.0.0:8080
  blah::log_level:       DEBUG
  blah::redis_database:  5

Does it not like aliases?

@shortdudey123
Copy link
Owner

I needed to actually specify 'pry' in my Gemfile:

Sorry about that! i will fix that

Does it not like aliases?

That is possible, i didn't test for that. Let me do some poking around. Might not like the :: but i doubt it (just a thought).

@shortdudey123
Copy link
Owner

With the following i get no errors with what is in HEAD

rabbitmq_host: &rabbitmq_host
  - testing
db_host: &db_host
  - 1234
bar::roles:          [web, worker]
bar::log_level:      DEBUG
bar::media_root:     /tmp/
bar::rabbitmq_host:  *rabbitmq_host
bar::db_host:        *db_host

foo::log_level:      DEBUG
foo::rabbitmq_host:  *rabbitmq_host

blah::bind_address:    0.0.0.0:8080
blah::log_level:       DEBUG
blah::redis_database:  5

@jyaworski
Copy link
Author

Strange. That's where the error is popping up in the debug output. I'd be interesting in that line numbering capability here, then.

In case it matters, this is running ruby 2.3.1.

@shortdudey123
Copy link
Owner

Will look at line numbering
Tried 2.3.1 w/ no errors

@jyaworski
Copy link
Author

Let me know if I can get you any more data.

@shortdudey123
Copy link
Owner

Looks like this may have actually been a problem with the alias and should be fixed by #36.

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

2 participants