goharbor/harbor · error

not support Trigger

Error message

not support Trigger %s

What it means

Sentinel validation in retention UpdateRetention: the policy's trigger Kind is neither 'schedule' nor empty, so the controller cannot interpret how to re-arm the retention trigger. Raised on unsupported trigger kinds in an update request.

Solutions

  1. Use only the supported 'schedule' trigger kind for retention policies
  2. Omit the trigger kind for non-scheduled policies
  3. Update client code sending unsupported trigger kinds
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

		}
	} else {
		switch p.Trigger.Kind {
		case policy.TriggerKindSchedule:
			if p0.Trigger.Settings["cron"] != p.Trigger.Settings["cron"] {
				// unschedule old
				if len(p0.Trigger.Settings[policy.TriggerSettingsCron].(string)) > 0 {
					needUn = true
				}
				// schedule new
				if len(p.Trigger.Settings[policy.TriggerSettingsCron].(string)) > 0 {
					// valid cron
					needSch = true
				}
			}
		case "":

		default:
			return fmt.Errorf("not support Trigger %s", p.Trigger.Kind)
		}
	}
	if err = r.manager.UpdatePolicy(ctx, p); err != nil {
		return err
	}
	if needUn {
		err = r.scheduler.UnScheduleByVendor(ctx, schedulerVendorType, p.ID)
		if err != nil {
			return err
		}
	}
	if needSch {
		extras := make(map[string]any)
		_, err := r.scheduler.Schedule(ctx, schedulerVendorType, p.ID, "", p.Trigger.Settings[policy.TriggerSettingsCron].(string), SchedulerCallback, TriggerParam{
			PolicyID: p.ID,
			Trigger:  retention.ExecutionTriggerSchedule,
			// the operator of schedule job is harbor-jobservice
			Operator: secret.JobserviceUser,

View on GitHub (pinned to 7b2fd08cc5)