{"record":{"id":"0e6adfe3bb41b11f","repo":"pulumi/pulumi","slug":"no-publisher-specified-and-no-default-organization-0e6adf","errorCode":null,"errorMessage":"no publisher specified and no default organization found, please set a publisher or set a default organization in your pulumi config","messagePattern":"no publisher specified and no default organization found, please set a publisher or set a default organization in your pulumi config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/templatecmd/template_publish.go","lineNumber":140,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = b.GetCloudRegistry()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"backend does not support Private Registry operations: %w\", err)\n\t}\n\n\tvar publisher string\n\tif args.publisher != \"\" {\n\t\tpublisher = args.publisher\n\t} else {\n\t\tpublisher, err = b.GetDefaultOrg(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to determine default organization: %w\", err)\n\t\t}\n\t\tif publisher == \"\" {\n\t\t\treturn errors.New(\n\t\t\t\t\"no publisher specified and no default organization found, \" +\n\t\t\t\t\t\"please set a publisher or set a default organization in your pulumi config\",\n\t\t\t)\n\t\t}\n\t}\n\n\tfmt.Fprintf(cmd.ErrOrStderr(), \"Creating archive from directory: %s\\n\", templateDir)\n\tarchiveBytes, err := archive.TGZ(absTemplateDir, \"\", true /*useDefaultExcludes*/)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create archive: %w\", err)\n\t}\n\tarchiveData := bytes.NewBuffer(archiveBytes)\n\n\tif err := tokens.ValidateProjectName(args.name); err != nil {\n\t\treturn fmt.Errorf(\"invalid template name: %w\", err)\n\t}\n\n\tfmt.Fprintf(cmd.ErrOrStderr(), \"Publishing template %s/%s@%s...\\n\", publisher, args.name, version.String())","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/templatecmd/template_publish.go#L122-L158","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Pass the publisher explicitly: --publisher your-org-name","Set a default organization in your Pulumi Cloud account/organization settings","Set the default org in pulumi config as instructed by the message","Verify your org memberships with `pulumi org list` / the Pulumi Cloud UI"],"exampleFix":"// before\npulumi template publish ./tpl --name my-template --version 1.0.0\n// after\npulumi template publish ./tpl --name my-template --version 1.0.0 --publisher acme","handlingStrategy":"validation","validationCode":"org=\"$(pulumi whoami --org 2>/dev/null)\"\nif [ -z \"$org\" ]; then echo 'no default organization; pass --publisher' >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --publisher explicitly for automation","Set a default organization in your Pulumi Cloud account settings","Verify org membership before first publish"],"tags":["configuration","organization","cli"],"backgroundTag":"missing-default-organization","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}