Project

General

Profile

Actions

Bug #14729

closed

Parser cache can't load Puppet::* validation functions when reading cache

Added by Dominic Cleal over 8 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When using the parser cache from #14447 with kafo_parsers 0.1.0 (no hard dependency on Puppet, #14448), the parser cache can't be deserialised as it contains references to Puppet::* classes.

/home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/bin/kafo-export-params -c config/foreman.yaml -f parsercache --no-parser-cache -o /home/dcleal/code/foreman/foreman-installer-librarian/_build/parser_cache/foreman.yaml
/home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/bin/kafo-export-params -c config/foreman.yaml -f asciidoc -o /home/dcleal/code/foreman/foreman-installer-librarian/_build/options.asciidoc
/home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:334:in `path2class': undefined class/module Puppet:: (ArgumentError)
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:334:in `resolve_class'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:178:in `visit_Psych_Nodes_Mapping'
...
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych/nodes/node.rb:35:in `to_ruby'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:130:in `load'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/lib/kafo/parser_cache_reader.rb:14:in `new_from_file'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/lib/kafo/configuration.rb:263:in `parser_cache'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/lib/kafo/puppet_module.rb:31:in `initialize'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `new'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `block in modules'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `map'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/lib/kafo/configuration.rb:89:in `modules'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/bin/kafo-export-params:104:in `print_out'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/bin/kafo-export-params:51:in `execute'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/gems/kafo-0.7.3/bin/kafo-export-params:155:in `<top (required)>'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/bin/kafo-export-params:23:in `load'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/bin/kafo-export-params:23:in `<main>'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/bin/ruby_noexec_wrapper:14:in `eval'
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman-installer/bin/ruby_noexec_wrapper:14:in `<main>'
rake aborted!

The issue will affect kafo 0.7.3 with kafo_parsers 0.1.0 when the cache is enabled, but using kafo_parsers 0.0.6 works around the issue as Puppet gets required due to the dependency in the gemspec.

#14450 in Kafo 0.8 should also make this issue obsolete, since I intend to remove the Puppet classes entirely from the cache.


Related issues 1 (0 open1 closed)

Blocks Installer - Feature #14453: Generate Kafo parser cache during buildClosedDominic Cleal04/04/2016Actions
Actions #1

Updated by Dominic Cleal over 8 years ago

  • Blocks Feature #14453: Generate Kafo parser cache during build added
Actions #2

Updated by Dominic Cleal over 8 years ago

  • Status changed from New to Rejected

Using kafo 0.7.x and kafo_parsers 0.0.x, or the new kafo 0.8.x and kafo_parsers 0.1.x fixes the issue.

Actions

Also available in: Atom PDF