argoproj/argo-workflows · error

Failed to create artifact driver: %v

Error message

Failed to create artifact driver: %v

What it means

The server builds a storage driver for the artifact via artDriverFactory using the artifact's location and the caller's Kubernetes client (for secret lookups). If driver construction fails — usually missing/invalid credentials or an unsupported/invalid location configuration — the upload returns HTTP 500 with this message.

Source

Thrown at server/artifacts/artifact_server.go:261

	}

	// Create a copy of the artifact for uploading (using artifactCopy which has resolved location)
	outputArtifact := artifactCopy.DeepCopy()
	if setErr := outputArtifact.SetKey(newKey); setErr != nil {
		http.Error(w, fmt.Sprintf("Failed to set artifact key: %v", setErr), http.StatusInternalServerError)
		return
	}

	a.logger.WithFields(logging.Fields{
		"originalKey": originalKey,
		"newKey":      newKey,
	}).Info(ctx, "Uploading artifact with new key")

	// Get the driver for the artifact
	kubeClient := auth.GetKubeClient(ctx)
	driver, err := a.artDriverFactory(ctx, outputArtifact, resources{kubeClient, namespace})
	if err != nil {
		http.Error(w, fmt.Sprintf("Failed to create artifact driver: %v", err), http.StatusInternalServerError)
		return
	}

	// Upload using SaveStream
	if err := driver.SaveStream(ctx, file, outputArtifact); err != nil {
		http.Error(w, fmt.Sprintf("Failed to save artifact: %v", err), http.StatusInternalServerError)
		return
	}

	a.logger.WithFields(logging.Fields{
		"artifactName": artifactName,
		"key":          newKey,
	}).Info(ctx, "Successfully uploaded artifact")

	// Return only name/key. The resolved ArtifactLocation contains bucket
	// endpoints and Secret selector names that the client does not need.
	response := map[string]any{
		"name": artifactName,

View on GitHub (pinned to 35bff19146)

Solutions

  1. Verify the credentials Secret referenced by the artifact location exists in the workflow namespace and has the expected keys.
  2. Check RBAC: the client calling the upload (auth.GetKubeClient) must be able to read that Secret.
  3. Validate the artifactRepository config (endpoint, region, bucket, secretKeySelector) against the driver's requirements.
  4. Confirm the storage backend type is supported/enabled; the full driver error is included in the HTTP 500 body.

Example fix

// before: secret missing
# no secret 'my-argo-s3-credentials' in namespace
// after
kubectl -n my-ns create secret generic my-argo-s3-credentials \
  --from-literal=accessKey=... --from-literal=secretKey=...
Defensive patterns

Strategy: validation

Validate before calling

# Credentials Secret must exist and be readable in the workflow namespace
kubectl -n $NS get secret $ARTIFACT_SECRET \
  || echo "credentials secret $ARTIFACT_SECRET missing in $NS"
argo auth token  # confirm the identity you upload with can read that secret

Try / catch

try {
  await uploadArtifact(...)
} catch (e) {
  if (e.status === 500 && e.body.includes('Failed to create artifact driver')) {
    // credentials/RBAC/config problem; inspect appended driver error, do not blind-retry
    await verifySecretAndRbac(namespace);
  }
}

Prevention

When it happens

Trigger: The s3/gcs/azure/oss Secret referenced by the artifact (accessKey/secretKey, serviceAccountKeySecret, etc.) is missing or unreadable with the caller's RBAC; the artifact location specifies an unsupported type reaching the factory; invalid endpoint/region configuration causing driver init to fail.

Common situations: Artifact repository credentials not deployed to the namespace; users uploading with an SSO/client token whose service account lacks secret get permissions; misconfigured artifactRepository in the controller configmap (wrong secret name or key); storage backend not enabled in the Argo build.

Related errors


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