Tencent/WeKnora · error

MinerU Cloud task failed: %s

Error message

MinerU Cloud task failed: %s

What it means

During polling in pollBatchResult, MinerU Cloud reported the extraction task state as "failed"; item.ErrMsg carries the server-side failure reason (unsupported file, corrupted document, internal error).

Source

Thrown at internal/infrastructure/docparser/mineru_cloud_converter.go:251

		if len(items) == 0 {
			if pollCount <= 3 || pollCount%10 == 0 {
				logger.Infof(context.Background(), "[MinerUCloud] poll #%d: extract_result empty, retrying", pollCount)
			}
			sleepCtx(ctx, defaultPollInterval)
			continue
		}

		item := items[0]
		state := strings.ToLower(item.State)

		if pollCount == 1 || pollCount%10 == 0 || state == "done" || state == "failed" {
			logger.Infof(context.Background(), "[MinerUCloud] poll #%d: file=%s state=%s pages=%d/%d",
				pollCount, item.FileName, state, item.Progress.ExtractedPages, item.Progress.TotalPages)
		}

		if state == "failed" {
			return "", nil, fmt.Errorf("MinerU Cloud task failed: %s", item.ErrMsg)
		}

		if state == "done" {
			return c.extractDoneResult(ctx, &item)
		}

		sleepCtx(ctx, defaultPollInterval)
	}

	return "", nil, fmt.Errorf("MinerU Cloud task timed out after %d polls", pollCount)
}

func (c *MinerUCloudReader) fetchBatchStatus(ctx context.Context, batchID string, headers map[string]string) ([]extractResultItem, error) {
	url := fmt.Sprintf("%s/extract-results/batch/%s", c.baseURL, batchID)
	httpReq, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
	if err != nil {
		return nil, err
	}

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Read the embedded ErrMsg for the cloud-side reason
  2. Validate the uploaded file opens and is a supported type
  3. Resubmit the parse job if the failure was transient
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/infrastructure/docparser/mineru_cloud_converter.go:251 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/63c26e04e1573f9d. Report an issue: GitHub.