{"record":{"id":"b0c89c3f8792d375","repo":"pulumi/pulumi","slug":"invalid-column-number-v","errorCode":null,"errorMessage":"invalid column number %v","messagePattern":"invalid column number (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/deploy/source_eval.go","lineNumber":2073,"sourceCode":"\t\tcontract.Assertf(filepath.IsAbs(projectRoot), \"projectRoot is not an absolute path\")\n\t\tprojectRoot = filepath.Clean(projectRoot)\n\t}\n\treturn &sourcePositions{projectRoot: projectRoot}\n}\n\nfunc (s *sourcePositions) parseSourcePosition(raw *pulumirpc.SourcePosition) (string, error) {\n\tif raw == nil {\n\t\treturn \"\", nil\n\t}\n\n\tif raw.Line < 0 {\n\t\treturn \"\", fmt.Errorf(\"invalid line number %v\", raw.Line)\n\t}\n\n\tcol := \"\"\n\tif raw.Column != 0 {\n\t\tif raw.Column < 0 {\n\t\t\treturn \"\", fmt.Errorf(\"invalid column number %v\", raw.Column)\n\t\t}\n\t\tcol = \",\" + strconv.FormatInt(int64(raw.Column), 10)\n\t}\n\n\tposURL, err := url.Parse(raw.Uri)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif posURL.Scheme != \"file\" {\n\t\treturn \"\", fmt.Errorf(\"unrecognized scheme %q\", posURL.Scheme)\n\t}\n\n\tfile := filepath.FromSlash(posURL.Path)\n\tif !filepath.IsAbs(file) {\n\t\treturn \"\", errors.New(\"source positions must include absolute paths\")\n\t}\n\trel, err := filepath.Rel(s.projectRoot, file)\n\tif err != nil {","sourceCodeStart":2055,"sourceCodeEnd":2091,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/source_eval.go#L2055-L2091","documentation":"Same validation path as the line-number error: when converting a gRPC SourcePosition, a non-zero but negative Column value is rejected because column positions must be positive. This indicates the language host sent a malformed source location.","triggerScenarios":"A language host supplies SourcePosition with Column < 0 while building eval/register RPCs — from buggy column tracking in the host's parser/AST mapping or malformed hand-built requests.","commonSituations":"Outdated or third-party language plugins with faulty column computation; custom codegen tooling constructing SourcePosition incorrectly; protocol fuzzer/adversarial clients.","solutions":["Upgrade the offending language host/plugin to a version with correct column tracking","Set Column to 0 (meaning absent) when the column is unknown, instead of a negative sentinel","Fix the custom host/tooling to clamp columns to >= 0 before sending the RPC"],"exampleFix":"// before\npos := &pulumirpc.SourcePosition{Uri: uri, Line: 10, Column: -3}\n// after\npos := &pulumirpc.SourcePosition{Uri: uri, Line: 10, Column: 0}","handlingStrategy":"validation","validationCode":"// in custom hosts/tooling, validate before sending:\nif raw.Column < 0 { raw.Column = 0 }","typeGuard":"func validSourcePosition(p *pulumirpc.SourcePosition) bool {\n    return p == nil || (p.Line >= 0 && p.Column >= 0)\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid column number\") {\n    // retry without the column or with Column set to 0\n}","preventionTips":["Use 0 (not -1) to mean 'no column'","Keep language host column-tracking logic tested","Validate SourcePosition in shared host libraries before RPC dispatch"],"tags":["grpc","validation","source-position"],"backgroundTag":"invalid-source-position","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}