{"record":{"id":"a62b100a3373bf54","repo":"goreleaser/goreleaser","slug":"could-not-apply-templates-w-a62b10","errorCode":null,"errorMessage":"could not apply templates: %w","messagePattern":"could not apply templates: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pipe/mcp/mcp.go","lineNumber":100,"sourceCode":"\tif strings.TrimSpace(disable) == \"auto\" && ctx.Semver.Prerelease != \"\" {\n\t\treturn pipe.Skip(\"prerelease detected with 'auto' disable, skipping mcp publish\")\n\t}\n\n\twarnExperimental()\n\n\tif err := tmpl.New(ctx).ApplyAll(\n\t\t&mcp.Name,\n\t\t&mcp.Description,\n\t\t&mcp.Title,\n\t\t&mcp.Homepage,\n\t\t&mcp.Repository.URL,\n\t\t&mcp.Repository.Source,\n\t\t&mcp.Repository.ID,\n\t\t&mcp.Repository.Subfolder,\n\t\t&mcp.Auth.Type,\n\t\t&mcp.Auth.Token,\n\t); err != nil {\n\t\treturn fmt.Errorf(\"could not apply templates: %w\", err)\n\t}\n\n\tprovider, err := p.authProviderFn(\n\t\tp.registry,\n\t\tmcp.Auth.Type,\n\t\tmcp.Auth.Token,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not login: %w\", err)\n\t}\n\tif err := provider.Login(ctx); err != nil {\n\t\treturn fmt.Errorf(\"could not login: %w\", err)\n\t}\n\tdefer func() {\n\t\t// logout...\n\t\t_ = os.Remove(gitHubTokenFilePath)\n\t\t_ = os.Remove(registryTokenFilePath)\n\t}()","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/goreleaser/goreleaser/blob/f5edd7395693c0c6b501dc722d445d2e86af854d/internal/pipe/mcp/mcp.go#L82-L118","documentation":"Wrapped error in the MCP pipe's Publish: the batched tmpl.ApplyAll over the mcp section's string fields (name, description, title, homepage, repository.*, auth.*) failed on at least one field. The %w chain names which template expression was invalid.","triggerScenarios":"Thrown at internal/pipe/mcp/mcp.go:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix invalid template syntax or unknown fields in the mcp config (name, description, title, urls, auth)","Use only variables available in the publish environment","Run goreleaser check to validate the mcp section"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f5edd7395693c0c6b501dc722d445d2e86af854d","analyzedAt":"2026-09-05T09:57:18.807Z","contentChangedAt":"2026-09-05T09:57:18.807Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}