chef / chef/chef-cli

chef-cli cannot update policyfile when the path contains spaces

Open
#214 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Triage: Not Reproducible Type: Bug
Dominant language
Ruby
Stars
18
Forks
23
Avg merge
5d 17h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing chef-cli update secret.rb from a Windows path containing spaces, using the versions and steps in the issue. Trace the policy lock generation that produces secret.lock.json; done means the policy file updates successfully and the lock file is created without the EBADF error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.