{"record":{"id":"c23348df1f8f3790","repo":"BoundaryML/baml","slug":"network-error-fetching-checksum-s-w","errorCode":null,"errorMessage":"network error fetching checksum %s: %w","messagePattern":"network error fetching checksum (.+?): %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/baml_go/lib_common.go","lineNumber":580,"sourceCode":"\n\tlogger.Debug(\"Setting permissions for library file\", \"path\", destPath, \"mode\", \"0755\")\n\tif err := os.Chmod(destPath, 0755); err != nil {\n\t\tlogger.Warn(\"Failed to set permissions (chmod 0755)\", \"path\", destPath, \"error\", err)\n\t}\n\n\tlogger.Info(\"Successfully downloaded and cached BAML library\", \"path\", destPath)\n\treturn nil\n}\n\n//orchestrion:ignore\nfunc downloadChecksum(checksumURL string, targetFilename string) (string, error) {\n\t// Use uninstrumented client to avoid Orchestrion crash during init()\n\t//orchestrion:ignore\n\thttpClient := uninstrumentedHTTPClient()\n\t//orchestrion:ignore\n\tresp, err := httpClient.Get(checksumURL)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"network error fetching checksum %s: %w\", checksumURL, err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == http.StatusNotFound {\n\t\tlogger.Debug(\"Checksum file not found (404)\", \"url\", checksumURL)\n\t\treturn \"\", fmt.Errorf(\"checksum file not found (404)\")\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"unexpected status %d fetching checksum %s\", resp.StatusCode, checksumURL)\n\t}\n\n\tbodyBytes, err := io.ReadAll(io.LimitReader(resp.Body, 4096))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error reading checksum body %s: %w\", checksumURL, err)\n\t}\n\n\tlines := strings.Split(string(bodyBytes), \"\\n\")\n\tfor _, line := range lines {","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/baml_go/lib_common.go#L562-L598","documentation":"downloadChecksum fetches the .sha256 file over HTTP; this error is returned when the HTTP client itself fails (DNS failure, connection refused, TLS error), wrapping the underlying error. It is deliberately raised with an uninstrumented HTTP client during init().","triggerScenarios":"httpClient.Get(checksumURL) returns a transport-level error: no network, DNS resolution failure, TLS handshake failure, or proxy misconfiguration.","commonSituations":"Developer is offline or behind a corporate proxy, DNS blocked for the distribution CDN host, or a firewall blocks the checksum endpoint while the main download URL is allowlisted.","solutions":["Check network connectivity and DNS resolution for the checksum host","Configure HTTP_PROXY/HTTPS_PROXY if behind a corporate proxy","Verify the checksum URL scheme/host is reachable (curl the URL)","Note the library tolerates missing checksums downstream; ensure upstream handling treats this as skippable verification"],"exampleFix":"// before\nresp, err := httpClient.Get(checksumURL)\n// after (caller-side): tolerate missing checksum with a warning\nif checksum, cerr := downloadChecksum(url, name); cerr != nil {\n    logger.Warn(\"Checksum unavailable, skipping verification\", \"err\", cerr)\n} else { _ = checksum }","handlingStrategy":"retry","validationCode":"resp, err := http.Get(checksumURL)\nif err == nil { resp.Body.Close() } // probe reachability before install","typeGuard":null,"tryCatchPattern":"if checksum, err := downloadChecksum(url, name); err != nil {\n    logger.Warn(\"checksum fetch failed, skipping verification\", \"err\", err)\n    // optionally retry with backoff before giving up\n}","preventionTips":["Verify DNS/proxy reachability of the artifact host in CI before installs","Set HTTP(S)_PROXY correctly in restricted networks","Add exponential-backoff retries around checksum/download","Treat missing checksums as non-fatal with a logged warning"],"tags":["network","http","checksum","dns"],"backgroundTag":"network-request-failed","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}