Skip to content
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.

chef-client provisioner failing on Windows Server 2012 R2: Failed to read the private key #12

Open
ghost opened this issue Apr 20, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 20, 2021

This issue was originally opened by @kbrowns as hashicorp/packer#6366. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


I'm seeing issues with the chef-provisioner starting in build 1.2.0. I"m pretty confident the issue is a bug because downgrading packer to 1.1.3 reliably fixes the issue, but if I upgrade to any version above that (1.2.0+) I reliably see failures with the chef-client being unable to find private key. Full log is listed below, but the consistent failure I see is:

        csg-simple-packer-build: 'skipping chmod 0777 C:/Windows/Temp/packer-chef-client'

        csg-simple-packer-build: Uploading ****...

        csg-simple-packer-build: Creating configuration file 'client.rb'

        csg-simple-packer-build: Creating JSON attribute file

        csg-simple-packer-build: Executing Chef: c:/opscode/chef/bin/chef-client.bat --no-color -c C:/Windows/Temp/packer-chef-client/client.rb -j C:/Windows/Temp/packer-chef-client/first-boot.json

        csg-simple-packer-build: Creating configuration file 'knife.rb'

    ==> csg-simple-packer-build: Cleaning up chef node...

        csg-simple-packer-build: WARN: Failed to read the private key C:/Windows/Temp/packer-chef-client/client.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - C:/Windows/Temp/packer-chef-client/client.pem>

        csg-simple-packer-build: ERROR: Your private key could not be loaded from C:/Windows/Temp/packer-chef-client/client.pem

        csg-simple-packer-build: Check your configuration file and ensure that your private key is readable

    ==> csg-simple-packer-build: Terminating the source AWS instance...

==> csg-simple-packer-build: Cleaning up any extra volumes...

    ==> csg-simple-packer-build: No volumes to clean up, skipping

    Build 'csg-simple-packer-build' errored: Error cleaning up chef node: Failed to cleanup node: Non-zero exit status. See output above for more info.

Given that it's complaining there is no client.pem, this seems to suggest that the bootstrap process is somehow short circuited - i.e. the validation key is not uploaded an used maybe?

  • Packer version: issues appears to start in 1.2.0 and remains in 1.2.1, 1.2.2, 1.2.3, and 1.2.4. 1.1.3 works
  • Host platform: AWS Linux 1 host building Windows Server 2012 R2
  • Debug log output from PACKER_LOG=1 packer build template.json: debug output
  • Reproduction steps: packer.json
@nywilken
Copy link
Contributor

nywilken commented Nov 9, 2021

With the archival of this repository all open issues will be marked as read-only. If you wish to further discuss this plugin or any of its open issues we invite you to open a discussion on the Packer community forum.

More details on the plugin archiving process for this provisioner can be found on the Plans to Archive Unmaintained Packer Provisioner Plugins blog post.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant