GoogleContainerTools/skaffold · error
getting user choices
Error message
getting user choices
What it means
chooseBuilders shows a survey.MultiSelect asking which image builders should get Kubernetes resources during interactive init. If askOne fails, it returns an empty list wrapped as 'getting user choices' (note: the underlying error is discarded, making this one less debuggable). Any prompt failure aborts builder selection.
Source
Thrown at pkg/skaffold/initializer/prompt/prompt.go:90
}
err := askOne(prompt, &response, nil)
if err != nil {
return true, fmt.Errorf("reading user confirmation: %w", err)
}
return !response, nil
}
// chooseBuilders prompts the user to select which builders they'd like to create associated kubernetes manifests for
func chooseBuilders(builders []string) ([]string, error) {
chosen := []string{}
prompt := &survey.MultiSelect{
Message: "Which builders would you like to create kubernetes resources for?",
Options: builders,
}
err := askOne(prompt, &chosen)
if err != nil {
return []string{}, fmt.Errorf("getting user choices")
}
return chosen, err
}
// PortForwardResource prompts the user to give a port to forward the current resource on
func portForwardResource(out io.Writer, imageName string) (int, error) {
var response string
prompt := &survey.Question{
Prompt: &survey.Input{Message: fmt.Sprintf("Select port to forward for %s (leave blank for none):", imageName)},
Validate: func(val interface{}) error {
str := val.(string)
if _, err := strconv.Atoi(str); err != nil && str != "" {
return errors.New("response must be a number, or empty")
}
return nil
},
}View on GitHub (pinned to a1189de023)
Solutions
- Run init in an interactive TTY, or supply builder info non-interactively (--builder / auto-detection) so prompts are skipped
- Use --force with explicit flags in CI to bypass all prompts
- Check that stdin/stdout are real terminals; reattach with ssh -t
Example fix
// before ssh server 'skaffold init' # no pty // after ssh -t server 'skaffold init' # or: skaffold init --force
Defensive patterns
Strategy: fallback
Validate before calling
if !term.IsTerminal(int(os.Stdin.Fd())) || !term.IsTerminal(int(os.Stdout.Fd())) {
return fmt.Errorf("interactive builder selection requires a TTY; use --builder instead")
} Try / catch
chosen, err := chooseBuilders(builders)
if err != nil {
// the sentinel message hides the cause; fall back to non-interactive defaults
log.Printf("builder prompt unavailable (%v); defaulting to all detected builders", err)
chosen = defaultBuilders
} Prevention
- Prefer non-interactive init flags in automation (--builder, --force)
- Run init in a real terminal with a capable TTY
- Don't redirect init's stdout/stderr when prompts may appear
When it happens
Trigger: askOne(&survey.MultiSelect{...}) errors while running interactive init — no TTY, stdin closed/eof, or terminal incompatibility with the survey library.
Common situations: CI/non-interactive shells triggering init prompts; ssh without pty; output redirected so the survey UI can't render; user aborts with Ctrl-C/EOF.
Related errors
- reading user confirmation: %w
- unable to generate skaffold config file automatically - try
- response must be a number, or empty
- loading manifests: %w
- generating : %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/aa5627c45aa5118c.
Report an issue: GitHub.