{"record":{"id":"c24e516a1d86b633","repo":"pulumi/pulumi","slug":"organization-name-must-not-contain-slashes","errorCode":null,"errorMessage":"organization name must not contain slashes","messagePattern":"organization name must not contain slashes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/policy/policy_publish.go","lineNumber":99,"sourceCode":"\tif len(args) > 0 {\n\t\torgName = args[0]\n\t} else if len(args) == 0 {\n\t\torg, err := b.GetDefaultOrg(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\torgName = org\n\t}\n\n\t//\n\t// Construct a policy pack reference of the form `<org-name>/<policy-pack-name>`\n\t// with the org name and an empty policy pack name. The policy pack name is empty\n\t// because it will be determined as part of the publish operation. If the org name\n\t// is empty, the current user account is used.\n\t//\n\n\tif strings.Contains(orgName, \"/\") {\n\t\treturn errors.New(\"organization name must not contain slashes\")\n\t}\n\tpolicyPackRef := orgName + \"/\"\n\n\t//\n\t// Obtain current PolicyPack, tied to the Pulumi Cloud backend.\n\t//\n\n\tpolicyPack, err := requirePolicyPackForBackend(ctx, policyPackRef, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//\n\t// Load metadata about the current project.\n\t//\n\n\tpwd, err := cmd.getwd()\n\tif err != nil {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/policy/policy_publish.go#L81-L117","documentation":"`pulumi policy publish` accepts an organization name as the publish target; because the policy pack reference is built as '<orgName>/', a slash inside the org name would produce a malformed pack reference. The CLI rejects any org name containing '/' before constructing it.","triggerScenarios":"`pulumi policy publish <org>/<something>` — passing a fully-qualified path-like value, a URL fragment, or an accidental paste like 'my-org/policy' instead of just the organization name.","commonSituations":"Copy-pasting a full policy pack reference or URL into the org argument; confusing `pulumi policy publish <org>` with commands that take '<org>/<pack>' style arguments; scripting with variables that contain trailing path components.","solutions":["Pass only the org name: `pulumi policy publish my-org`","Strip any path components from your variable before invoking (e.g. `${org%%/*}` in bash)","Publish without arguments to derive the org from the project/config instead","Validate org names in scripts with a check like `[[ $org != */* ]]`"],"exampleFix":"// before\npulumi policy publish my-org/mypack\n// after\npulumi policy publish my-org","handlingStrategy":"validation","validationCode":"[[ \"$ORG\" != */* ]] || { echo \"organization name must not contain slashes: $ORG\"; exit 1; }","typeGuard":null,"tryCatchPattern":"if err := cmd.Run(); err != nil {\n\tif strings.Contains(err.Error(), \"must not contain slashes\") {\n\t\t// strip path components from the org argument and retry\n\t}\n}","preventionTips":["Pass only the bare org name to `pulumi policy publish`","Sanitize variables: org=\"${input%%/*}\"","Never paste full pack references/URLs where an org name is expected"],"tags":["cli","validation","policy","arguments"],"backgroundTag":"invalid-argument-format","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}