edelight/chef-solo-search

warning: already initialized constant Lucene::SEP

NikolayMurha opened this issue · 10 comments

Hello.

I have warning:

  /tmp/vagrant-chef-3/chef-solo-1/cookbooks/chef-solo-search/libraries/vendor/chef/solr_query/lucene_nodes.rb:22: warning: already initialized constant Lucene::SEP`

Chef 12.0.3

*** Chef 12.0.3 ***
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/chef-solo-search/libraries/vendor/chef/solr_query/lucene_nodes.rb:22: warning: already initialized constant Lucene::SEP
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/chef-solo-search/libraries/vendor/chef/solr_query/lucene_nodes.rb:22: warning: previous definition of SEP was here

as far as I know -- chef 12 in local mode has search without needing chef-solo-search.

Part of upgrading to --local-mode instead of chef-solo should be migrating away from chef-solo-search.

have not used --local-mode but that's my understanding

see:
https://www.chef.io/blog/2014/06/24/from-solo-to-zero-migrating-to-chef-client-local-mode/

I am trying to track this down as well. Using in conjunction with the user cookbook. With chef 12 it seems to be including the library twice...

curious about why anyone would use chef-solo with chef 12?

Rud5G commented

@michaelglass @sigil66 i make use of the https://supermarket.chef.io/cookbooks/users cookbook which will only present a warning when using chef-solo without chef-solo-search.
Although i use chef-zero, the config value "Chef::Config[:solo]" is set to true.

"Local mode behaves exactly like Chef Solo except that, during a run, it starts up a local Chef Zero server bound to localhost, uploads all local cookbooks & recipes to it, runs Chef Client, and then terminates the Chef Zero server. The end user experience is identical to Solo."

I see no reason to bother starting a chef server, local or remote, when our chef code is distributed with packages. I really only use the search for the users cookbook.

@sigil66 fwiw, this repo is mostly unmaintained now that chef zero supports search

Understood. I just pulled it down internally and:

SEP ||= "="

Because after an hour of digging I still couldn't figure out why 'search/parser' was being loaded twice...

I'm having same issue as @Rud5G. I use chef_zero but Chef::Config[:solo] is true. And the users mdoule basically forces us to use this cookbook. @Rud5G did you find a work around for this issue?

@Rud5G part of this is a vagrant issue, see: hashicorp/vagrant#5619

Once that get's fix then I think we wont need to use this cookbook to make users work.