[chef] Re: Re: Setting up jenkins slaves using chef


Chronological Thread 
  • From: Peter Hoellig < >
  • To: " " < >
  • Subject: [chef] Re: Re: Setting up jenkins slaves using chef
  • Date: Mon, 24 Jun 2013 21:56:25 +0000
  • Accept-language: en-US

Pointing to a maven repo that's up (http://download.java.net/maven/2/com/sun/winsw/winsw/1.8/winsw-1.8-bin.exe for example) takes care of that issue and presents yet another.

I'm now receiving an "Access is denied" error when the cookbook tries to run the jenkins-cli.jar. I took the command from the logs and ran it at the command line and it executes without this error and returns and empty JSON object, which is nice and not particularly helpful. I checked on the server and all of the files are present and accessible by the user running the chef commands. So something with the jenkins_execute[] wrapping tag is likely causing the error, but I don't see in the code where that is defined to figure out if it's executing as a different user than the original command.

 ================================================================================
 Error executing action `run` on resource 'jenkins_execute[java -jar C:/jenkins/jenkins-cli.jar -s http://pathToLinuxMaster:8080 groovy node_info.groovy nodeDNS]'
 ================================================================================
 
 
 Errno::EACCES
 -------------
 Permission denied - CreateProcess() failed: Access is denied.
 
 
 Cookbook Trace:
 ---------------
 c:/chef/cache/cookbooks/jenkins/providers/execute.rb:30:in `action_run'
 
 
 Resource Declaration:
 ---------------------
 # In c:/chef/cache/cookbooks/jenkins/providers/cli.rb
 
  64:   je = jenkins_execute command do
  65:         cwd home
  66:         block { |stdout| new_resource.block.call(stdout) } if new_resource.block
  67:       end
  68: 
 
 
 
 Compiled Resource:
 ------------------
 # Declared in c:/chef/cache/cookbooks/jenkins/providers/cli.rb:64:in `action_run'
 
 jenkins_execute("java -jar C:/jenkins/jenkins-cli.jar -s http://quicklinux-ci.cloudapp.net:8080 groovy node_info.groovy quickwinci2.68d10961339145d5901c74809a32a76c.quickwinci2.3187658741.uswest.internal.cloudapp.net") do
   action :run
   retries 0
   retry_delay 2
   command "java -jar C:/jenkins/jenkins-cli.jar -s http://pathToLinuxMaster:8080 groovy node_info.groovy nodeDNS"
   cookbook_name "jenkins"
   cwd "C:/jenkins"
   block #<Proc: :/chef/cache/cookbooks/jenkins/providers/cli.rb:66>
 end
 
 
 
 [2013-06-24T20:55:24+00:00] INFO: Running queued delayed notifications before re-raising exception
 [2013-06-24T20:55:24+00:00] ERROR: Running exception handlers
 [2013-06-24T20:55:24+00:00] FATAL: Saving node information to c:/chef/cache/failed-run-data.json
 [2013-06-24T20:55:24+00:00] ERROR: Exception handlers complete
 [2013-06-24T20:55:24+00:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
 [2013-06-24T20:55:24+00:00] FATAL: Errno::EACCES: jenkins_execute[java -jar C:/jenkins/jenkins-cli.jar -s http://pathToLinuxMaster:8080 groovy node_info.groovy nodeDNS] (c:/chef/cache/cookbooks/jenkins/providers/cli.rb line 64) had an error: Errno::EACCES: Permission denied - CreateProcess() failed: Access is denied.

From: Peter Hoellig < "> >
Date: Monday, June 24, 2013 2:43 PM
To: " "> " < "> >
Subject: Re: [chef] Re: Setting up jenkins slaves using chef

OK, so I pulled the cookbook from github and gave that version a shot. I had to tweak the node_windows.rb file a little. It seems to have several references to a variable named 'home' which is never defined and was causing errors, I changed them to home_dir which is what I think was intended from looking at the code.

It's still failing, it appears to be puling the winsw installer from maven.dyndns.org which is not available (http://www.downforeveryoneorjustme.com/maven.dyndns.org). I'm not sure if that's temporary or if the code needs to be updated with a new url.

[2013-06-24T19:28:33+00:00] FATAL: Errno::ETIMEDOUT: remote_file[C:/jenkins/jenkins-slave.exe] (jenkins::node_windows line 49) had an error: Errno::ETIMEDOUT: Error connecting to http://maven.dyndns.org/2/com/sun/winsw/winsw/1.8/winsw-1.8-bin.exe - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2)

Thoughts?
      ~Peter


sorry, not recently , 5 months ago :-D



On Mon, Jun 24, 2013 at 11:59 AM, Ranjib Dey < " target="_blank"> > wrote:
it was a bug, fixed by schiasmo recently https://github.com/opscode-cookbooks/jenkins/commit/45f87c1ab95fe28d51df38370df76bbc6703ddd6 , use the cookbook from github. should be easy if you are using berkshelf ,
best
ranjib


On Mon, Jun 24, 2013 at 11:38 AM, Peter Hoellig < " target="_blank"> > wrote:
Hello and thanks in advance,

Is there any setup that must be done on the jenkins master before the jenkins chef cookbook can create a slave node?

I'm working with the Jenkins cookbook (0.6.3 from http://community.opscode.com/cookbooks/jenkins) trying to setup a windows slave and having a bit of trouble. I was able to setup a Jenkins master on Ubuntu without issue and I'm getting errors creating the jenkins-slave.xml when running chef-client on the slave node. I've already verified that my DNS settings are correct and that I'm hitting the server. 

I've created a role on my chef server which contains the java:windows (this works and installs fine) and jenkins:node_windows recipes and overridden attributes as follows. 
{
    "java":
    {
        "jdk_version":"7",
        "windows":{"url":"http://pathToJavaInstaller"}
    },
    "jenkins":
    {
        "server":
        {
             "url":"http://pathToJenkinsMaster:8080"
}}}

Here is the relevant output that I'm seeing:
 ================================================================================
 Error executing action `create` on resource 'template[C:/jenkins/jenkins-slave.xml]'
 ================================================================================
 
 
 Chef::Exceptions::FileNotFound
 ------------------------------
 Cookbook 'jenkins' (0.6.3) does not contain a file at any of these locations:
   templates/windows-6.1.7601/jenkins-slave.xml
   templates/windows/jenkins-slave.xml
   templates/default/jenkins-slave.xml
 
 This cookbook _does_ contain: ['apache_jenkins.erb','htpasswd.erb','jenkins.erb','nginx_jenkins.conf.erb','port_jenkins.erb','sv-hudson-slave-log-run.erb','sv-hudson-slave-run.erb']
 
 
 Resource Declaration:
 ---------------------
 # In c:/chef/cache/cookbooks/jenkins/recipes/node_windows.rb
 
  44: template "#{home}/jenkins-slave.xml" do
  45:   source "jenkins-slave.xml"
  46:   variables(:jenkins_home => home,
  47:             :jnlp_url => "#{url}/computer/#{node[:jenkins][:node][:name]}/slave-agent.jnlp")
  48: end
  49: 
 
 
 
 Compiled Resource:
 ------------------
 # Declared in c:/chef/cache/cookbooks/jenkins/recipes/node_windows.rb:44:in `from_file'
 
 template("C:/jenkins/jenkins-slave.xml") do
   provider Chef::Provider::Template
   action "create"
   retries 0
   retry_delay 2
   path "C:/jenkins/jenkins-slave.xml"
   backup 5
   source "jenkins-slave.xml"
   variables {:jenkins_home=>"C:/jenkins", :jnlp_url=>"http://pathToJenkinsMaster:8080/computer/nodeDNS/slave-agent.jnlp"}
   cookbook_name "jenkins"
   recipe_name "node_windows"
 end
 
 
 
 [2013-06-24T18:03:11+00:00] INFO: Running queued delayed notifications before re-raising exception
 [2013-06-24T18:03:11+00:00] ERROR: Running exception handlers
 [2013-06-24T18:03:11+00:00] FATAL: Saving node information to c:/chef/cache/failed-run-data.json
 [2013-06-24T18:03:11+00:00] ERROR: Exception handlers complete
 [2013-06-24T18:03:11+00:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
 [2013-06-24T18:03:11+00:00] FATAL: Chef::Exceptions::FileNotFound: template[C:/jenkins/jenkins-slave.xml] (jenkins::node_windows line 44) had an error: Chef::Exceptions::FileNotFound: Cookbook 'jenkins' (0.6.3) does not contain a file at any of these locations:
   templates/windows-6.1.7601/jenkins-slave.xml
   templates/windows/jenkins-slave.xml
   templates/default/jenkins-slave.xml
 
 This cookbook _does_ contain: ['apache_jenkins.erb','htpasswd.erb','jenkins.erb','nginx_jenkins.conf.erb','port_jenkins.erb','sv-hudson-slave-log-run.erb','sv-hudson-slave-run.erb']

Thanks!





Archive powered by MHonArc 2.6.16.

§