goharbor/harbor · error

not support action

Error message

not support action %s

What it means

Guard in OperateRetentionExec: the action string is not 'stop' (the only supported operation), so the requested execution action is rejected.

Solutions

  1. Use the supported action 'stop' when operating on retention executions
  2. Extend the switch if new actions (e.g. restart) are needed
  3. Fix client code sending unsupported action values
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/controller/retention/controller.go:308 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/20abb2e069cff873. Report an issue: GitHub.

Appendix: source

Thrown at src/controller/retention/controller.go:308

	}()

	return id, err
}

// OperateRetentionExec Operate Retention Execution
func (r *defaultController) OperateRetentionExec(ctx context.Context, eid int64, action string) error {
	e, err := r.execMgr.Get(ctx, eid)
	if err != nil {
		return err
	}
	if e == nil {
		return fmt.Errorf("execution %d not found", eid)
	}
	switch action {
	case "stop":
		return r.launcher.Stop(ctx, eid)
	default:
		return fmt.Errorf("not support action %s", action)
	}
}

// GetRetentionExec Get Retention Execution
func (r *defaultController) GetRetentionExec(ctx context.Context, executionID int64) (*retention.Execution, error) {
	e, err := r.execMgr.Get(ctx, executionID)
	if err != nil {
		return nil, err
	}

	return convertExecution(e), nil
}

// ListRetentionExecs List Retention Executions
func (r *defaultController) ListRetentionExecs(ctx context.Context, policyID int64, query *q.Query) ([]*retention.Execution, error) {
	query = q.MustClone(query)
	query.Keywords["VendorType"] = job.RetentionVendorType
	query.Keywords["VendorID"] = policyID

View on GitHub (pinned to 7b2fd08cc5)