chef-cli icon indicating copy to clipboard operation
chef-cli copied to clipboard

chef-cli cannot update policyfile when the path contains spaces

Open hunter86bg opened this issue 3 years ago • 0 comments

Version:

Chef Workstation version: 22.7.1006 Chef Infra Client version: 17.10.0 Chef InSpec version: 4.56.20 Chef CLI version: 5.6.1 Chef Habitat version: 1.6.420 Test Kitchen version: 3.3.1 Cookstyle version: 7.32.1

Environment:

OS: Win 10 (Build: 19044) Terminal: Windows Terminal with profile from git for windows

Scenario:

Update a policy file

Steps to Reproduce:

  1. Setup Onedrive with spaces in the name
  2. Create a directory in it
  3. Update the policyfile

Expected Result:

The path should always be escaped and the policyfle should be created/updated.

Actual Result:

chef-cli fails with error "(Errno::EBADF) Bad file descriptor @ fptr_finalize_flush"

Error message:

[MYUSER@MYPC policyfiles]$ chef-cli update secret.rb
Building policy secret
Expanded run list: recipe[base::default], recipe[secret::default]
Caching Cookbooks...
Installing secret >= 0.0.0 from path
Installing base   0.5.2
Error: Failed to generate Policyfile.lock
Reason: (Errno::EBADF) Bad file descriptor @ fptr_finalize_flush - C:/Users/MYUSER/OneDrive - SOMENAME/Documents/LOCAL_CHEF/local/policyfiles/secret.lock.json

hunter86bg avatar Aug 17 '22 07:08 hunter86bg