chef-boneyard / push-jobs-cookbook

Development repository for Chef Cookbook push-jobs
https://supermarket.chef.io/cookbooks/push-jobs
Apache License 2.0
21 stars 43 forks source link

Can't install push-jobs-client on CentOS 6 #110

Closed izghitu closed 7 years ago

izghitu commented 7 years ago

Cookbook version

3.3.0

Chef-client version

12.17.44

Platform Details

CentOS 6.8 64bit

Scenario:

Trying to install and run push-jobs-client

Steps to Reproduce:

Run the push-jobs cookbook on the server and attempt to install push-jobs

Expected Result:

Expecting to install and run push-jobs client.

Actual Result:

The rpm installs but the runit files and symlinks in /etc/service/ and /etc/sv are not being created thus push-jobs-client fails to start:

     ESC[31mError executing action `start` on resource 'push_jobs_service_runit[push-jobs]'ESC[0m
     ================================================================================ESC[0m

 ESC[0m    Mixlib::ShellOut::ShellCommandFailedESC[0m
     ------------------------------------ESC[0m
     runit_service[opscode-push-jobs-client] (/var/chef/cache/cookbooks/push-jobs/resources/service_runit.rb line 72) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 100], but received '1'
 ESC[0m    ---- Begin output of /sbin/sv status /etc/service/opscode-push-jobs-client ----
 ESC[0m    STDOUT: fail: /etc/service/opscode-push-jobs-client: unable to change to service directory: file does not exist
 ESC[0m    STDERR:
 ESC[0m    ---- End output of /sbin/sv status /etc/service/opscode-push-jobs-client ----
 ESC[0m    Ran /sbin/sv status /etc/service/opscode-push-jobs-client returned 1ESC[0m

 ESC[0m    Cookbook Trace:ESC[0m
     ---------------ESC[0m
     /var/chef/cache/cookbooks/runit/libraries/helpers.rb:162:in `safe_sv_shellout'
 ESC[0m    /var/chef/cache/cookbooks/runit/libraries/helpers.rb:97:in `running?'
 ESC[0m    /var/chef/cache/cookbooks/runit/libraries/provider_runit_service.rb:343:in `block in <class:RunitService>'ESC[0m

 ESC[0m    Resource Declaration:ESC[0m
     ---------------------ESC[0m
     # In /var/chef/cache/cookbooks/push-jobs/recipes/service.rb
 ESC[0m
 ESC[0m     29:   push_jobs_service 'push-jobs' do
 ESC[0m     30:     action [:start, :enable]
 ESC[0m     31:     subscribes :restart, "template[#{PushJobsHelper.config_path}]"
 ESC[0m     32:   end
 ESC[0m     33: end
 ESC[0m
 ESC[0m    Compiled Resource:ESC[0m
     ------------------ESC[0m
     # Declared in /var/chef/cache/cookbooks/push-jobs/recipes/service.rb:29:in `from_file'
 ESC[0m
 ESC[0m    push_jobs_service_runit("push-jobs") do
 ESC[0m      action [:start, :enable]
 ESC[0m      retries 0
 ESC[0m      retry_delay 2
 ESC[0m      default_guard_interpreter :default
 ESC[0m      declared_type :push_jobs_service
 ESC[0m      cookbook_name "push-jobs"
 ESC[0m      recipe_name "service"
 ESC[0m    end
 ESC[0m
 ESC[0m    Platform:ESC[0m
     ---------ESC[0m
     x86_64-linuxESC[0m

 ESC[0mESC[0m
 Running handlers:ESC[0m
 [2017-01-14T00:18:58+11:00] ERROR: Running exception handlers
 Running handlers complete
 ESC[0m[2017-01-14T00:18:58+11:00] ERROR: Exception handlers complete
 Chef Client failed. 3 resources updated in 46 secondsESC[0m
biox commented 7 years ago

FWIW it looks like Debian 7 is having very similar problems: https://travis-ci.org/chef-cookbooks/push-jobs/jobs/187770811

izghitu commented 7 years ago

jessebolson, any luck fixing this?

Please let me know Thanks

biox commented 7 years ago

@izghitu No luck yet. I'm going to hold off on writing my own cookbook for now (until Chef responds), but if that isn't done soon I'll fork this for RHEL6/7 and let you know.

izghitu commented 7 years ago

@jessebolson still no luck?

iennae commented 7 years ago

Hey folks,

Apologies in the delay in responding to this issue. What version of push-jobs are you installing?

izghitu commented 7 years ago

@iennae it was latest version at that time, 2.something

biox commented 7 years ago

@iennae is there any testing that you need done? I'll be in the office soon and can get you whatever information would be helpful.

@izghitu sorry for the radio silence! I must have missed your response. I just whipped up a quick bash script that does the install, I can get that to you if you're still interested.

izghitu commented 7 years ago

@jessebolson yes, please, I am still interested. Thanks in advance

iennae commented 7 years ago

Any additional information would be helpful @jessebolson. I'm working on getting this working for folks and trying to understand what is broken. There was a missing version attribute for travis which is why the build was failing before.

biox commented 7 years ago

@izghitu @iennae

This is all that I had to do to get this working. I am using the latest version of push-jobs. It looks like there is some weird directory munging going on.

#!/bin/bash

mkdir /etc/sv
mkdir /etc/service

ln -s /etc/sv/chef-push-jobs-client/ /etc/sv/opscode-push-jobs-client
ln -s /etc/service/chef-push-jobs-client /etc/service/opscode-push-jobs-client

chef-client -o push-jobs
iennae commented 7 years ago

Please take a look at version 5.0.0 of this cookbook. I've added a new sysvinit resource. The init script needs additional polishing but this should get push jobs installed on centos 6.

izghitu commented 7 years ago

@jessebolson @iennae sorry for the delays, I was no longer able to reproduce the same results and am getting this instead:

54.68.234.9     ================================================================================
54.68.234.9     Error executing action `start` on resource 'push_jobs_service_runit[push-jobs]'
54.68.234.9     ================================================================================
54.68.234.9
54.68.234.9     RuntimeError
54.68.234.9     ------------
54.68.234.9     No info for version '2.2.0'
54.68.234.9
54.68.234.9     Cookbook Trace:
54.68.234.9     ---------------
54.68.234.9     /var/chef/cache/cookbooks/push-jobs/libraries/helpers.rb:55:in `family_by_version'
54.68.234.9     /var/chef/cache/cookbooks/push-jobs/libraries/helpers.rb:43:in `names_by_version'
54.68.234.9     /var/chef/cache/cookbooks/push-jobs/libraries/helpers.rb:69:in `linux_install_path'
54.68.234.9     /var/chef/cache/cookbooks/push-jobs/libraries/helpers.rb:137:in `cli_command'
54.68.234.9     /var/chef/cache/cookbooks/push-jobs/resources/service_runit.rb:88:in `block in create_init'
54.68.234.9     /var/chef/cache/cookbooks/push-jobs/resources/service_runit.rb:87:in `create_init'
54.68.234.9     /var/chef/cache/cookbooks/push-jobs/resources/service_runit.rb:26:in `block in class_from_file'
54.68.234.9
54.68.234.9     Resource Declaration:
54.68.234.9     ---------------------
54.68.234.9     # In /var/chef/cache/cookbooks/push-jobs/recipes/service.rb
54.68.234.9
54.68.234.9      29:   push_jobs_service 'push-jobs' do
54.68.234.9      30:     action [:start, :enable]
54.68.234.9      31:     subscribes :restart, "template[#{PushJobsHelper.config_path}]"
54.68.234.9      32:   end
54.68.234.9      33: end
54.68.234.9
54.68.234.9     Compiled Resource:
54.68.234.9     ------------------
54.68.234.9     # Declared in /var/chef/cache/cookbooks/push-jobs/recipes/service.rb:29:in `from_file'
54.68.234.9
54.68.234.9     push_jobs_service_runit("push-jobs") do
54.68.234.9       action [:start, :enable]
54.68.234.9       retries 0
54.68.234.9       retry_delay 2
54.68.234.9       default_guard_interpreter :default
54.68.234.9       declared_type :push_jobs_service
54.68.234.9       cookbook_name "push-jobs"
54.68.234.9       recipe_name "service"
54.68.234.9     end
54.68.234.9
54.68.234.9     Platform:
54.68.234.9     ---------
54.68.234.9     x86_64-linux

I then updated all the cookbooks to the latest and still getting same error.

iennae commented 7 years ago

@izghitu I haven't touched the runit aspect of this cookbook. Can you provide more information about how you are using the cookbook? By default it should be using the sysvinit resource.

izghitu commented 7 years ago

@iennae by default it always used runit for me.

I just use this in my cookbook: include_recipe 'push-jobs'

It then automatically tries to install runit, it has always done so and it was always working. It stopped working starting with the 3.3.0 version of the push-jobs cookbook.

biox commented 7 years ago

^ same issue here, CentOS/6 resolves to runit.

dheerajd-msys commented 7 years ago

Please use push-jobs cookbook version 5.1.1. Issue is fixed in https://github.com/chef-cookbooks/push-jobs/pull/124

cheeseplus commented 7 years ago

Fixed as stated above, if not we can open a new issue.