argoproj/argo-workflows · error

CodeBadRequest

CodeBadRequest

Error message

Invalid lock key: unknown format

What it means

DecodeLockName could not split the synchronization lock reference into its three slash-delimited parts (configmap-or-db, namespace, key). The name string has fewer than 3 segments, so it does not match the expected <type>/<namespace>/<key> encoding.

Source

Thrown at workflow/sync/lock_name.go:100

}

func (i *syncItem) lockName(wfNamespace string) (*lockName, error) {
	switch {
	case i.semaphore != nil:
		return getSemaphoreLockName(i.semaphore, wfNamespace)
	case i.mutex != nil:
		return getMutexLockName(i.mutex, wfNamespace), nil
	default:
		return nil, fmt.Errorf("cannot get lockName if not semaphore or mutex")
	}
}

func DecodeLockName(ctx context.Context, name string) (LockName, error) {
	log := logging.RequireLoggerFromContext(ctx)
	log.WithField("name", name).Info(ctx, "DecodeLockName")
	items := strings.SplitN(name, "/", 3)
	if len(items) < 3 {
		return nil, errors.New(errors.CodeBadRequest, "Invalid lock key: unknown format")
	}

	var lock lockName
	kind := lockKind(items[1])
	namespace := items[0]

	switch kind {
	case lockKindMutex, lockKindDatabase:
		lock = lockName{namespace: namespace, kind: kind, resourceName: items[2]}
	case lockKindConfigMap:
		components := strings.Split(items[2], "/")

		if len(components) != 2 {
			return nil, errors.New(errors.CodeBadRequest, "Invalid ConfigMap lock key: unknown format")
		}

		lock = lockName{namespace: namespace, kind: kind, resourceName: components[0], key: components[1]}
	default:

View on GitHub (pinned to 35bff19146)

Solutions

  1. Provide the lock name as namespace/configmap-name/key (or the DB-encoded form) with all three segments
  2. Check for double slashes or a missing namespace in the semaphore/mutex reference
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at workflow/sync/lock_name.go:100 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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