pulumi/pulumi · error

%w Your new project in %s is incomplete

Error message

%w
Your new project in %s is incomplete

What it means

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.

Source

Thrown at pkg/cmd/pulumi/auth/onboarding.go:130

	}

	// `pulumi new --dir` changes the working directory, so resolve the target while we still can.
	if abs, err := filepath.Abs(target); err == nil {
		target = abs
	}

	newCmd := newcmd.NewNewCmd()
	newCmd.SetArgs(args)
	// `pulumi new`'s usage text and error reporting belong to `pulumi login`'s caller here.
	newCmd.SilenceUsage = true
	newCmd.SilenceErrors = true

	// `pulumi new` can fail before it writes anything or long after, and returns a bare error
	// either way. We don't have to tell those apart: target was empty before this ran, so anything
	// in it now is a half-written project the user should know about.
	err := newCmd.ExecuteContext(ctx)
	if err != nil && newcmd.ErrorIfNotEmptyDirectory(target) != nil {
		return fmt.Errorf("%w\nYour new project in %s is incomplete", err, target)
	}
	return err
}

// suggestDirectories completes a partially typed path against the directories it could name, so
// the prompt answers <tab> the way a shell would.
func suggestDirectories(toComplete string) []string {
	// Glob only fails on a malformed pattern, for which no suggestions is the right answer.
	matches, _ := filepath.Glob(toComplete + "*")

	dirs := make([]string, 0, len(matches))
	for _, match := range matches {
		if info, err := os.Stat(match); err == nil && info.IsDir() {
			dirs = append(dirs, match)
		}
	}
	return dirs
}

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Inspect the target directory and delete the partial project (or clean its contents) before retrying
  2. Rerun the onboarding/new command against a fresh empty directory
  3. Check the wrapped root error (shown above the message) for the actual cause — network, template, or permissions

Example fix

// before
rm -rf ./my-incomplete-project && pulumi new   # retry in clean dir
// after (or fix the root cause and continue in place)
cd ./my-incomplete-project && pulumi install
Defensive patterns

Strategy: try-catch

Validate before calling

// shell: pre-check target dir is empty before onboarding
if [ -d "$TARGET" ] && [ -n "$(ls -A "$TARGET")" ]; then
  echo "$TARGET is not empty; choose another directory"; exit 1
fi

Try / catch

// treat failure as partial state and clean up
if ! pulumi new ...; then
  rm -rf "$TARGET"   # remove half-written project
  exit 1
fi

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Related errors


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