{"record":{"id":"a9a792feea7b52bc","repo":"pulumi/pulumi","slug":"invalid-s-name-q","errorCode":null,"errorMessage":"invalid %s name %q","messagePattern":"invalid (.+?) name %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/packagecmd/package_info.go","lineNumber":249,"sourceCode":"// writeDescription renders the full schema description below a Description label, inline when it\n// fits on one line.\nfunc writeDescription(stdout io.Writer, color colors.Colorization, comment string) {\n\tdescription := schemainfo.RenderDescription(comment)\n\tif description == \"\" {\n\t\treturn\n\t}\n\tlabel := schemainfo.Bold(color, \"Description\")\n\tif strings.Contains(description, \"\\n\") {\n\t\tfmt.Fprintf(stdout, label+\":\\n%s\\n\", description)\n\t} else {\n\t\tfmt.Fprintf(stdout, label+\": %s\\n\", description)\n\t}\n}\n\nfunc simplifyModuleName(typ string, name string) (string, error) {\n\tsplit := strings.Split(name, \":\")\n\tif len(split) < 3 {\n\t\treturn \"\", fmt.Errorf(\"invalid %s name %q\", typ, name)\n\t}\n\tmoduleSplit := strings.Split(split[1], \"/\")\n\treturn split[0] + \":\" + moduleSplit[0] + \":\" + split[2], nil\n}\n\nfunc showModuleInfo(spec *schema.PackageSpec, moduleName string, stdout io.Writer, color colors.Colorization) error {\n\tbold := func(s string) string { return schemainfo.Bold(color, s) }\n\tfmt.Fprintf(stdout, bold(\"Name\")+\": %s\\n\", spec.Name)\n\tfmt.Fprintf(stdout, bold(\"Module\")+\": %s\\n\", moduleName)\n\tfmt.Fprintf(stdout, bold(\"Version\")+\": %s\\n\", spec.Version)\n\tfmt.Fprintf(stdout, bold(\"Description\")+\": %s\\n\", schemainfo.Summarize(spec.Description))\n\n\tresources := make(map[string]schema.ResourceSpec)\n\tfor res, spec := range spec.Resources {\n\t\tsimplifiedName, err := simplifyModuleName(\"resource\", res)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/packagecmd/package_info.go#L231-L267","documentation":"This error comes from `pulumi package info` when parsing a schema member token (resource or function name) in `simplifyModuleName` (pkg/cmd/pulumi/packagecmd/package_info.go:249). Pulumi tokens use the `pkg:module:member` format, e.g. `aws:s3/bucket:Bucket`; a token with fewer than three colon-separated segments cannot be split into package, module, and member parts. The CLI refuses to process such a malformed token rather than silently misattributing it to a module.","triggerScenarios":"Running `pulumi package info <pkg> --module <m>` against a package schema whose Resources or Functions map contains a key without the `pkg:module:member` shape (fewer than 2 colons). The loop at package_info.go:263-293 calls simplifyModuleName(\"resource\", res) / simplifyModuleName(\"function\", fun) for every key in spec.Resources / spec.Functions.","commonSituations":"Inspecting a hand-edited, older, or third-party provider schema with nonstandard tokens (e.g. `aws:Bucket` or `bucket` instead of `aws:s3/bucket:Bucket`); schemas generated by tooling that does not follow the Pulumi token convention.","solutions":["Check the offending token with `pulumi package info <pkg>` (top-level listing) and identify the malformed key in the schema JSON","Fix the provider/schema so every resource and function token has the `pkg:module:member` form","Regenerate the schema (pulumi-tfgen / provider build) after fixing token generation","If the schema is third-party, report the malformed token to the provider maintainer"],"exampleFix":"// malformed token in schema\n\"aws:Bucket\": {...}\n// after — full pkg:module:member token\n\"aws:s3/bucket:Bucket\": {...}","handlingStrategy":"validation","validationCode":"// before running `pulumi package info --module`\nparts := strings.Split(token, \":\")\nif len(parts) < 3 {\n    return fmt.Errorf(\"token %q must be pkg:module:member\", token)\n}","typeGuard":"func isWellFormedToken(name string) bool {\n\tparts := strings.Split(name, \":\")\n\treturn len(parts) == 3 && parts[0] != \"\" && parts[1] != \"\" && parts[2] != \"\"\n}","tryCatchPattern":null,"preventionTips":["Never hand-edit schema token keys; always regenerate via the provider toolchain","Validate schema JSON against the Pulumi metaschema before inspecting with package info","Spot-check tokens in the schema with a quick grep for keys lacking two colons"],"tags":["cli","pulumi-package-info","schema","token-format"],"backgroundTag":"invalid-resource-token-format","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}