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

Install push-jobs client failed: packagecloud_repo[imeyer/runit] (runit::default line 36) had an error #100

Closed yanxinyuan closed 8 years ago

yanxinyuan commented 8 years ago

Cookbook version

runit (3.0.0)

Chef-client version

Chef: 12.13.37

Platform Details

Centos 6

Scenario:

After i upload the push-jobs cookbook to my server, and when i use chef-client command to configure the node, it occurs below error. As i know it's a network issue, but this is a network policy of my company, I can access the packagecloud.io by web, but not with ping, do you have any way to avoid this error ?


Recipe: yum-epel::default * yum_repository[epel] action create * template[/etc/yum.repos.d/epel.repo] action create (up to date) * execute[yum clean metadata epel] action nothing (skipped due to action :nothing) * execute[yum-makecache-epel] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-epel] action nothing (skipped due to action :nothing) (up to date) Recipe: runit::default * packagecloud_repo[imeyer/runit] action add

  ================================================================================
  Error executing action `add` on resource 'packagecloud_repo[imeyer/runit]'
  ================================================================================

  Errno::ENETUNREACH
  ------------------
  Network is unreachable - connect(2) for "packagecloud.io" port 443

Steps to Reproduce:

Expected Result:

install push-jobs successfully.

Actual Result:

failed with the whole error. [root@delta opt]# chef-client Starting Chef Client, version 12.13.37 resolving cookbooks for run list: ["push-jobs"] Synchronizing Cookbooks:

* chef_gem[mixlib-install] action install (up to date)
* ruby_block[stop chef run] action nothing (skipped due to action :nothing)
* yum_package[push-jobs-client] action install (up to date)
 (up to date)

Recipe: push-jobs::config

* service[runit] action nothing (skipped due to action :nothing)
* execute[start-runsvdir] action nothing (skipped due to action :nothing)

Recipe: yum-epel::default * yum_repository[epel] action create * template[/etc/yum.repos.d/epel.repo] action create (up to date) * execute[yum clean metadata epel] action nothing (skipped due to action :nothing) * execute[yum-makecache-epel] action nothing (skipped due to action :nothing) * ruby_block[yum-cache-reload-epel] action nothing (skipped due to action :nothing) (up to date) Recipe: runit::default * packagecloud_repo[imeyer/runit] action add

  ================================================================================
  Error executing action `add` on resource 'packagecloud_repo[imeyer/runit]'
  ================================================================================

  Errno::ENETUNREACH
  ------------------
  Network is unreachable - connect(2) for "packagecloud.io" port 443

  Cookbook Trace:
  ---------------
  /var/chef/cache/cookbooks/packagecloud/libraries/helper.rb:14:in `get'
  /var/chef/cache/cookbooks/packagecloud/providers/repo.rb:80:in `install_rpm'
  /var/chef/cache/cookbooks/packagecloud/providers/repo.rb:12:in `block in class_from_file'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:133:in `compile_and_converge_action'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
  /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

  Resource Declaration:
  ---------------------
  # In /var/chef/cache/cookbooks/runit/recipes/default.rb

   36:     packagecloud_repo 'imeyer/runit' do
   37:       force_os 'rhel' if node['platform'].eql?('oracle')
   38:     end
   39:   end

  Compiled Resource:
  ------------------
  # Declared in /var/chef/cache/cookbooks/runit/recipes/default.rb:36:in `from_file'

  packagecloud_repo("imeyer/runit") do
    action [:add]
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    declared_type :packagecloud_repo
    cookbook_name "runit"
    recipe_name "default"
    type "rpm"
    base_url "https://packagecloud.io"
    repository "imeyer/runit"
  end

  Platform:
  ---------
  x86_64-linux

================================================================================
Error executing action `start` on resource 'push_jobs_service_runit[push-jobs]'
================================================================================

Errno::ENETUNREACH
------------------
packagecloud_repo[imeyer/runit] (runit::default line 36) had an error: Errno::ENETUNREACH: Network is unreachable - connect(2) for "packagecloud.io" port 443

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/packagecloud/libraries/helper.rb:14:in `get'
/var/chef/cache/cookbooks/packagecloud/providers/repo.rb:80:in `install_rpm'
/var/chef/cache/cookbooks/packagecloud/providers/repo.rb:12:in `block in class_from_file'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:133:in `compile_and_converge_action'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/push-jobs/recipes/service.rb

 29:   push_jobs_service 'push-jobs' do
 30:     action [:start, :enable]
 31:     subscribes :restart, "template[#{PushJobsHelper.config_path}]"
 32:   end
 33: end

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/push-jobs/recipes/service.rb:29:in `from_file'

push_jobs_service_runit("push-jobs") do
  action [:start, :enable]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  declared_type :push_jobs_service
  cookbook_name "push-jobs"
  recipe_name "service"
end

Platform:
---------
x86_64-linux

Running handlers: [2016-09-27T18:54:54+08:00] ERROR: Running exception handlers Running handlers complete [2016-09-27T18:54:54+08:00] ERROR: Exception handlers complete Chef Client failed. 0 resources updated in 09 seconds [2016-09-27T18:54:55+08:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2016-09-27T18:54:55+08:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2016-09-27T18:54:55+08:00] ERROR: push_jobs_service_runit[push-jobs](push-jobs::service line 29) had an error: Errno::ENETUNREACH: packagecloud_repo[imeyer/runit](runit::default line 36) had an error: Errno::ENETUNREACH: Network is unreachable - connect(2) for "packagecloud.io" port 443 [2016-09-27T18:54:55+08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

vinyar commented 8 years ago

+1 This will also lead to failures in all air-gapped and vpc environments w/o access to internet or doing some odd routing gymnastics.

yanxinyuan commented 8 years ago

Finally, after i changing the routing policy of my machine by adding packagecloud.io(50.97.198.58) to our router, this issue has been avoided.