sous-chefs / jenkins

Development repository for the jenkins cookbook
https://supermarket.chef.io/cookbooks/jenkins
Apache License 2.0
424 stars 635 forks source link

Windows JNLP slave failing with error #570

Open emmanuelguerin opened 7 years ago

emmanuelguerin commented 7 years ago

Cookbook version

jenkins 4.2.1

Chef-client version

12.10.24

Platform Details

Windows Server 2012R2

Scenario:

When creating a new JNLP slave, an Chef::Exceptions::EnclosingDirectoryDoesNotExist is raised

Steps to Reproduce:

Just put a resource like this in your cookbook:

jenkins_windows_slave node['hostname'].downcase do
  remote_fs 'D:\Bld'
  user 'azure'
  password 'P2ssw0rd'
  executors 1
  usage_mode 'exclusive'
end

Expected Result:

A new slave running and registered with the master

Actual Result:

================================================================================
Error executing action `create` on resource 'jenkins_windows_slave[vm]'
================================================================================

Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
remote_file[d:\Bld/jenkins-slave.exe] (dynamically defined) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory d:\Bld does not exist.
iennae commented 7 years ago

@emmanuelguerin Does d: exist on your node? Thanks for this added information.

emmanuelguerin commented 7 years ago

@iennae Yes, the recipe worked ok with version 2.4.1.

IMHO, the problem comes from this modification chef-cookbooks/jenkins@52176e7f97450b1f724d2c87705158b79aab8d54.

As a result of replacing super with do_create in the action :create of slave_windows, the pieces of code in slave_jnlp are skipped. Those include the creation of the parent directory for the slave.

emmanuelguerin commented 7 years ago

Pinging on this. My pull request was rejected because of a pending refactoring. Any news?