{"record":{"id":"69c31946b7252ec7","repo":"pulumi/pulumi","slug":"the-tag-command-does-not-accept-versions-69c319","errorCode":null,"errorMessage":"the tag command does not accept versions","messagePattern":"the tag command does not accept versions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/esc/cli/env_tag_mv.go","lineNumber":48,"sourceCode":"\t\tArgs:    cobra.ExactArgs(3),\n\t\tShort:   \"Move an environment tag\",\n\t\tLong: \"Move an environment tag\\n\" +\n\t\t\t\"\\n\" +\n\t\t\t\"This command updates a tag with the given name on the specified environment, \" +\n\t\t\t\"changing it's name.\\n\",\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := cmd.Context()\n\n\t\t\tif err := env.esc.getCachedClient(ctx); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tref, args, err := env.getExistingEnvRef(ctx, args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif ref.version != \"\" {\n\t\t\t\treturn errors.New(\"the tag command does not accept versions\")\n\t\t\t}\n\n\t\t\tname := args[0]\n\t\t\tnewName := args[1]\n\t\t\tif name == \"\" {\n\t\t\t\treturn errors.New(\"environment tag name cannot be empty\")\n\t\t\t}\n\t\t\tif newName == \"\" {\n\t\t\t\treturn errors.New(\"environment tag value cannot be empty\")\n\t\t\t}\n\n\t\t\ttag, err := env.esc.client.GetEnvironmentTag(ctx, ref.orgName, ref.projectName, ref.envName, name)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tst := style.NewStylist(style.Profile(env.esc.stdout))\n","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/esc/cli/env_tag_mv.go#L30-L66","documentation":"`esc env tag mv` (rename a tag) does not operate on revisions, so a version-qualified environment reference is rejected. After resolving args via getExistingEnvRef, a non-empty ref.version yields this error before validating the tag name arguments.","triggerScenarios":"Running `esc env tag mv <org>/<project>/<env>@<version> <oldName> <newName>` — any `@version` suffix in the environment reference.","commonSituations":"Script reuse from version-aware env commands; assuming tag renames are version-scoped like environment content; a shared REF variable that includes @latest.","solutions":["Use the unversioned environment reference: esc env tag mv org/project/env old new","Strip the @version segment before invoking the command","Rename tags once at the environment level; the change applies to the environment resource, not revisions"],"exampleFix":"// before\nesc env tag mv org/proj/env@v2 owner team\n// after\nesc env tag mv org/proj/env owner team","handlingStrategy":"validation","validationCode":"ref=\"$1\"; case \"$ref\" in *@*) echo \"strip the @version suffix for tag mv\"; exit 1;; esac","typeGuard":"func hasVersion(ref string) bool { return strings.Contains(ref, \"@\") }","tryCatchPattern":null,"preventionTips":["Always rename tags on unversioned env refs","Centralize env-ref construction in scripts and keep versions out of tag flows","Document that tags are environment-level, not revision-level"],"tags":["cli","validation","esc-environments"],"backgroundTag":"version-not-supported","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}