argoproj/argo-workflows · error

invalid version

Error message

invalid version

What it means

nodeOffloadRepo.Delete requires the version string of the offloaded node status to prevent deleting newer rows than the caller observed (optimistic-concurrency style deletion). An empty version means the caller has no snapshot to match, so the repo refuses to run the DELETE.

Source

Thrown at persist/sqldb/offload_node_status_repo.go:216

		}
		x = make(map[string][]string)
		for _, r := range records {
			x[r.UID] = append(x[r.UID], r.Version)
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	return x, nil
}

func (wdc *nodeOffloadRepo) Delete(ctx context.Context, uid, version string) error {
	if uid == "" {
		return fmt.Errorf("invalid uid")
	}
	if version == "" {
		return fmt.Errorf("invalid version")
	}
	logCtx := wdc.log.WithFields(logging.Fields{"uid": uid, "version": version})
	logCtx.Debug(ctx, "Deleting offloaded nodes")
	return wdc.sessionProxy.With(ctx, func(s db.Session) error {
		rs, err := s.SQL().
			DeleteFrom(wdc.tableName).
			Where(db.Cond{"clustername": wdc.clusterName}).
			And(db.Cond{"uid": uid}).
			And(db.Cond{"version": version}).
			Exec()
		if err != nil {
			return err
		}
		rowsAffected, err := rs.RowsAffected()
		if err != nil {
			return err
		}
		logCtx.WithField("rowsAffected", rowsAffected).Debug(ctx, "Deleted offloaded nodes")

View on GitHub (pinned to 35bff19146)

Solutions

  1. Read and pass the workflow's OffloadNodeStatusVersion (or the version recorded when offloading) into Delete
  2. Skip deletion if the workflow was never offloaded (no version present)
  3. Log and skip with a clearer error in the caller when version is empty

Example fix

// before
err := offloadRepo.Delete(ctx, uid, wf.Status.OffloadNodeStatusVersion)
// after
if wf.Status.OffloadNodeStatusVersion == "" {
    log.Info(ctx, "workflow %s not offloaded, skipping delete", uid)
    return nil
}
err := offloadRepo.Delete(ctx, uid, wf.Status.OffloadNodeStatusVersion)
Defensive patterns

Strategy: validation

Validate before calling

if version == "" {
    return fmt.Errorf("cannot delete offloaded node status for %s: no offload version recorded (was it offloaded?)", uid)
}
err := offloadRepo.Delete(ctx, uid, version)

Prevention

When it happens

Trigger: Calling Delete(ctx, uid, "") — e.g. a node-status unoffload path where the version was never read from the workflow's Status.Conditions/OffloadNodeStatusVersion, or a zero-value struct was passed along.

Common situations: Deleting offloaded node status for a workflow that was never offloaded (so no version recorded); hydration code that forgot to read the offload node status version from the workflow status before deleting; upgrading from a version where version tracking did not exist.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/277d1f666e164f28. Report an issue: GitHub.