Tencent/WeKnora · error

weknoracloud docreader task cancelled

Error message

weknoracloud docreader task cancelled

What it means

Fired in pollTaskResult when the task reports status "cancelled" but carries no error detail — a generic sentinel message meaning the remote read task was cancelled server-side without an explanation.

Source

Thrown at internal/infrastructure/docparser/weknoracloud_http_reader.go:202

				logger.Errorf(ctx, "[WeKnoraCloud] task_id=%s completed with result.error: %s", taskID, res.Error)
			} else {
				logger.Debugf(ctx, "[WeKnoraCloud] task_id=%s completed ok markdownLen=%d", taskID, len(res.MarkdownContent))
			}
			return res, nil
		case "failed":
			if taskResp.Error != "" {
				logger.Errorf(context.Background(), "[WeKnoraCloud] task_id=%s failed: %s", taskID, taskResp.Error)
				return nil, fmt.Errorf("weknoracloud docreader task failed: %s", taskResp.Error)
			}
			logger.Errorf(context.Background(), "[WeKnoraCloud] task_id=%s failed: %s", taskID, taskResp.Message)
			return nil, fmt.Errorf("weknoracloud docreader task failed: %s", taskResp.Message)
		case "cancelled":
			if taskResp.Error != "" {
				logger.Errorf(context.Background(), "[WeKnoraCloud] task_id=%s cancelled: %s", taskID, taskResp.Error)
				return nil, fmt.Errorf("weknoracloud docreader task cancelled: %s", taskResp.Error)
			}
			logger.Errorf(context.Background(), "[WeKnoraCloud] task_id=%s cancelled", taskID)
			return nil, fmt.Errorf("weknoracloud docreader task cancelled")
		}
		if err := pollCtx.Err(); err != nil {
			logger.Errorf(ctx, "[WeKnoraCloud] poll task_id=%s aborted before sleep: %v", taskID, err)
			return nil, err
		}

		// Exponential backoff: multiply by 1.5 each time, cap at maxPollInterval
		select {
		case <-pollCtx.Done():
			logger.Errorf(ctx, "[WeKnoraCloud] poll task_id=%s stopped: %v", taskID, pollCtx.Err())
			return nil, pollCtx.Err()
		case <-time.After(currentInterval):
			// Update interval for next iteration
			nextInterval := time.Duration(float64(currentInterval) * 1.5)
			if nextInterval > p.maxPollInterval {
				nextInterval = p.maxPollInterval
			}
			currentInterval = nextInterval

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Resubmit the read request if cancellation was unintended
  2. Check service logs on the WeKnoraCloud side for the task_id
  3. Look for quota or lifecycle policies that cancel tasks
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at internal/infrastructure/docparser/weknoracloud_http_reader.go:202 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/5ee68332105da590. Report an issue: GitHub.