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

  1. Verify the template name spelling and list available ones with `pulumi new --list`
  2. If using a URL, confirm the path contains the template (Pulumi.yaml and files exist at that location)
  3. Clear/re-fetch templates to drop a stale cache referencing removed files
  4. 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

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


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/b2c0673f7fe7c27f. Report an issue: GitHub.