Tencent/WeKnora · warning

model is currently downloading

Error message

model is currently downloading

What it means

After fetching a model, GetModelByID only returns it when its status is ModelStatusActive. If the model row has status ModelStatusDownloading, the service refuses to serve it and returns errors.New("model is currently downloading"), because the model binary/config is not yet usable for inference. This is a transient state error — retrying later can succeed once the download completes.

Source

Thrown at internal/application/service/model.go:194

		return nil, err
	}

	// Check if model exists
	if model == nil {
		logger.Error(ctx, "Model not found")
		return nil, ErrModelNotFound
	}

	logger.Infof(ctx, "Model found, name: %s, status: %s", model.Name, model.Status)

	// Check model status
	if model.Status == types.ModelStatusActive {
		return model, nil
	}

	if model.Status == types.ModelStatusDownloading {
		logger.Warn(ctx, "Model is currently downloading")
		return nil, errors.New("model is currently downloading")
	}

	if model.Status == types.ModelStatusDownloadFailed {
		logger.Error(ctx, "Model download failed")
		return nil, errors.New("model download failed")
	}

	logger.Error(ctx, "Model status is abnormal")
	return nil, errors.New("abnormal model status")
}

// ListModels returns all models belonging to the tenant
func (s *modelService) ListModels(ctx context.Context) ([]*types.Model, error) {
	logger.Info(ctx, "Start listing models")

	tenantID := types.MustTenantIDFromContext(ctx)
	logger.Infof(ctx, "Listing models for tenant ID: %d", tenantID)

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Wait for the download to finish before using the model: poll the model status (e.g. via GetModelByID or a model list endpoint) until it becomes ModelStatusActive, then retry.
  2. If the download is stuck, inspect the model manager/worker logs for download errors and restart or re-trigger the download job.
  3. Add retry logic with backoff around calls that can hit this transient state, giving up after a timeout.
  4. If the model is not actually downloading, fix the stale status in the persistence layer (reset the row or re-run provisioning).

Example fix

// before
model, err := modelService.GetEmbeddingModel(ctx, modelID)
if err != nil { return nil, err }
// after
var model *types.Model
for i := 0; i < 30; i++ {
    model, err = modelService.GetEmbeddingModel(ctx, modelID)
    if err == nil { break }
    if !strings.Contains(err.Error(), "model is currently downloading") { return nil, err }
    time.Sleep(10 * time.Second)
}
Defensive patterns

Strategy: retry

Validate before calling

m, err := svc.GetModelByID(ctx, modelID)
if err == nil && m.Status == types.ModelStatusDownloading {
    // not ready yet — wait before calling again
}

Type guard

func isModelReady(m *types.Model) bool { return m != nil && m.Status == types.ModelStatusActive }

Try / catch

model, err := svc.GetModelByID(ctx, modelID)
if err != nil {
    if strings.Contains(err.Error(), "currently downloading") {
        // transient: schedule retry with backoff
    }
    return nil, err
}

Prevention

When it happens

Trigger: Calling GetModelByID/GetEmbeddingModel/GetRerankModel while the model's background download is still in progress (model.Status == types.ModelStatusDownloading), e.g. immediately after registering/creating a model that was queued for download.

Common situations: A tenant creates a model and immediately an embedding request references it; a deployment races its first request against model provisioning; a scheduled job starts before the model manager finishes downloading; a stale UI shows the model as selectable while it is still downloading.

Related errors


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