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

Runit support not working #156

Open
bilby91 opened this issue May 9, 2019 · 1 comment
Open

Runit support not working #156

bilby91 opened this issue May 9, 2019 · 1 comment
Labels
Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event

Comments

@bilby91
Copy link

bilby91 commented May 9, 2019

Brief Description

When trying to install Kafka and operate it using runit chef-client crashes.

Cookbook version

2.2.2

Chef-client version

14.12.9

Platform Details

cloud=aws
chef_version=14.12.9
platform=ubuntu
platform_version=18.04
ruby=ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

Scenario

When trying to install Kafka and operate it using runit using the following attributes:

{
  "environment": "dev-us-east-1",
  "run_list": [
    "recipe[java]",
    "recipe[runit]",
    "recipe[kafka]"
  ],
  "normal": {
    "kafka": {
      "version": "0.8.2.2",
      "checksum": "6e75bb0e0438960aa668d0f9d570009647e457d74c377e4bbc508cec43ecf639",
      "init_style": "runit"
    }
  }
}

Steps to Reproduce

Use the above configuration

Expected Result

Install the recipe correctly and have kafka managed by runit.

Actual Result

Chef-client crashes with the following error:

================================================================================
Recipe Compile Error in /home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/default.rb
================================================================================

TypeError
---------
no implicit conversion of nil into String

Cookbook Trace:
---------------
  /home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/_service.rb:6:in `from_file'
  /home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/default.rb:10:in `from_file'

Relevant File Content:
----------------------
/home/ubuntu/chef-solo/local-mode-cache/cache/cookbooks/kafka/recipes/_service.rb:

  1:  #
  2:  # Cookbook Name:: kafka
  3:  # Recipe:: _service
  4:  #
  5:
  6>> template kafka_init_opts[:env_path] do
  7:    source 'env.erb'
  8:    owner 'root'
  9:    group 'root'
 10:    mode '644'
 11:    helpers(Kafka::EnvFile)
 12:    if restart_on_configuration_change?
 13:      notifies :create, 'ruby_block[coordinate-kafka-start]', :immediately
 14:    end
 15:  end

The following init options don't contemplate runit but I found several places in the code base that reference runit support.

https://github.com/sous-chefs/kafka/blob/master/libraries/helpers.rb#L23

@MarkGibbons
Copy link
Member

Need a when :runit section in libraries/helper.rb::kafka_init_opts.

@ramereth ramereth added Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event labels Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event
Projects
None yet
Development

No branches or pull requests

3 participants