pulumi/pulumi · error
template '%s' not found: %w
Error message
template '%s' not found: %w
What it means
Thrown during the dry-run copy check (CopyTemplateFilesDryRun) when a template file does not exist, reported as 'template not found'. It means the resolved template directory is missing required files, so `pulumi new` aborts before writing anything.
Source
Thrown at pkg/cmd/pulumi/project/newcmd/new.go:238
Dir: temp,
ProjectName: "${PROJECT}",
}
} else {
template, err = cmdTemplate.Download(ctx)
if err != nil {
return err
}
}
if template.Errored() {
return fmt.Errorf("template '%s' is currently broken: %w", template.Name, template.Error)
}
// Do a dry run, if we're not forcing files to be overwritten.
if !args.force {
if err = cmdTemplates.CopyTemplateFilesDryRun(template.Dir, cwd, args.name); err != nil {
if os.IsNotExist(err) {
return fmt.Errorf("template '%s' not found: %w", args.templateNameOrURL, err)
}
return err
}
}
// If a stack was specified via --stack, see if it already exists.
// Only do the lookup for fully-qualified stack names `org/project/stack` because
// otherwise `getStack` will fail to detect the project folder and fail.
// The main purpose of this lookup is getting a proper start with a project
// created via the web app.
var s backend.Stack
var orgName string
if !args.generateOnly && args.stack != "" && strings.Count(args.stack, "/") == 2 {
parts := strings.SplitN(args.stack, "/", 3)
// Set the org name for future use.
orgName = parts[0]
projectName := parts[1]View on GitHub (pinned to 793f7b2e16)
Solutions
- Verify the template name spelling and list available ones with `pulumi new --list`
- If using a URL, confirm the path contains the template (Pulumi.yaml and files exist at that location)
- Clear/re-fetch templates to drop a stale cache referencing removed files
- If files exist but are unreadable, check file permissions in the template directory
Example fix
// before pulumi new tyepscript // after pulumi new typescript // correct template name
Defensive patterns
Strategy: validation
Validate before calling
pulumi new --list | grep -x 'my-template' # verify the template exists before running
Prevention
- Spell-check template names against `pulumi new --list`
- For URLs, verify the target contains template files
- Drop stale local template caches
When it happens
Trigger: `pulumi new <name> --dry-run` (or default flow without --force) where CopyTemplateFilesDryRun returns os.IsNotExist — the template name/URL resolved to a directory lacking template files.
Common situations: Misspelled template name; org template URL pointing at a repo/path without template files; template removed or renamed upstream while a cached name is used.
Related errors
- environment %s does not exist; pass --create to create it, o
- resource %s %q does not exist in stack %s
- stack %q not found
- no template found
- looking up role %q: %w
AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31).
Data as JSON: /api/errors/b2c0673f7fe7c27f.
Report an issue: GitHub.