{"record":{"id":"b2c0673f7fe7c27f","repo":"pulumi/pulumi","slug":"template-s-not-found-w-b2c067","errorCode":null,"errorMessage":"template '%s' not found: %w","messagePattern":"template '(.+?)' not found: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/project/newcmd/new.go","lineNumber":238,"sourceCode":"\t\t\tDir:         temp,\n\t\t\tProjectName: \"${PROJECT}\",\n\t\t}\n\t} else {\n\t\ttemplate, err = cmdTemplate.Download(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif template.Errored() {\n\t\treturn fmt.Errorf(\"template '%s' is currently broken: %w\", template.Name, template.Error)\n\t}\n\n\t// Do a dry run, if we're not forcing files to be overwritten.\n\tif !args.force {\n\t\tif err = cmdTemplates.CopyTemplateFilesDryRun(template.Dir, cwd, args.name); err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\treturn fmt.Errorf(\"template '%s' not found: %w\", args.templateNameOrURL, err)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// If a stack was specified via --stack, see if it already exists.\n\t// Only do the lookup for fully-qualified stack names `org/project/stack` because\n\t// otherwise `getStack` will fail to detect the project folder and fail.\n\t// The main purpose of this lookup is getting a proper start with a project\n\t// created via the web app.\n\tvar s backend.Stack\n\tvar orgName string\n\tif !args.generateOnly && args.stack != \"\" && strings.Count(args.stack, \"/\") == 2 {\n\t\tparts := strings.SplitN(args.stack, \"/\", 3)\n\n\t\t// Set the org name for future use.\n\t\torgName = parts[0]\n\t\tprojectName := parts[1]","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/project/newcmd/new.go#L220-L256","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":"// before\npulumi new tyepscript\n// after\npulumi new typescript  // correct template name","handlingStrategy":"validation","validationCode":"pulumi new --list | grep -x 'my-template'  # verify the template exists before running","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Spell-check template names against `pulumi new --list`","For URLs, verify the target contains template files","Drop stale local template caches"],"tags":["cli","templates","not-found"],"backgroundTag":"template-not-found","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}