{"record":{"id":"a3045f78abbd5dec","repo":"XTLS/Xray-core","slug":"no-querystrategy-available-for","errorCode":null,"errorMessage":"no QueryStrategy available for ","messagePattern":"no QueryStrategy available for ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/dns/dns.go","lineNumber":149,"sourceCode":"\n\t\tserveStale := config.ServeStale\n\t\tif ns.ServeStale != nil {\n\t\t\tserveStale = *ns.ServeStale\n\t\t}\n\n\t\tserveExpiredTTL := config.ServeExpiredTTL\n\t\tif ns.ServeExpiredTTL != nil {\n\t\t\tserveExpiredTTL = *ns.ServeExpiredTTL\n\t\t}\n\n\t\ttag := defaultTag\n\t\tif len(ns.Tag) > 0 {\n\t\t\ttag = ns.Tag\n\t\t}\n\n\t\tclientIPOption := ResolveIpOptionOverride(ns.QueryStrategy, ipOption)\n\t\tif !clientIPOption.IPv4Enable && !clientIPOption.IPv6Enable {\n\t\t\treturn nil, errors.New(\"no QueryStrategy available for \", ns.Address)\n\t\t}\n\n\t\tclient, err := NewClient(ctx, ns, myClientIP, disableCache, serveStale, serveExpiredTTL, tag, clientIPOption, updateRules)\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"failed to create client\").Base(err)\n\t\t}\n\t\tclients = append(clients, client)\n\t}\n\n\tvar domainMatcher geodata.DomainMatcher\n\tif len(effectiveRules) > 0 {\n\t\tdomainMatcher, err = geodata.DomainReg.BuildDomainMatcher(effectiveRules)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// If there is no DNS client in config, add a `localhost` DNS client","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/app/dns/dns.go#L131-L167","documentation":"While serializing a padding turn, the record length varint is written into an in-memory bytes.Buffer and this error wraps that write failing. bytes.Buffer.Write can never return a non-nil error (it only panics on too-large buffers), and Varint record lengths are bounded by maxPaddingTurnLength (8 MiB), so in practice this error is unreachable defensive code.","triggerScenarios":"No realistic trigger in the shipped code paths; would require a bytes.Buffer implementation whose Write returns an error or a corrupted Varint type.","commonSituations":"Custom forks that replace bytes.Buffer with a different io.Writer in the header path; none in the upstream layout.","solutions":["Treat occurrences as a code-integrity signal: inspect local modifications to writePaddingTurnWithBuffer or the Varint type","Revert experimental changes to the header serialization path"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := writePaddingTurn(w, turn, prefix); err != nil && strings.Contains(err.Error(), \"write padding header\") {\n    // unreachable in stock code; treat as local fork integrity issue\n    log.Fatal(\"padding header serialization failed - inspect local modifications\")\n}","preventionTips":["Do not replace bytes.Buffer in the header path with error-returning writers","Keep Varint bounded inputs unchanged"],"tags":["padding","unreachable","defensive","xmc"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}