{"record":{"id":"b583788e1283b048","repo":"XTLS/Xray-core","slug":"proxy-tag-is-not-set","errorCode":null,"errorMessage":"Proxy tag is not set.","messagePattern":"Proxy tag is not set\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_internet.go","lineNumber":322,"sourceCode":"\t\t\t\tMaxIncomingStreams:      c.FinalMask.QuicParams.MaxIncomingStreams,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn config, nil\n}\n\ntype ProxyConfig struct {\n\tTag string `json:\"tag\"`\n\n\t// TransportLayerProxy: For compatibility.\n\tTransportLayerProxy bool `json:\"transportLayer\"`\n}\n\n// Build implements Buildable.\nfunc (v *ProxyConfig) Build() (*internet.ProxyConfig, error) {\n\tif v.Tag == \"\" {\n\t\treturn nil, errors.New(\"Proxy tag is not set.\")\n\t}\n\treturn &internet.ProxyConfig{\n\t\tTag:                 v.Tag,\n\t\tTransportLayerProxy: v.TransportLayerProxy,\n\t}, nil\n}\n","sourceCodeStart":304,"sourceCodeEnd":329,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_internet.go#L304-L329","documentation":"Thrown by ProxyConfig.Build() when a proxy settings block is present but its \"tag\" field is empty. The tag is the identifier other config sections (inbounds/outbounds/rules) use to reference this proxy, so an empty tag makes the entry unusable and is rejected at build time.","triggerScenarios":"\"streamSettings\": { \"sockopt\"... } style block containing \"proxySettings\": { \"transportLayer\": true } without a \"tag\"; or an explicit \"tag\": \"\".","commonSituations":"Enabling transportLayer forwarding but forgetting to point it at an outbound tag; renaming/deleting the referenced outbound while leaving proxySettings; YAML-to-JSON conversions dropping empty strings differently than expected.","solutions":["Add a non-empty \"tag\" to the proxySettings block, e.g. the tag of the outbound that should handle the proxied traffic.","Verify that tag exists in outbounds (or wherever it is meant to point).","If proxying is not needed, remove the proxySettings block entirely."],"exampleFix":"// before\n\"proxySettings\": { \"transportLayer\": true }\n// after\n\"proxySettings\": { \"tag\": \"warp\", \"transportLayer\": true }","handlingStrategy":"validation","validationCode":"func proxyTagSet(ss map[string]any) bool {\n    ps, ok := ss[\"proxySettings\"].(map[string]any)\n    if !ok { return true } // no block, fine\n    tag, _ := ps[\"tag\"].(string)\n    return strings.TrimSpace(tag) != \"\"\n}","typeGuard":"func hasProxySettings(ss map[string]any) bool {\n    _, ok := ss[\"proxySettings\"]\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Whenever proxySettings (or transportLayer) is added, immediately set tag to a real outbound tag.","When renaming outbounds, grep for the old tag in proxySettings too.","Validate tag non-emptiness in your config linter."],"tags":["go","xray","config","proxy","tag","validation"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}