pulumi/pulumi · error

no publisher specified and no default organization found, pl

Error message

no publisher specified and no default organization found, please set a publisher or set a default organization in your pulumi config

What it means

Returned when no `--publisher` flag was given, the backend successfully resolved a default organization, but the resolved value is an empty string. This means Pulumi Cloud cannot determine a default org for the user (e.g. the user belongs to no organizations or none is marked default), so the publisher for the template would be undefined.

Source

Thrown at pkg/cmd/pulumi/templatecmd/template_publish.go:140

	if err != nil {
		return err
	}

	_, err = b.GetCloudRegistry()
	if err != nil {
		return fmt.Errorf("backend does not support Private Registry operations: %w", err)
	}

	var publisher string
	if args.publisher != "" {
		publisher = args.publisher
	} else {
		publisher, err = b.GetDefaultOrg(ctx)
		if err != nil {
			return fmt.Errorf("failed to determine default organization: %w", err)
		}
		if publisher == "" {
			return errors.New(
				"no publisher specified and no default organization found, " +
					"please set a publisher or set a default organization in your pulumi config",
			)
		}
	}

	fmt.Fprintf(cmd.ErrOrStderr(), "Creating archive from directory: %s\n", templateDir)
	archiveBytes, err := archive.TGZ(absTemplateDir, "", true /*useDefaultExcludes*/)
	if err != nil {
		return fmt.Errorf("failed to create archive: %w", err)
	}
	archiveData := bytes.NewBuffer(archiveBytes)

	if err := tokens.ValidateProjectName(args.name); err != nil {
		return fmt.Errorf("invalid template name: %w", err)
	}

	fmt.Fprintf(cmd.ErrOrStderr(), "Publishing template %s/%s@%s...\n", publisher, args.name, version.String())

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Pass the publisher explicitly: --publisher your-org-name
  2. Set a default organization in your Pulumi Cloud account/organization settings
  3. Set the default org in pulumi config as instructed by the message
  4. Verify your org memberships with `pulumi org list` / the Pulumi Cloud UI

Example fix

// before
pulumi template publish ./tpl --name my-template --version 1.0.0
// after
pulumi template publish ./tpl --name my-template --version 1.0.0 --publisher acme
Defensive patterns

Strategy: validation

Validate before calling

org="$(pulumi whoami --org 2>/dev/null)"
if [ -z "$org" ]; then echo 'no default organization; pass --publisher' >&2; exit 1; fi

Prevention

When it happens

Trigger: `pulumi template publish <dir> --name x --version 1.0.0` (no --publisher) while logged in as a user account with no organizations or no default organization configured.

Common situations: New Pulumi accounts that never created/joined an org; personal accounts where the default org setting was never set; tokens minted for a user with org memberships but no default selected.

Related errors


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