goharbor/harbor · error

purge job with id not found

Error message

purge job with id %d not found

What it means

Vendor-type guard in GetPurgeJob: the execution referenced by purge_id either does not exist or, when it exists, its VendorType is not the purge-audit-log vendor — meaning the ID points at an execution of some other kind (e.g. replication or retention), which cannot be returned as a purge job and is reported as not found.

Solutions

  1. Use an execution ID obtained from the purge audit log history endpoint
  2. Confirm the ID is not an execution of another vendor type (replication, scan, retention)
  3. List purge executions first and pick the correct purge_id
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/server/v2.0/handler/purge.go:212 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/f6a1e0c3cc6e73c1. Report an issue: GitHub.

Appendix: source

Thrown at src/server/v2.0/handler/purge.go:212

	}

	return purge.NewGetPurgeHistoryOK().
		WithXTotalCount(total).
		WithLink(p.Links(ctx, params.HTTPRequest.URL, total, query.PageNumber, query.PageSize).String()).
		WithPayload(results)
}

func (p *purgeAPI) GetPurgeJob(ctx context.Context, params purge.GetPurgeJobParams) middleware.Responder {
	if err := p.RequireSystemAccess(ctx, rbac.ActionRead, rbac.ResourcePurgeAuditLog); err != nil {
		return p.SendError(ctx, err)
	}

	exec, err := p.executionCtl.Get(ctx, params.PurgeID)
	if err != nil {
		return p.SendError(ctx, err)
	}
	if exec.VendorType != job.PurgeAuditVendorType {
		return p.SendError(ctx, fmt.Errorf("purge job with id %d not found", params.PurgeID))
	}

	extraAttrsString, err := json.Marshal(exec.ExtraAttrs)
	if err != nil {
		return p.SendError(ctx, err)
	}

	res := &model.ExecHistory{
		ID:         exec.ID,
		Name:       job.PurgeAuditVendorType,
		Kind:       exec.Trigger,
		Parameters: string(extraAttrsString),
		Status:     exec.Status,
		Schedule: &model.ScheduleParam{
			Type: exec.Trigger,
		},
		CreationTime: exec.StartTime,
		UpdateTime:   exec.UpdateTime,

View on GitHub (pinned to 7b2fd08cc5)