{"record":{"id":"93dee07f3909543f","repo":"pulumi/pulumi","slug":"w-your-new-project-in-s-is-incomplete","errorCode":null,"errorMessage":"%w\nYour new project in %s is incomplete","messagePattern":"%w\nYour new project in (.+?) is incomplete","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/auth/onboarding.go","lineNumber":130,"sourceCode":"\t}\n\n\t// `pulumi new --dir` changes the working directory, so resolve the target while we still can.\n\tif abs, err := filepath.Abs(target); err == nil {\n\t\ttarget = abs\n\t}\n\n\tnewCmd := newcmd.NewNewCmd()\n\tnewCmd.SetArgs(args)\n\t// `pulumi new`'s usage text and error reporting belong to `pulumi login`'s caller here.\n\tnewCmd.SilenceUsage = true\n\tnewCmd.SilenceErrors = true\n\n\t// `pulumi new` can fail before it writes anything or long after, and returns a bare error\n\t// either way. We don't have to tell those apart: target was empty before this ran, so anything\n\t// in it now is a half-written project the user should know about.\n\terr := newCmd.ExecuteContext(ctx)\n\tif err != nil && newcmd.ErrorIfNotEmptyDirectory(target) != nil {\n\t\treturn fmt.Errorf(\"%w\\nYour new project in %s is incomplete\", err, target)\n\t}\n\treturn err\n}\n\n// suggestDirectories completes a partially typed path against the directories it could name, so\n// the prompt answers <tab> the way a shell would.\nfunc suggestDirectories(toComplete string) []string {\n\t// Glob only fails on a malformed pattern, for which no suggestions is the right answer.\n\tmatches, _ := filepath.Glob(toComplete + \"*\")\n\n\tdirs := make([]string, 0, len(matches))\n\tfor _, match := range matches {\n\t\tif info, err := os.Stat(match); err == nil && info.IsDir() {\n\t\t\tdirs = append(dirs, match)\n\t\t}\n\t}\n\treturn dirs\n}","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/auth/onboarding.go#L112-L148","documentation":"During interactive onboarding, `pulumi new` is executed to scaffold the chosen project. If it fails AND the target directory is no longer empty, the onboarding wrapper concludes a partially written project was left behind and wraps the original error with this note so the user knows the directory is in a half-created state.","triggerScenarios":"`pulumi new` (invoked from onboarding via runNew) errors after already writing some files — e.g. template download succeeded, template rendering or `npm install`-style post-steps failed, user aborted late, or template itself is broken — and ErrorIfNotEmptyDirectory(target) then reports content.","commonSituations":"Network interruption mid-template generation; invalid template parameters causing a late failure; disk-full or permission errors partway through scaffolding; running onboarding twice into the same directory.","solutions":["Inspect the target directory and delete the partial project (or clean its contents) before retrying","Rerun the onboarding/new command against a fresh empty directory","Check the wrapped root error (shown above the message) for the actual cause — network, template, or permissions"],"exampleFix":"// before\nrm -rf ./my-incomplete-project && pulumi new   # retry in clean dir\n// after (or fix the root cause and continue in place)\ncd ./my-incomplete-project && pulumi install","handlingStrategy":"try-catch","validationCode":"// shell: pre-check target dir is empty before onboarding\nif [ -d \"$TARGET\" ] && [ -n \"$(ls -A \"$TARGET\")\" ]; then\n  echo \"$TARGET is not empty; choose another directory\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":"// treat failure as partial state and clean up\nif ! pulumi new ...; then\n  rm -rf \"$TARGET\"   # remove half-written project\n  exit 1\nfi","preventionTips":["Always scaffold into a fresh empty directory","Keep a stable network connection; template downloads are a common mid-run failure point","Read the wrapped root error above the 'incomplete' message to find the real cause"],"tags":["cli","onboarding","pulumi-new","partial-state"],"backgroundTag":"incomplete-project-scaffold","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}