Tencent/WeKnora · error

http list-engines failed

Error message

http list-engines failed: %w

What it means

Transport error in HTTPDocumentReader.ListEngines: the HTTP client's Do() for the list-engines POST failed (connection refused, timeout, DNS). The %w wraps the network-level error so the docreader outage cause stays visible; it is raised before the status-code check distinguishes non-200 responses.

Solutions

  1. Verify the docreader service is running and reachable
  2. Check address, DNS, and TLS configuration
  3. Retry once the service is available
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/infrastructure/docparser/http_parser.go:151 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/047f4f12b8ffbb6a. Report an issue: GitHub.

Appendix: source

Thrown at internal/infrastructure/docparser/http_parser.go:151

	if err := secutils.ValidateURLForSSRF(base); err != nil {
		return nil, fmt.Errorf("docreader address failed SSRF validation: %w", err)
	}

	body := httpListEnginesRequest{ConfigOverrides: overrides}
	jsonBody, err := json.Marshal(body)
	if err != nil {
		return nil, fmt.Errorf("http marshal list-engines request: %w", err)
	}

	httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, base+PathListEngines, bytes.NewReader(jsonBody))
	if err != nil {
		return nil, fmt.Errorf("http new request: %w", err)
	}
	httpReq.Header.Set("Content-Type", "application/json")

	resp, err := p.client.Do(httpReq)
	if err != nil {
		return nil, fmt.Errorf("http list-engines failed: %w", err)
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		respBytes, _ := io.ReadAll(resp.Body)
		return nil, fmt.Errorf("http list-engines status %d: %s", resp.StatusCode, string(respBytes))
	}

	var out httpListEnginesResponse
	if err := json.NewDecoder(resp.Body).Decode(&out); err != nil {
		return nil, fmt.Errorf("http decode list-engines response: %w", err)
	}

	result := make([]types.ParserEngineInfo, 0, len(out.Engines))
	for _, e := range out.Engines {
		result = append(result, types.ParserEngineInfo{
			Name:              e.Name,
			Description:       e.Description,
			FileTypes:         e.FileTypes,

View on GitHub (pinned to 988cbb0330)