{"record":{"id":"bc9847ce020102c5","repo":"cloudflare/cloudflared","slug":"couldn-t-parse-index-from-timeout-hop-w-bc9847","errorCode":null,"errorMessage":"couldn't parse index from timeout hop: %w","messagePattern":"couldn't parse index from timeout hop: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diagnostic/network/collector_windows.go","lineNumber":52,"sourceCode":"\treturn decodeNetworkOutputToFile(command, DecodeLine)\n}\n\nfunc DecodeLine(text string) (*Hop, error) {\n\tconst requestTimedOut = \"Request timed out.\"\n\n\tfields := strings.Fields(text)\n\tparts := []string{}\n\tfilter := func(s string) bool { return s != \"*\" && s != \"ms\" }\n\n\tfor _, field := range fields {\n\t\tif filter(field) {\n\t\t\tparts = append(parts, field)\n\t\t}\n\t}\n\n\tindex, err := strconv.ParseUint(parts[0], 10, 8)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't parse index from timeout hop: %w\", err)\n\t}\n\n\tdomain := \"\"\n\trtts := []time.Duration{}\n\n\tfor _, part := range parts[1:] {\n\n\t\trtt, err := strconv.ParseFloat(strings.TrimLeft(part, \"<\"), 64)\n\n\t\tif err != nil {\n\t\t\tdomain += part + \" \"\n\t\t} else {\n\t\t\trtts = append(rtts, time.Duration(rtt*MicrosecondsFactor))\n\t\t}\n\t}\n\n\tdomain, _ = strings.CutSuffix(domain, \" \")\n\t// If the domain is equal to \"Request timed out.\" then we build a","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/diagnostic/network/collector_windows.go#L34-L70","documentation":"DecodeLine (Windows) parses tracert output lines, expecting the first field to be the numeric hop index. When strconv.ParseUint fails on parts[0], the line does not match the expected tracert format and this wrapped error is returned, failing the decode of Windows network diagnostics.","triggerScenarios":"Decoding a tracert line whose first token is not a number: tracert header lines ('Tracing route to ...'), 'Request timed out' summary lines, or localized tracert output where formatting differs from the expected parser.","commonSituations":"Windows systems with a non-English locale where tracert output wording/layout differs; tracert variants or third-party tools emitting different formats; header/warning lines reaching the timeout-hop parse branch.","solutions":["Run tracert on the affected machine and compare its exact output with what the parser expects.","Set the system/process locale to English or ensure consistent output (chcp 65001 / localized format differences).","Ensure the standard Windows tracert.exe is used, not a third-party substitute in PATH.","In a patch, skip non-hop lines instead of failing the whole decode."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify expected tracert output shape before decoding\nout, err := exec.Command(\"tracert\", \"-d\", \"-h\", \"1\", \"127.0.0.1\").Output()\nif err != nil || !strings.Contains(string(out), \"\\n\") {\n\t// unexpected tracert environment\n}","typeGuard":null,"tryCatchPattern":"hops, _, err := network.Collect(ctx, cfg)\nvar numErr *strconv.NumError\nif errors.As(err, &numErr) {\n\t// non-numeric hop index: check tracert locale/variant\n}","preventionTips":["Use the standard Windows tracert.exe (check PATH for substitutes)","Standardize system locale/English output on hosts running diagnostics","Verify tracert output manually on new Windows images","Keep the diagnostic package current for Windows format changes"],"tags":["diagnostics","network","tracert","windows","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}