argoproj/argo-workflows · error
unsupported db type %s
Error message
unsupported db type %s
What it means
workflowArchive.ListWorkflows switches on the configured r.dbType (MySQL vs Postgres) to build the archive query. If dbType holds anything else the SQL dialect is unknown, so it returns an explicit unsupported-db-type error instead of emitting invalid SQL.
Source
Thrown at persist/sqldb/workflow_archive.go:248
selectQuery := baseSelector.Columns(
db.Raw("coalesce(metadata->>'labels', '{}') as labels"),
db.Raw("coalesce(metadata->>'annotations', '{}') as annotations"),
db.Raw("coalesce(status->>'progress', '') as progress"),
"suspend",
db.Raw("coalesce(arguments::text, '{}') as arguments"),
db.Raw("coalesce(status->>'message', '') as message"),
db.Raw("coalesce(status->>'estimatedDuration', '0') as estimatedduration"),
db.Raw("coalesce(status->>'resourcesDuration', '{}') as resourcesduration"),
)
return s.SQL().
Iterator("WITH workflows AS ? ?", cteSelector, selectQuery.From("workflows")).
All(&archivedWfs)
}); err != nil {
return nil, err
}
default:
return nil, fmt.Errorf("unsupported db type %s", r.dbType)
}
wfs := make(wfv1.Workflows, len(archivedWfs))
for i, md := range archivedWfs {
labels := make(map[string]string)
if err := json.Unmarshal([]byte(md.Labels), &labels); err != nil {
return nil, err
}
// For backward compatibility, we should label workflow retrieved from DB as Persisted.
labels[common.LabelKeyWorkflowArchivingStatus] = "Persisted"
annotations := make(map[string]string)
if err := json.Unmarshal([]byte(md.Annotations), &annotations); err != nil {
return nil, err
}
t := md.CreationTimestamp
View on GitHub (pinned to 35bff19146)
Solutions
- Set the persistence config DBType to exactly "mysql" or "postgres" (check ARGO_ARCHIVE_* env vars / configmap)
- Check how the persistence config is parsed and what value the env var actually holds
- If using a custom DB, add a case for it in the ListWorkflows switch
Example fix
// before env: "postgres" # DBType // after env: "postgres" → change config to: DBType: "postgres" (exact spelling accepted by sqldb)
Defensive patterns
Strategy: validation
Validate before calling
import "github.com/argoproj/argo-workflows/v4/persist/sqldb"
// accept only values the library understands
if dbType != "mysql" && dbType != "postgres" {
return fmt.Errorf("DBType must be mysql or postgres, got %q", dbType)
}
archive, err := sqldb.NewWorkflowArchive(session, offloadRepo, instanceID, dbType) Try / catch
wf, err := archiveClient.ListArchivedWorkflows(ctx, req)
if err != nil && strings.Contains(err.Error(), "unsupported db type") {
// fix deployment config; not retryable
return fmt.Errorf("archive misconfigured: %w", err)
} Prevention
- Pin DBType in your deployment config to the exact strings mysql/postgres
- Validate persistence config in CI before deploy
- Document accepted DBType values in your ops runbook
When it happens
Trigger: Creating the archive repo with a DBType string that is neither "mysql" nor "postgres" (it is set from the ARGO_ARCHIVE_PROBE_DBTYPE / persistence config env vars).
Common situations: Typo in the persistence configuration (e.g. "postgresql", "postgres", "MySQL" casing variants depending on how config is parsed); missing env var causing a stale or empty dbType; custom builds wiring an in-memory or other DB without a case in the switch.
Related errors
- operation %v is not supported
- getting archived workflows not supported
- deleting archived workflows not supported
- maxRetries cannot be less than 0
- baseDelay cannot be less than 0
AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03).
Data as JSON: /api/errors/2af1d735c7672916.
Report an issue: GitHub.