goharbor/harbor · error

execution not found

Error message

execution %d not found

What it means

Guard in OperateRetentionExec: execMgr.Get returned a nil execution for the given ID, meaning the retention execution does not exist and cannot be operated on.

Solutions

  1. Verify the execution ID is correct and still retained
  2. Check whether the execution was already completed and cleaned up
  3. List current retention executions to find the valid ID
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

		} else if num == 0 {
			// no candidates, mark the execution as done directly
			if err := r.execMgr.MarkDone(ctx, id, "no resources for retention"); err != nil {
				logger.Errorf("failed to mark done for the execution %d: %v", id, err)
			}
		}
	}()

	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
}

View on GitHub (pinned to 7b2fd08cc5)