chef / chef/chef

Sudo error during bootstrap is not helpful

Open
#9,987 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect: UX Focus: knife bootstrap
Dominant language
Ruby
Stars
8.2k
Forks
2.5k
Avg merge
4d 5h
Merged PRs (30d)
23

Description

If you specify --sudo when bootstrapping and it fails because the user doesn't have sudo privs or what not you'll get this:

ERROR: Train::UserError: Sudo failed: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

That's not helpful since it's a train error. We should rescue that and provide better output if we can.

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 tracing the bootstrap path that handles the --sudo option and reproduce the failure for a user without sudo privileges. Done means the failure presents useful user-facing output instead of the raw Train::UserError; the payload does not name a file or test to run.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.