Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kbrowns opened this issue Jun 8, 2018 · 3 comments
Labels
bug community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers help wanted provisioner/chef remote-plugin/chef

Comments

@kbrowns
Copy link

kbrowns commented Jun 8, 2018

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
@SwampDragons SwampDragons added the community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers label Dec 13, 2018
@cdtsushant
Copy link

azure-arm: Chef Infra Client cannot execute without accepting the license
azure-arm: Creating configuration file 'knife.rb'
==> azure-arm: Cleaning up chef node...
==> azure-arm: ERROR: Your private key could not be loaded from C:/Windows/Temp/packer-chef-client/client.pem
==> azure-arm: Check your configuration file and ensure that your private key is readable
azure-arm: 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>
==> azure-arm: Provisioning step had errors: Running the cleanup provisioner, if present...
==> azure-arm:

@ghost
Copy link

ghost commented Apr 20, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-chef#12 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-chef#12.

@ghost
Copy link

ghost commented May 21, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators May 21, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug community-supported-plugin denotes requests for plugins that are supported by the community, not by HashiCorp engineers help wanted provisioner/chef remote-plugin/chef
Projects
None yet
Development

No branches or pull requests

4 participants