argoproj/argo-workflows · error

--type must be either 'database' or 'configmap'

Error message

--type must be either 'database' or 'configmap'

What it means

validateFlags checks the --type flag of sync limit commands against the known SyncConfigType enum values (database, configmap). This generic validation guard fires when the user passes any other --type string (including an empty one), rejecting the command before a request is sent to the server.

Source

Thrown at cmd/argo/commands/sync/util.go:12

package sync

import (
	"fmt"
	"strings"

	syncpkg "github.com/argoproj/argo-workflows/v4/pkg/apiclient/sync"
)

func validateFlags(syncType, cmName string) error {
	if _, ok := syncpkg.SyncConfigType_value[syncType]; !ok {
		return fmt.Errorf("--type must be either 'database' or 'configmap'")
	}

	if syncType == syncpkg.SyncConfigType_CONFIGMAP.String() && cmName == "" {
		return fmt.Errorf("--cm-name is required when type is configmap")
	}

	return nil
}

func printSyncLimit(key, cmName, namespace string, limit int32, syncType syncpkg.SyncConfigType) {
	fmt.Printf("Key: %s\n", key)
	fmt.Printf("Type: %s\n", strings.ToLower(syncType.String()))
	if syncType == syncpkg.SyncConfigType_CONFIGMAP {
		fmt.Printf("ConfigMap Name: %s\n", cmName)
	}
	fmt.Printf("Namespace: %s\n", namespace)
	fmt.Printf("Limit: %d\n", limit)
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Pass --type database or --type configmap
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/argo/commands/sync/util.go:12 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/51a514a8f3f7e69f. Report an issue: GitHub.