GithubHelp home page GithubHelp logo

chef-boneyard / push-jobs-cookbook Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 43.0 419 KB

Development repository for Chef Cookbook push-jobs

Home Page: https://supermarket.chef.io/cookbooks/push-jobs

License: Apache License 2.0

Ruby 92.63% Shell 4.83% HTML 2.54%
chef cookbook hacktoberfest push

push-jobs-cookbook's Issues

Rollback of MSI can occur on Windows even if the service is already installed

Cookbook version

3.2.2

Chef-client version

12.16.42

Platform Details

Windows Server 2012 R2 (mixture of on-prem and Azure)

Scenario:

If the service is already installed, leaving the job in the runlist should present no issue: nothing should happen. 99% of the time, this is true.

But, occasionally it seems possible for the MSI to hit a 1603, for unknown reasons (I'm assuming this may be caused by pending installs/updates happening elsewhere on the system at the time the job runs?)

Mixlib::ShellOut::ShellCommandFailed: chef_ingredient[push-jobs-client] (push-jobs::package line 44) had an error: Mixlib::ShellOut::ShellCommandFailed: windows_package[push-jobs-client] 

(c:/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1603' 

---- Begin output of msiexec /qn /i "c:\chef\cache\push-jobs-client-2.1.4-1-x86.msi" 
---- STDOUT: STDERR: 
---- End output of msiexec /qn /i "c:\chef\cache\push-jobs-client-2.1.4-1-x86.msi" 
---- Ran msiexec /qn /i "c:\chef\cache\push-jobs-client-2.1.4-1-x86.msi" returned 1603> 
had an error:
chef_ingredient[push-jobs-client] (push-jobs::package line 44) 
had an error:
 Mixlib::ShellOut::ShellCommandFailed: windows_package[push-jobs-client] (c:/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb line 51) 
had an error: 
Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1603' 
---- Begin output of msiexec /qn /i "c:\chef\cache\push-jobs-client-2.1.4-1-x86.msi" 
---- STDOUT: STDERR: 
---- End output of msiexec /qn /i "c:\chef\cache\push-jobs-client-2.1.4-1-x86.msi" 
---- Ran msiexec /qn /i "c:\chef\cache\push-jobs-client-2.1.4-1-x86.msi" returned 1603

it seems as though hitting this error actually causes the entire package to rollback, and it uninstalls the service entirely - which is needless to say, not very helpful

Steps to Reproduce:

I don't have a definitive method of producing 1603 - but create some kind of MSI error, and you can get rollbacks

Expected Result:

Failure of the install step without rollback if the service is already installed.

Should there be a more resilient 'is this already installed' check before the MSI is kicked off? (So MSI is not even invoked if it is present)

Actual Result:

Install was rolled back unexpectedly

ERROR: undefined method `compile_time' for Chef::Resource::ChefGem

I am having issues with running the push-jobs [2.4.2] cookbook on my Ubuntu 14.04.

attributes/default.rb unchanged, still contains:

default['push_jobs']['package_url'] = nil
default['push_jobs']['package_checksum'] = ''"

Tried going to previous versions of the push-jobs cookbooks, but no success there. Looked for similar issues on the web, but couldn't find anything useful. Don't know what to try next.

Output of the chef-client run (on a node with: "Run List: recipe[push-jobs]"):

root@head:/chef-repo/cookbooks# chef-client
Starting Chef Client, version 12.0.3
resolving cookbooks for run list: ["push-jobs"]
Synchronizing Cookbooks:

  • runit

  • packagecloud

  • push-jobs

  • windows

  • chef_handler

  • chef-ingredient

  • apt-chef

  • apt

  • yum-chef

  • yum
    Compiling Cookbooks...
    Converging 9 resources
    Recipe: push-jobs::linux

  • chef_ingredient[push-client] action install

    Error executing action install on resource 'chef_ingredient[push-client]'

    NoMethodError

    undefined method `compile_time' for Chef::Resource::ChefGem

    Cookbook Trace:

    /var/chef/cache/cookbooks/chef-ingredient/libraries/helpers.rb:61:in block in install_mixlib_versioning' /var/chef/cache/cookbooks/chef-ingredient/libraries/helpers.rb:59:ininstall_mixlib_versioning'
    /var/chef/cache/cookbooks/chef-ingredient/libraries/chef_ingredient_provider.rb:38:in `block in class:ChefIngredient'

    Resource Declaration:

    In /var/chef/cache/cookbooks/push-jobs/recipes/linux.rb

    41: chef_ingredient 'push-client' do
    42: version node['push_jobs']['package_version']
    43: package_source "#{Chef::Config[:file_cache_path]}/#{package_file}" if package_url
    44: end
    45:

    Compiled Resource:

    Declared in /var/chef/cache/cookbooks/push-jobs/recipes/linux.rb:41:in `from_file'

    chef_ingredient("push-client") do
    action :install
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    declared_type :chef_ingredient
    cookbook_name "push-jobs"
    recipe_name "linux"
    version :latest
    product_name "push-client"
    end

Running handlers:
[2015-09-18T19:16:43-05:00] ERROR: Running exception handlers
Running handlers complete
[2015-09-18T19:16:43-05:00] ERROR: Exception handlers complete
[2015-09-18T19:16:43-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 1.998163944 seconds
[2015-09-18T19:16:43-05:00] ERROR: chef_ingredient[push-client](push-jobs::linux line 41) had an error: NoMethodError: undefined method `compile_time' for Chef::Resource::ChefGem
[2015-09-18T19:16:43-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Getting Below error while installing push-jobs cookbook on node -- OS is redhat

[2015-12-24T03:45:25-05:00] INFO: ['push_jobs']['package_url'] and ['push_jobs']['package_checksum'] not set. Chef Push client will be installed from CHEF's public repositories.
Converging 10 resources
Recipe: push-jobs::linux
  * chef_ingredient[push-client] action install[2015-12-24T03:45:25-05:00] INFO: Processing chef_ingredient[push-client] action install (push-jobs::linux line 47)

  Recipe: <Dynamically Defined Resource>
    * chef_gem[mixlib-install] action install[2015-12-24T03:45:25-05:00] INFO: Processing chef_gem[mixlib-install] action install (dynamically defined)
WARN: Unresolved specs during Gem::Specification.reset:
      httpclient (>= 2.2.0.2, ~> 2.2)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
 (up to date)

    ================================================================================
    Error executing action `install` on resource 'chef_ingredient[push-client]'
    ================================================================================

    LoadError
    ---------
    cannot load such file -- mixlib/install/product

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/chef-ingredient/libraries/helpers.rb:86:in `ensure_mixlib_install_gem_installed!'
    /var/chef/cache/cookbooks/chef-ingredient/libraries/helpers.rb:39:in `ingredient_package_name'
    /var/chef/cache/cookbooks/chef-ingredient/libraries/rhel_handler.rb:67:in `block in configure_package'
    /var/chef/cache/cookbooks/chef-ingredient/libraries/rhel_handler.rb:65:in `configure_package'
    /var/chef/cache/cookbooks/chef-ingredient/libraries/rhel_handler.rb:21:in `handle_install'
    /var/chef/cache/cookbooks/chef-ingredient/libraries/chef_ingredient_provider.rb:54:in `block in <class:ChefIngredient>'

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

     47: chef_ingredient 'push-client' do
     48:   version package_version || node['push_jobs']['package_version']
     49:   package_source "#{Chef::Config[:file_cache_path]}/#{package_file}" if package_url
     50: end
     51:

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

    chef_ingredient("push-client") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :chef_ingredient
      cookbook_name "push-jobs"
      recipe_name "linux"
      product_name "push-client"
    end

[2015-12-24T03:45:26-05:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2015-12-24T03:45:26-05:00] ERROR: Running exception handlers
Running handlers complete
[2015-12-24T03:45:26-05:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 02 seconds
[2015-12-24T03:45:26-05:00] INFO: Sending resource update report (run-id: 9ca8ca9a-95f9-4c95-84ec-ac6b1c08f359)
[2015-12-24T03:45:26-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-12-24T03:45:26-05:00] ERROR: chef_ingredient[push-client] (push-jobs::linux line 47) had an error: LoadError: cannot load such file -- mixlib/install/product
[2015-12-24T03:45:26-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Incorrect checksum on downloads.chef.io

Issue
On https://downloads.chef.io/push-jobs-client/windows/ the checksum is a SHA1, but the push-job cookbook is expecting a SHA256 checksum (see below attributes) and will fail with the provided SHA1.

node.default['push_jobs']['package_url'] = "http://www.example.com/pkgs/opscode-push-jobs-client-windows-1.1.5-1.windows.msi"
node.default['push_jobs']['package_checksum'] = "a-sha256-checksum"

Fix
Download the package to local machine and generate a SHA256 checksum and use the generated SHA256 for the node.default['push_jobs']['package_checksum'] attibute.

remove resource cloning

Right now the cookbook blindly tries to redeclare /etc/chef, causing resource cloning warnings:

[2013-12-07T05:31:58+00:00] WARN: Cloning resource attributes for directory[/etc/chef] from prior resource (CHEF-3694)
[2013-12-07T05:31:58+00:00] WARN: Previous directory[/etc/chef]: /var/chef/cache/cookbooks/chef-client/libraries/helpers.rb:77:in `block in create_directories'
[2013-12-07T05:31:58+00:00] WARN: Current  directory[/etc/chef]: /var/chef/cache/cookbooks/push-jobs/recipes/linux.rb:83:in `from_file'

It should instead not even add this to the resource collection by checking if the directory already exists before declaring a resource.

Error loading PathHelper

When trying to start opscode-push-jobs-client, I receive the following error:

2015-07-13_02:14:31.19847 [2015-07-13T02:14:31+00:00] FATAL: Configuration error NameError: uninitialized constant Class::PathHelper
2015-07-13_02:14:31.19859 [2015-07-13T02:14:31+00:00] FATAL: /etc/chef/push-jobs-client.rb:7:in `from_string'
2015-07-13_02:14:31.19864 [2015-07-13T02:14:31+00:00] FATAL: Aborting due to error in '/etc/chef/push-jobs-client.rb'

Running CentOS 6.6 x86_64, chef-12.4.1-1.el6.x86_64, opscode-push-jobs-client-1.1.5-1.el6.x86_64

Everything else appears to work fine after reverting back to the previous version of the push-jobs-client.rb.erb template that does not use PathHelper.

push jobs fail with ArgumentError: invalid byte sequence in US-ASCII

Currently due to no encoding set on the chef config if there are cookbooks involved with data non ASCII format the push job fails.
It will be nice to allow support for push-jobs cookbook to allow ENV variable setting so that we can set LC_ALL as per https://tickets.opscode.com/browse/CHEF-3304

There are copule of ways we can do it and based on which way we would like to resolve it I will submit PR

  • We can allow configuration with key and value pairs for any environment variables and then set in the push-jobs-client.rb.erb template
  • We can allow configuration for cookbook name for push-jobs-client.rb.erb template so that any consumer can write their own configuration in the wrapper cookbook and use that config for deploy

Any other options are welcome as well.

push-jobs 2.6.1 cookbook fails

I gave the push-jobs cookbook version 2.6.1 a try on CentOS 6.6 with no override attributes and it failed with this error:

Recipe: push-jobs::service_runit
  * runit_service[opscode-push-jobs-client] action enable
    * directory[/etc/sv/opscode-push-jobs-client] action create (up to date)
    * template[/etc/sv/opscode-push-jobs-client/run] action create

      ================================================================================
      Error executing action `create` on resource 'template[/etc/sv/opscode-push-jobs-client/run]'
      ================================================================================

      Chef::Mixin::Template::TemplateError
      ------------------------------------
      757: unexpected token at 'opt/push-jobs-client'

      Cookbook Trace:
      ---------------
      /var/chef/cache/cookbooks/runit/libraries/provider_runit_service.rb:258:in `block in <class:RunitService>'

      Resource Declaration:
      ---------------------
      # In /var/chef/cache/cookbooks/runit/libraries/provider_runit_service.rb

       64:           template "#{sv_dir_name}/run" do
       65:             owner new_resource.owner
       66:             group new_resource.group
       67:             source "sv-#{new_resource.run_template_name}-run.erb"
       68:             cookbook template_cookbook
       69:             mode '0755'
       70:             variables(options: new_resource.options)
       71:             action :create
       72:           end
       73:

      Compiled Resource:
      ------------------
      # Declared in /var/chef/cache/cookbooks/runit/libraries/provider_runit_service.rb:64:in `block in <class:RunitService>'

      template("/etc/sv/opscode-push-jobs-client/run") do
        action [:create]
        retries 0
        retry_delay 2
        default_guard_interpreter :default
        path "/etc/sv/opscode-push-jobs-client/run"
        backup 5
        atomic_update true
        source "sv-opscode-push-jobs-client-run.erb"
        cookbook "push-jobs"
        variables {:options=>{"logging_level"=>"info", "node"=>{"push_jobs"=>{"package_url"=>nil, "package_checksum"=>"", "package_version"=>nil, "gem_url"=>nil, "gem_checksum"=>"", "config"=>{"template_cookbook"=>nil}, "whitelist"=>{"chef-client"=>"chef-client"}, "environment_variables"=>{"LC_ALL"=>"en_US.UTF-8"}, "chef"=>{"verify_api_cert"=>true, "ssl_verify_mode"=>:verify_peer, "chef_server_url"=>nil, "node_name"=>nil, "client_key_path"=>"/etc/chef/client.pem", "trusted_certs_path"=>"/etc/chef/trusted_certs", "install_path"=>nil, "exec_name"=>nil}, "service_string"=>"runit_service[push-jobs-client]", "init_style"=>"runit", "logging_level"=>"info"}}, "config"=>"/etc/chef/push-jobs-client.rb"}}
        declared_type :template
        cookbook_name "push-jobs"
        mode "0755"
      end

      Template Context:
      -----------------
      on line #3
        1: #!/bin/sh
        2: exec 2>&1
        3: exec <%= PushJobsHelper.linux_install_path(@options['node']) %>/bin/<%= PushJobsHelper.linux_exec_name(@options['node']) %> -l <%= @options['logging_level'] %> <% if @options['config'] -%> -c <%= @options['config'] %> <% end -%>

Version 2.4.2 of the cookbook works. The breaking change looks to be caused by the refactoring between tags v2.4.2 and v2.5.0

No resource or method named `action_start' for `Chef::Provider::RunitService ""'

i've tested it with chef server 12 on centos6.4 target node
an error occurs like below

any idea?

================================================================================
    Error executing action `start` on resource 'runit_service[opscode-push-jobs-client]'
    ================================================================================

    NoMethodError
    -------------
    No resource or method named `action_start' for `Chef::Provider::RunitService ""'

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

     23: runit_service 'opscode-push-jobs-client' do
     24:   default_logger true
     25:   subscribes :restart, "template[#{PushJobsHelper.config_path}]"
     26:   action [ :enable, :start ]
     27:   retries 15
     28: end

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

    runit_service("opscode-push-jobs-client") do
      provider Chef::Provider::RunitService
      action [:enable, :start]
      supports {:restart=>true, :reload=>true, :status=>true}
      retries 15
      retry_delay 2
      default_guard_interpreter :default
      service_name "opscode-push-jobs-client"
      pattern "opscode-push-jobs-client"
      status_command "/sbin/sv status /etc/service"
      sv_bin "/sbin/sv"
      sv_dir "/etc/sv"
      service_dir "/etc/service"
      lsb_init_dir "/etc/init.d"
      log true
      default_logger true
      restart_on_update true
      run_template_name "opscode-push-jobs-client"
      log_template_name "opscode-push-jobs-client"
      check_script_template_name "opscode-push-jobs-client"
      finish_script_template_name "opscode-push-jobs-client"
      sv_templates true
      service_mirror # Declared in 

    service("opscode-push-jobs-client") do
      provider Chef::Provider::Service::Simple
      action [:nothing]
      supports {:restart=>true, :reload=>true, :status=>true}
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      service_name "opscode-push-jobs-client"
      pattern "opscode-push-jobs-client"
      start_command "/sbin/sv start /etc/service/opscode-push-jobs-client"
      stop_command "/sbin/sv stop /etc/service/opscode-push-jobs-client"
      status_command "/sbin/sv status /etc/service/opscode-push-jobs-client"
      restart_command "/sbin/sv restart /etc/service/opscode-push-jobs-client"
    end

      declared_type :runit_service
      cookbook_name "push-jobs"
      recipe_name "service_runit"
    end


Running handlers:
[2015-04-26T20:37:41+09:00] ERROR: Running exception handlers
Running handlers complete
[2015-04-26T20:37:41+09:00] ERROR: Exception handlers complete
[2015-04-26T20:37:41+09:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 49.894274813 seconds
[2015-04-26T20:37:41+09:00] ERROR: runit_service[opscode-push-jobs-client] (push-jobs::service_runit line 23) had an error: NoMethodError: No resource or method named `action_start' for `Chef::Provider::RunitService ""'
[2015-04-26T20:37:41+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Push Jobs Server return error 400 when clients trying to get configs from server

Just installed Open Source Chef 12.1.2 and latest Push Jobs Server on CentOS 6.5 with latest clients on some Windows and CentOS 6.5 nodes. On each node I'm getting this output when I try to run pushy-client (suppose, problem like this present when I trying to start client as service):

[root@mynode chef]# /opt/opscode-push-jobs-client/embedded/bin/ruby /opt/opscode-push-jobs-client/bin/pushy-client -c /etc/chef/push-jobs-client.rb
INFO: [mynode] Using node name: jenkinsslavecentos2
INFO: [mynode] Using Chef server: https://mychef/organizations/myorg
INFO: [mynode] Using private key: /etc/chef/client.pem
INFO: [mynode] Using org name: myorg
INFO: [mynode] Incarnation ID: 79d53f1d-e9e6-4211-bc76-887851215a5b
INFO: [mynode] Starting client ...
INFO: [mynode] Retrieving configuration from https://mychef/organizations/virtu/pushy/config/jenkinsslavecentos2 ...
INFO: HTTP Request Returned 400 Bad Request: error
/opt/opscode-push-jobs-client/embedded/lib/ruby/1.9.1/net/http.rb:2633:in `error!': 400 "Bad Request" (Net::HTTPServerException)
        from /opt/opscode-push-jobs-client/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:143:in `request'
        from /opt/opscode-push-jobs-client/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/rest.rb:115:in `get'
        from /opt/opscode-push-jobs-client/embedded/lib/ruby/gems/1.9.1/gems/opscode-pushy-client-1.1.3/lib/pushy_client.rb:172:in `get_config'
        from /opt/opscode-push-jobs-client/embedded/lib/ruby/gems/1.9.1/gems/opscode-pushy-client-1.1.3/lib/pushy_client.rb:72:in `start'
        from /opt/opscode-push-jobs-client/embedded/lib/ruby/gems/1.9.1/gems/opscode-pushy-client-1.1.3/lib/pushy_client/cli.rb:114:in `run_application'
        from /opt/opscode-push-jobs-client/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in `run'
        from /opt/opscode-push-jobs-client/embedded/lib/ruby/gems/1.9.1/gems/opscode-pushy-client-1.1.3/bin/pushy-client:8:in `<top (required)>'
        from /opt/opscode-push-jobs-client/bin/pushy-client:23:in `load'
        from /opt/opscode-push-jobs-client/bin/pushy-client:23:in `<main>'

Pedant's run of Push Jobs Server gives no errors but shows this:

Pending:
  pushy config access control with pushy_job groups GET /config/<name> with pushy_job_readers returns a 200 ("OK") for member client
    # something weird going on for clients here
    # ./spec/pushy/integration/config_spec.rb:288
  pushy config access control with pushy_job groups GET /config/<name> with pushy_job_readers returns a 403 ("Forbidden") for non-member client
    # something weird going on for clients here
    # ./spec/pushy/integration/config_spec.rb:298
  pushy config handling authentication headers GET /config/<name> with successful user missing X-Ops-Userid returns 400
    # No reason given
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:135
  pushy config handling authentication headers GET /config/<name> with successful user empty X-Ops-Userid returns 400
    # No reason given
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:135
  pushy config handling authentication headers GET /config/<name> with successful user absolutely immense X-Ops-Userid returns 401
    # No reason given
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:135
  pushy config handling authentication headers GET /config/<name> when X-Ops-Request-Source is web impersonating successful user succeeds
    # no webui_key defined in pedant config
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:314
  pushy config handling authentication headers GET /config/<name> when X-Ops-Request-Source is web impersonating failed user fails
    # no webui_key defined in pedant config
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:321
  end-to-end-test when one client is running a long running job and the server goes down and comes back up the client should abort and then be able to run another job, a                  nd the job should be set to crashed
    # No reason given
    # ./spec/pushy/integration/end_to_end_spec.rb:1112
  Jobs API Endpoint request error checking handling authentication headers GET /jobs with successful user with everything correct is successful
    # No reason given
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:145
  Jobs API Endpoint request error checking handling authentication headers GET /jobs with successful user missing X-Ops-Sign returns 400
    # No reason given
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:135
  Jobs API Endpoint request error checking handling authentication headers GET /jobs with successful user unsupported X-Ops-Sign version returns 400
    # No reason given
    # /opt/opscode-push-jobs-server/embedded/service/gem/ruby/2.1.0/bundler/gems/chef-server-c1e670513e12/oc-chef-pedant/lib/pedant/rspec/auth_headers_util.rb:135

And many more.

Chef server functions (knife functionality, running cookbooks) is fine.

Thanks!

Change in client_key path in v2.4.0

In the latest release, this line was added, which now forces the push jobs client to look for the client key in /etc/chef/secure. However, my client key has always been stored in /etc/chef, and previous versions of the push job client have worked. This prevents the push jobs service from starting.

I wouldn't expect a breaking change like this in a 2.x.0 bump, but maybe my stuff is not configured according to standards. Can you add some clarification to this change please?

push-Job on windows harcoded config on service and config file is ignored

Hello,

we are checking this cookbook on windows and we are experiencing some issues due to harcoded values.

  1. #38 this is bad on linux, on windows is even worst...
  2. the configuration file that i mentioned in point one is ignored completely by pushy service
  3. because of point 2 is impossible to define a whitelist (only chef-client can be pushed to the client)

thanks

Documentation - Push Client Bindings

A brief description of how the push client obtains connection information (when, from where, etc.) would be helpful if a user has an aytpical installation or if they need support in troubleshooting. In my case, my push client was unable to connect initially because I needed to reconfigure the push job server (and Chef Server) in order for the connection information to be shared correctly from the server to the client. Sharing some detail on how the client retrieves the configuration and how/when the server updates the configuration would be great in non-happy path scenarios.

EL6 distros using runit instead of upstart

Cookbook version

3.2.2

Chef-client version

12.14

Platform Details

RHEL & CentOS6

Scenario:

Use upstart as init provider.

Steps to Reproduce:

Install push jobs on CentOS or RHEL 6.

Expected Result:

The default init provider on EL6 distros is upstart, we should use it.

Actual Result:

Runit will be installed, instead of using an upstart based service.

How are you supposed to deploy in environments with windows and linux?

For windows nodes, the cookbook requires that 2 attributes are set

node.default['push_jobs']['package_url'] = "http://www.example.com/pkgs/opscode-push-jobs-client-windows-1.1.5-1.windows.msi"
node.default['push_jobs']['package_checksum'] = "a-sha256-checksum"

The problem with this design is that most people don't have a role/environment/cookbook that is os specific. That means that linux nodes will get the same attribute as the windows nodes.

The only work around I see is to put the attributes in the "role" since those are usually platform specific. Unfortunately if you have many roles, that is a lot of repeated code.

Purposed solution

Add another level of hierarchy that allows for both windows and linux download urls.

node.default['push_jobs']['windows']['package_url'] = "....."
node.default['push_jobs']['windows']['package_checksum'] = "...."
node.default['push_jobs']['linux']['package_url'] = "....."
node.default['push_jobs']['linux']['package_checksum'] = "...."

sha1 which is provided on Chef's site doesn't suit to this cookbook.

On chef's site we can find SHA1 key:
site: https://downloads.chef.io/push-jobs-client/windows/
Key value: 38b43b5895e44c4c64c5ae19337f7bc918ffdd2b

It works for installing push jobs on client which has chef-client with less than 12 version.

But on nodes which have chef-client of version 12 it fails as follow:

  • does not match checksum on content (411520)

So instead of provided by Chef "38b43b5..." it determines this file as having checksum "411520...".

I have tried to download that file and checked checksum with md5 and got what is provided by Chef:
c:\checksum>fciv.exe c:\opscode-push-jobs-client-windows-1.1.5-1.windows.msi -sh
a1
//
// File Checksum Integrity Verifier version 2.05.
//
38b43b5895e44c4c64c5ae19337f7bc918ffdd2b c:\opscode-push-jobs-client-windows-1.1
.5-1.windows.msi

So checksum on the site is correct.
But it seems that something is wrong with decryption during download process during default recipe run from push-jobs cookbook.

Can you please check it?
Thank you in advance.

Regards,
Taras.

install recipe fails when installing the package from the repository

'kitchen converge default-centos-66' fails due to the unsigned package.

           Error executing action `install` on resource 'chef_ingredient[push-client]'
           ======================================================================

           Chef::Exceptions::Exec
           ----------------------
           yum_package[push-client] (/tmp/kitchen/cache/cookbooks/chef-ingredient/libraries/helpers.rb line 46) had an error: Chef::Exceptions::Exec: yum -d0 -e0 -y install opscode-push-jobs-client-1.1.5-1.el6 returned 1:
           STDOUT:
           STDERR:

           Package opscode-push-jobs-client-1.1.5-1.el6.x86_64.rpm is not signed

deprecated feature

Cookbook version

3.2.0

Chef-client version

12.11.18

Platform Details

RHEL 7

Scenario:

Everything is ok, it's just a deprecated code

Expected Result:

No more warnings :)

Actual Result:

Deprecated features used!

An attempt was made to change version from :latest to nil by calling version(nil). In Chef 12, this does a get rather than a set. In Chef 13, this will change to set the value to nil. at 1 location:

  • /var/chef/cache/cookbooks/push-jobs/recipes/package.rb:45:in `block in from_file'

Enable service chef-push-jobs-client every time when run chef-client on ubuntu 14.04.5

Cookbook version

push-jobs 3.2.2

Chef-client version

Chef Client, version 12.11.18

Platform Details

Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-100-generic x86_64)

Scenario:

Run recipe push-jobs. Every time chef-client try to enable
* service[chef-push-jobs-client] action enable
- enable service service[chef-push-jobs-client]

Steps to Reproduce:

Try run on latest 14.04.5 ubuntu recipe push-jobs.

Expected Result:

Enable service "chef-push-jobs-client" must be enabled one time (when I first run) and after second run - nothing must be happened.

Problems installing from cookbook on CentOS 7

Cookbook version

3.2.0

Chef-client version

Chef: 12.12.15

Platform Details

CentOS 7.2.1511

Scenario:

Trying to install push-jobs client using cookbook

Steps to Reproduce:

chef-client -l debug -o recipe[push-jobs]

Expected Result:

It should install the push-jobs client latest version

Actual Result:

Starting Chef Client, version 12.12.15
[2016-08-06T02:59:18-07:00] WARN: Run List override has been provided.
[2016-08-06T02:59:18-07:00] WARN: Original Run List: [recipe[XXX]]
[2016-08-06T02:59:18-07:00] WARN: Overridden Run List: [recipe[push-jobs]]
resolving cookbooks for run list: ["push-jobs"]
Synchronizing Cookbooks:

  • push-jobs (3.2.0)
  • runit (1.7.8)
  • packagecloud (0.2.4)
  • windows (1.44.1)
  • chef_handler (1.4.0)
  • chef-ingredient (0.19.0)
  • compat_resource (12.10.6)
    Installing Cookbook Gems:
    Compiling Cookbooks...
    Converging 4 resources
    Recipe: push-jobs::package
  • chef_ingredient[push-jobs-client] action install
    Recipe:
* chef_gem[mixlib-install] action install (up to date)

================================================================================
Error executing action `install` on resource 'chef_ingredient[push-jobs-client]'
================================================================================

RuntimeError
------------
No package found for 'push-jobs-client' with version 'latest' for current platform in 'stable' channel.
Check that the package exists.

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb:95:in `configure_from_channel'
/var/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb:46:in `configure_package'
/var/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb:23:in `handle_install'
/var/chef/cache/cookbooks/chef-ingredient/libraries/chef_ingredient_provider.rb:54:in `block in <class:ChefIngredient>'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'

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

 44: chef_ingredient 'push-jobs-client' do
 45:   version package_version || node['push_jobs']['package_version']
 46:   package_source "#{Chef::Config[:file_cache_path]}/#{package_file}" if package_url
 47:   platform_version_compatibility_mode true
 48: end

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

chef_ingredient("push-jobs-client") do
  action [:install]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  declared_type :chef_ingredient
  cookbook_name "push-jobs"
  recipe_name "package"
  platform_version_compatibility_mode true
  product_name "push-jobs-client"
end

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

Running handlers:
[2016-08-06T02:59:19-07:00] ERROR: Running exception handlers
Running handlers complete
[2016-08-06T02:59:19-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 03 seconds
[2016-08-06T02:59:19-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-08-06T02:59:19-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-08-06T02:59:19-07:00] ERROR: chef_ingredient[push-jobs-client](push-jobs::package line 44) had an error: RuntimeError: No package found for 'push-jobs-client' with version 'latest' for current platform in 'stable' channel.
Check that the package exists.

[2016-08-06T02:59:19-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

The strange thing is that I have another server running virtually the same OS and settings and the install goes fine on that one. The only difference between the 2 servers is the kernel they are running. The ones that is working runs the standard CentOS kernel. This one that does not work runs this kernel:
Linux HOSTNAME 3.14.32-xxxx-grs-ipv6-64 #7 SMP Wed Jan 27 18:05:09 CET 2016 x86_64 x86_64 x86_64 GNU/Linux

Please let me know how do I fix this issue.
Thanks in advance

Cookbook requires SHA-256, but our downloads page only provides SHA1

In chef/chef#3302, a user notes that the cookbook requires a SHA256 checksum, but the web page provides a SHA1 instead.

Specifically the cookbook has the parameter:
node.set['push_jobs']['package_checksum'] = "a-sha256-checksum"
But the web page http://downloads.chef.io/push-jobs-client/redhat/#/ only provides SHA1

The short term workaround is to download manually, verify the SHA1 checksum, compute the SHA256 checksum, and insert that into the cookbook. That is ugly.

We should change the cookbook to allow usage of SHA1, or (better) provide stronger checksums on the download page.

Documentation - Knife-push

Prior to the following "Chef Client with this command from the local workstation: knife job start chef-client A_NODE_NAME", please indicate that the knife-push plugin needs to be installed on the client and brief instructions or a link to https://github.com/chef/knife-push"

Error installing from local repo

I'm trying to run this cookbook(2.6.4) on node RedHat without Internet access. So, even setting the package_url attribute to a local repo with the RPM package, it is trying to install gems from RubyGems.org repository.

chef-client log:

[2016-04-04T19:09:58-03:00] INFO: Processing chef_gem[mixlib-install] action install (dynamically defined)
[2016-04-04T19:12:05-03:00] WARN:  failed to find gem mixlib-install (= 0.8.0.alpha.6) from [https://rubygems.org/]
[2016-04-04T19:16:18-03:00] INFO: Running queued delayed notifications before re-raising exception
[2016-04-04T19:16:18-03:00] ERROR: Running exception handlers
[2016-04-04T19:16:18-03:00] ERROR: Exception handlers complete
[2016-04-04T19:16:18-03:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-04-04T19:16:18-03:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-04-04T19:16:18-03:00] ERROR: chef_ingredient[push-client] (push-jobs::linux line 47) had an error: Mixlib::ShellOut::ShellCommandFailed: chef_gem[mixlib-install] (dynamically defined) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "0.8.0.alpha.6" ----
STDOUT:
STDERR: ERROR:  Could not find a valid gem 'mixlib-install' (= 0.8.0.alpha.6), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Connection timed out - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8.gz)
---- End output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "0.8.0.alpha.6" ----
Ran /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "0.8.0.alpha.6" returned 2
[2016-04-04T19:16:18-03:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

And even with the gem installed locally, it continues to trying to install the gem:

# /opt/chef/embedded/bin/gem list mixlib-install
*** LOCAL GEMS ***
mixlib-install (0.8.0.alpha.8)

Am I doing something wrong?

Thanks very much.

/sbin/sv not installed. Runit package missing as dependency ?

I setup push-jobs per the instructions but after changing the node runlist to include push-jobs it fails with below error. Seems that the runit package isn't installed as a dependency ?

I can't see this mentioned in the documentation ? Is there some steps i missed to use the push-job client on Centos servers ?

Info

rpm -qa |grep chef
chef-12.13.37-1.el6.x86_64

cat /etc/redhat-release
CentOS release 6.7 (Final)

Error

restart_command "/sbin/sv restart /etc/service/chef-push-jobs-client"
  Platform:
  ---------
  x86_64-linux


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

    RuntimeError
    ------------
    runit_service[chef-push-jobs-client] (/var/cache/chef/cookbooks/push-jobs/resources/service_runit.rb line 43) had an error: RuntimeError: Could not locate main runit sv_bin at "/sbin/sv". Did you remember to install runit before declaring a "runit_service" resource?

    Try adding the following to the top of your recipe:

    include_recipe "runit"

    Cookbook Trace:
    ---------------
    /var/cache/chef/cookbooks/runit/libraries/provider_runit_service.rb:69:in `load_current_resource'
    /var/cache/chef/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:133:in `compile_and_converge_action'

    Resource Declaration:
    ---------------------
    # In /var/cache/chef/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/cache/chef/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

Fails on centos-71

Kitchen converge on centos-71 fails with:

   [2015-12-03T20:30:51+00:00] ERROR: chef_ingredient[push-client] (push-jobs::linux line 47) had an error: Chef::Exceptions::Package: yum_package[push-client] (/tmp/kitchen/cache/cookbooks/chef-ingredient/libraries/rhel_handler.rb line 60) had an error: Chef::Exceptions::Package: No candidate version available for opscode-push-jobs-client

Looking into why this might be happening. I already see that the packagecloud repo is there. However, in the repo, it's "push-jobs-client" not "opscode-push-jobs-client".

No package available on Ubuntu 14.04 EC2 instance

I get the following error:

apt_package[push-client] (/var/chef/cache/cookbooks/chef-ingredient/libraries/helpers.rb line 46) had an error: Chef::Exceptions::Package: No candidate version available for opscode-push-jobs-client

tried doing an apt-get update first, but still no luck

RHEL 7 Support

The chef-client run for the current cookbook does not successfully complete and ends up in an infinite loop at the following:

[2015-02-27T17:20:47+00:00] DEBUG: waiting until named pipe /etc/service/opscode-push-jobs-client/supervise/ok exists.
[2015-02-27T17:20:48+00:00] DEBUG: .
[2015-02-27T17:20:49+00:00] DEBUG: .
[2015-02-27T17:20:50+00:00] DEBUG: .

If I stop the chef-client run and execute the following '/opt/opscode-push-jobs-client/bin/pushy-client -c /etc/chef/push-jobs-client.rb", then everything seems to work. I believe there is an issue with runit.

3.0.0+ breaks notifies / subscribes :before timer

Cookbook version

3.0.0+

Chef-client version

12.11.18

Platform Details

RHEL 7.2

Scenario:

Trying to use the :before timer on a notifies or subscribes property.

When using push-jobs 2.8.1, the notifies or subscribes properties with a :before trigger work fine, but if I upgrade to 3.0.0+ they no longer work.

It looks like compat_resource is the problem...

This version works fine: https://github.com/chef-cookbooks/push-jobs/tree/2526642a3762df1806edefedcf175028079d4097

This version breaks: https://github.com/chef-cookbooks/push-jobs/tree/9b6e64c5fa53f17f1a35cb89082471e93e29959b

It adds depends 'compat_resource'

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

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:

  • push-jobs (3.2.2)
  • runit (3.0.0)
  • packagecloud (0.2.5)
  • yum-epel (1.0.1)
  • yum (4.0.0)
  • chef-ingredient (0.21.0)
  • compat_resource (12.14.7)
    Installing Cookbook Gems:
    Compiling Cookbooks...
    Converging 5 resources
    Recipe: push-jobs::package
  • remote_file[/var/chef/cache/push-jobs-client-2.1.1-1.el6.x86_64.rpm] action create (up to date)
  • chef_ingredient[push-jobs-client] action install
    Recipe:
* 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

  • directory[/etc/chef] action create (up to date)

  • template[/etc/chef/push-jobs-client.rb] action create (up to date)
    Recipe: push-jobs::service

  • push_jobs_service_runit[push-jobs] action start[2016-09-27T18:54:51+08:00] WARN: Cloning resource attributes for runit_service[chef-push-jobs-client] from prior resource (CHEF-3694)
    Previous runit_service[chef-push-jobs-client]: /var/chef/cache/cookbooks/push-jobs/resources/service_runit.rb:87:in create_init' Current runit_service[chef-push-jobs-client]: /var/chef/cache/cookbooks/push-jobs/resources/service_runit.rb:28:inblock in class_from_file' at /var/chef/cache/cookbooks/push-jobs/resources/service_runit.rb:28:in `block in class_from_file'

    Recipe: runit::default

* 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)

No messages being received on command port in 4s. Possible encryption problem

Cookbook version

3.2.2

Chef-client version

12.13.37

Chef-server version

2.1.0

Platform Details

Both Push Client and Server on Centos 6.5

Scenario:

After i uploaded cookbook to my chef-server, and use chef-client command to configure push job client on my machine, but the node status by searching from the server always shows unavailable, here is the log from /var/log/chef-push-jobs-client/current:

2016-09-29_08:57:36.73327 INFO: [delta.chef.client2] Starting reconfigure thread. Will reconfigure / reload keys after 3600 seconds, less up to splay 0.1.
2016-09-29_08:57:36.73332 INFO: [delta.chef.client2] Starting heartbeat / offline detection thread on interval 10.0 ...
2016-09-29_08:57:40.75176 ERROR: [delta.chef.client2] No messages being received on command port in 4s. Possible encryption problem?
2016-09-29_08:57:40.75203 INFO: [delta.chef.client2] Reconfiguring client / reloading keys ...
2016-09-29_08:57:40.75220 INFO: [delta.chef.client2] Retrieving configuration from https://delta.chef.server/organizations/delta//pushy/config/delta.chef.client2: ...
2016-09-29_08:57:41.75311 INFO: [delta.chef.client2] Stopping command / server heartbeat receive thread and destroying sockets ...
2016-09-29_08:57:41.87677 INFO: [delta.chef.client2] Resolved delta.chef.server to '172.22.27.61' and 2 others

Here is the detail of log:
https://gist.github.com/yanxinyuan/91677e9b85eb43c381123f0b05453fa8

Steps to Reproduce:

  1. First, upload cookbook in server by command: knife cookbook upload push-jobs --force
  2. Second, configure push-job client by command in client machine: chef-client

Expected Result:

When execute 'knife node status' command, the node status is available.

Actual Result:

When execute 'knife node client' command, i can view the node.
When execute 'knife node status' command, i can't view the node.
When execute 'knife node status ', it shows unavailable.
When execute 'chef-client' in client machine, the result shows https://gist.github.com/yanxinyuan/5545ead689a20151443e70ac55498a4a

Push Jobs 3.2.1 is failing on Windows 2012R2 with "No info for version ''"

Cookbook version

3.2.1

Chef-client version

12.13.37

Platform Details

Windows Server 2012 R2 running on VMware VSphere 5.5

Scenario:

If push-jobs cookbook is included in the Chef Client run, the run will fail with the following error:

No info for version ''

I have examined the stack trace and it appears to be this block of code in ./libraries/helpers.rb lines 42 through 57: https://github.com/chef-cookbooks/push-jobs/blob/master/libraries/helpers.rb

Specifically, the self.family_by_version(version)..end function appears to be getting a null value for the version variable.

Steps to Reproduce:

I am not using this cookbook in any capacity beyond a standard inclusion in a node runlist. I am not depending on this cookbook in any others, nor am I including any special resources. To reproduce this:

  1. Deploy push-jobs 3.2.1 to your Chef server.
  2. Assign push-jobs 3.2.1 to a Windows Server 2012 R2 node that is already attached to your server. Your Windows installation should not already have the Push Jobs client installed.
  3. Run chef-client from a command line.

Expected Result:

I expect push-jobs cookbook to download, install, and configure push jobs.

Actual Result:

The entire chef run fails when it tries to run push-jobs cookbook. A full copy of the stack trace is in a gist at: https://gist.github.com/ceseuron/31cefedbfc51a5f5fa245e44f1a3660d

How to override default server name provided by Pushy server to the client?

I set up Pushy server on my Chef 12 server and installed Pushy client on one of the Windows machines (all working in AWS). When started Pushy client successfully connects to Chef server via HTTPS but then tries to connect to the same server (via TCP) using a completely different FQDN (see the second the third log records below). I want to make Pushy client connect to the server using the same FQDN i.e. tcp://chef.myorg.com:10002 and tcp://chef.myorg.com:10000.

[2015-09-17T18:01:03+00:00] INFO: [i-77a2f5dc] Retrieving configuration from https://chef.myorg.com/organizations/myorg/pushy/config/i-77a2f5dc ...
[2015-09-17T18:01:03+00:00] INFO: [i-77a2f5dc] Connecting to command channel at tcp://ip-10-5-5-41.ec2.internal:10002
[2015-09-17T18:01:03+00:00] INFO: [i-77a2f5dc] Listening for server heartbeat at tcp://ip-10-5-5-41.ec2.internal:10000

Documentation - Smoke Testing Client Connection

A set of instructions on how to verify the push client is correctly configured would be helpful. The Service section points out where the logs are located, but it would be good to have a section which tells the user that they should look in the logs for certain entries indicating the connection is healthy.

Bug in template when setting environment variables

Cookbook version

2.4.2

Chef-client version

12.8.1

Platform Details

CentOS 7.1.1503. VM is running in Azure Cloud.

Scenario:

I try to configure push-jobs with a Squid proxy. For this I need to set the environment variables http_proxy and https_proxy. For this I need to set the following variables in /etc/chef/push-jobs-client.rb:

http_proxy 'http://<proxy_ip>:<proxy_port>'
http_proxy_user '<proxy_user>'
http_proxy_pass '<proxy_userpassword>'
https_proxy 'http://<proxy_ip>:<proxy_port>'
https_proxy_user '<proxy_user>'
https_proxy_pass '<proxy_userpassword>'

This is handled in the template here: https://github.com/chef-cookbooks/push-jobs/blob/master/templates/default/push-jobs-client.rb.erb#L5-L7.

But setting the node attribute https://github.com/chef-cookbooks/push-jobs/blob/master/attributes/default.rb#L29 accordingly does not use the env variables.

Steps to Reproduce:

The Problem is the "="-sign in this line: https://github.com/chef-cookbooks/push-jobs/blob/master/templates/default/push-jobs-client.rb.erb#L6.

If you remove this sign, eveything is working properly.

Actual Result:

If I start the push jobs client, I should at least see the connection to the Push Server in the Squid proxy logs, but I don't. If I remove the equal sign, I see the connection in the proxy logs.

disables encryption and allows use of 1.x server?

Cookbook version

2.6.4
push-jobs-client.x86_64 2.1.0-1.el7 installed

Chef-client version

12.9.41

Platform Details

Oracle Linux Server release 7.1

Scenario:

failing to connect to 1.x (?) Chef Server

Steps to Reproduce:

The following error started to show up on a node (I tried push-jobs versions from 2.6.4 to 2.8.0 ...)

I tried to override:

default['push_jobs']['allow_unencrypted'] = true

but reading the source

https://github.com/chef-cookbooks/push-jobs/blob/master/templates/default/push-jobs-client.rb.erb

the allow_unencypted value is not processed.

Is there a component I'm to roll back to overcome this?

Thanks

Expected Result:

opscode-push-jobs service to connect to Chef Server

Actual Result:

Seeing following log entries (repeated every few seconds):

2016-05-23_15:55:29.96948 INFO: [server1] using config file path: '/etc/chef/push-jobs-client.rb'
2016-05-23_15:55:29.97089 INFO: [server1] Using node name: server1
2016-05-23_15:55:29.97092 INFO: [server1] Using org name: myorg
2016-05-23_15:55:29.97093 INFO: [server1] Using Chef server: https://chefserver:443/organizations/myorg
2016-05-23_15:55:29.97096 INFO: [server1] Using private key: /etc/chef/client.pem
2016-05-23_15:55:29.97097 INFO: [server1] Incarnation ID: 162c6f0d-8e4f-395f-b107-ca8b860036fe
2016-05-23_15:55:29.97097 INFO: [server1] Allowing fallback to unencrypted connection: false
2016-05-23_15:55:29.97098 INFO: [server1] Starting client ...
2016-05-23_15:55:29.97099 INFO: [server1] Retrieving configuration from https://chefserver:443/organizations/myorg//pushy/config/server1: ...
2016-05-23_15:55:30.03089 ERROR: [server1] Exiting: No key returned from server; server may be using 1.x protocol. The config flag 'allow_unencrypted' disables encryption and allows use of 1.x server. Use with caution!
2016-05-23_15:55:30.03092 [server1] Exiting: No key returned from server; server may be using 1.x protocol. The config flag 'allow_unencrypted' disables encryption and allows use of 1.x server. Use with caution!

Missing push-jobs-client run template

It looks like the runit_service resource references a template that is not provided by the cookbook.

push-jobs version: 2.6.4

Error executing action `enable` on resource 'runit_service[push-jobs-client]'
================================================================================

 Chef::Exceptions::FileNotFound
------------------------------
template[/etc/sv/push-jobs-client/run] (/var/chef/cache/cookbooks/runit/libraries/provider_runit_service.rb line 82) had an error: Chef::Exceptions::FileNotFound: Cookbook 'push-jobs' (2.6.4) does not contain a file at any of these locations:
  templates/ubuntu-14.04/sv-push-jobs-client-run.erb
  templates/ubuntu/sv-push-jobs-client-run.erb
  templates/default/sv-push-jobs-client-run.erb
  templates/sv-push-jobs-client-run.erb

This cookbook _does_ contain: ['/var/chef/cache/cookbooks/push-jobs/templates/default/sv-opscode-push-jobs-client-run.erb','/var/chef/cache/cookbooks/push-jobs/templates/default/push-jobs-client.rb.erb']

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/runit/libraries/provider_runit_service.rb:280:in `block in <class:RunitService>'

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

28: runit_service 'push-jobs-client' do
29:   options('logging_level' => node['push_jobs']['logging_level'],
30:           'node' => { 'push_jobs' => node['push_jobs'] },
31:           'config' => PushJobsHelper.config_path)
32:   default_logger true
33:   subscribes :restart, "template[#{PushJobsHelper.config_path}]"
34:   action [:enable, :start]
35:   retries 15
36: end

UNKNOWN entries in the log?

Cookbook version

push-jobs                         2.8.1
push-jobs-client.x86_64        2.1.0-1.el7                         installed

Chef-client version

12.9.41

Platform Details

Oracle Linux Server release 7.1

Scenario:

Observe UNKNOWN entries in the log below

Steps to Reproduce:

knife job start "chef-client" node1--quorum 0%

Expected Result:

Expect to use jobid in logs

Actual Result:

2016-05-26_12:24:16.48072 INFO: [UNKNOWN] Job UNKNOWN: whitelist 'chef-client' to 'chef-client'
2016-05-26_12:24:16.48081 INFO: [UNKNOWN] Job UNKNOWN: whitelist 'chef-client' to 'chef-client'
2016-05-26_12:24:16.48082 INFO: [UNKNOWN] Job UNKNOWN: whitelist 'chef-client' to 'chef-client'
2016-05-26_12:24:16.48083 INFO: [node1] Received commit a3ff65ddd4a2e6e85515a0354388d47a

runit service not being removed after upgrade

Cookbook version

3.1.0

Chef-client version

12.8.1

Platform Details

Ubuntu 14.04 & CentOS 6.7

Scenario:

Attempt to upgrade push jobs cookbook from 2.6.6 to 3.1.0

Steps to Reproduce:

Update the cookbook on the chef server to 3.1.0, and update the attributes for role/environment/node such that allow_unencrypted = true (required for interacting with push server 1.x).

Expected Result:

Upgrade of push jobs client, keeping nodes available.

Actual Result:

Upgrade will complete successfully, but with no attributes set beyond allow_unencrypted, the cookbook will now use systemd or upstart instead of the previous default, runit. However it will not remove the existing runit service, and so the server will have two processes running, and availability will flap until the runit service is manually removed.

Looking at the resource provided, it looks as though if you set the init scheme to runit explicitly in the cookbook attributes, the associated push_jobs_service_runit resource will remove the old runit service in favor of the new (see: https://github.com/chef-cookbooks/push-jobs/blob/master/resources/service_runit.rb#L71-L85), however similar logic does not exist for the upstart or systemd services, which look to lead to the above scenario.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.