pulumi/pulumi · error
Must supply <%s> unless pulumi is run interactively
Error message
Must supply <%s> unless pulumi is run interactively
What it means
missingNonInteractiveArg builds the error shown when a required CLI argument is absent in a non-interactive session. With exactly one missing argument it formats 'Must supply <arg> unless pulumi is run interactively', since the interactive prompt path cannot run without a TTY.
Source
Thrown at pkg/cmd/pulumi/state/io.go:384
func getNewResourceName() (string, error) {
var resourceName string
err := survey.AskOne(&survey.Input{
Message: "Choose a new resource name:",
}, &resourceName, ui.SurveyIcons(cmdutil.GetGlobalColorization()))
if err != nil {
return "", err
}
return resourceName, nil
}
// Format a non-nil error that indicates some arguments are missing for a
// non-interactive session.
func missingNonInteractiveArg(args ...string) error {
switch len(args) {
case 0:
panic("cannot create an error message for missing zero args")
case 1:
return fmt.Errorf("Must supply <%s> unless pulumi is run interactively", args[0])
default:
for i, s := range args {
args[i] = "<" + s + ">"
}
return fmt.Errorf("Must supply %s and %s unless pulumi is run interactively",
strings.Join(args[:len(args)-1], ", "), args[len(args)-1])
}
}
View on GitHub (pinned to 793f7b2e16)
Solutions
- Pass the required argument explicitly (e.g. the full resource URN)
- Run the command in an interactive terminal if you want the picker
- Fix shell quoting/expansion so the argument is not empty in scripts
Example fix
// before (script, empty var)
pulumi state delete "$URN"
// after: fail fast when the variable is unset
: "${URN:?URN is required}" && pulumi state delete "$URN" Defensive patterns
Strategy: validation
Validate before calling
// shell: refuse to run when the required argument is missing
if [ -z "${URN:-}" ]; then echo "Must supply <urn> unless pulumi is run interactively" >&2; exit 1; fi
pulumi state delete "$URN" Prevention
- In scripts, assert required args are non-empty before invoking pulumi
- Detect non-TTY environments and always pass explicit arguments
- Use `${VAR:?}` expansions to fail fast on unset variables
When it happens
Trigger: Running state commands (e.g. `pulumi state delete` with no URN) in CI or piped stdin where cmdutil.Interactive() is false and the positional argument is empty.
Common situations: Automation scripts forgetting the URN argument; CI jobs invoking pulumi without a TTY so the interactive picker is skipped; shell variable expansions yielding an empty string argument.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Must supply %s and %s unless pulumi is run interactively
- no environment name specified
- the provider command does not accept versions
- expected <project-number> and <access-token>
- invalid project number %q: must be a positive integer
AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31).
Data as JSON: /api/errors/48fa666b31758546.
Report an issue: GitHub.