Tencent/WeKnora · error

API status %d: %s

Error message

API status %d: %s

What it means

Protocol error in PaddleOCRVLCloudReader.submitJob: the OCR submission endpoint returned a non-200 status. The full response body was read and is embedded (%d status, %s body) so the service's error explanation is visible; fires when the endpoint is reachable but rejects the job submission.

Source

Thrown at internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go:154

	writer.Close()

	httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL, &body)
	if err != nil {
		return "", fmt.Errorf("create request: %w", err)
	}
	httpReq.Header.Set("Authorization", "bearer "+c.token)
	httpReq.Header.Set("Content-Type", writer.FormDataContentType())

	client := utils.NewSSRFSafeHTTPClient(utils.SSRFSafeHTTPClientConfig{Timeout: 60 * time.Second, MaxRedirects: 5})
	resp, err := client.Do(httpReq)
	if err != nil {
		return "", fmt.Errorf("HTTP request: %w", err)
	}
	defer resp.Body.Close()

	respBody, _ := io.ReadAll(resp.Body)
	if resp.StatusCode != http.StatusOK {
		return "", fmt.Errorf("API status %d: %s", resp.StatusCode, string(respBody))
	}

	var result paddleOCRVLCloudSubmitResponse
	if err := json.Unmarshal(respBody, &result); err != nil {
		return "", fmt.Errorf("decode response: %w", err)
	}
	if result.Data.JobID == "" {
		return "", fmt.Errorf("API returned no jobId: %s", string(respBody))
	}

	logger.Infof(context.Background(), "[PaddleOCR-VL Cloud] job submitted: jobId=%s", result.Data.JobID)
	return result.Data.JobID, nil
}

// --- polling ---

type paddleOCRVLCloudPollResponse struct {
	Data struct {

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Inspect the embedded body for the server's reason
  2. Verify the bearer token and file constraints
  3. Retry for 5xx; fix auth/request for 4xx
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go:154 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/bb5afb2049efcb70. Report an issue: GitHub.