DAG Rules (DAG)¶
Code DAG is used for errors related to the DAG in a template.
DAG101 Duplicate task names¶
The template contains multiple tasks with the same name.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: steps-
spec:
entrypoint: hello-hello
templates:
- name: hello-hello
dag:
tasks:
- name: hello
template: print-message
arguments:
parameters:
- name: message
value: "hello-1"
- name: hello
template: print-message
arguments:
parameters:
- name: message
value: "hello-2"
DAG102 Duplicate input parameters¶
The task contains several input parameters (<task>.arguments.parameters) that share the same name,
which means the parameter was set multiple times.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: test-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: hello
template: print-message
arguments:
parameters:
- name: message
value: "hello"
- name: message
value: "world"
DAG103 Duplicate input artifacts¶
The task includes several input artifacts (<task>.arguments.artifacts) that share the same name.
The artifact was set multiple times.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: test-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process-data
template: data-processor
arguments:
artifacts:
- name: input-data
raw:
data: "data-1"
- name: input-data
raw:
data: "data-2"
DAG201 Self-referencing task¶
The task references the current template in the template field. This may cause an infinite loop.
Since this can still be intentional, this rule defaults to warning level.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: main
DAG202 Reference to a non-existent template¶
The task references a template that does not exist in the workflow.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: not-exist-template
DAG301 Invalid parameter reference¶
A task input parameter contains a reference that cannot be resolved. This rule builds on VAR201 Unknown Argo workflow variable reference but narrows the report to the task argument where the typo or mismatch occurs.
DAG302 Invalid artifact reference¶
A task input artifact points to an artifact that is not available in the current context.
This can happen with bare references (inputs.artifacts.foo) or templated expressions ({{ inputs.artifacts.foo }}) when the name is misspelled or simply not defined.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: compute
arguments:
artifacts:
- name: data
from: "{{ inputs.artifacts.not-exist }}"
DAG303 Invalid raw artifact reference¶
A task input artifact uses the raw block to embed a template expression, but the expression does not resolve to a known parameter.
Raw artifacts only support parameter references (e.g. {{ inputs.parameters.foo }}); pointing at artifacts leaves the expression unresolved.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: compute
arguments:
artifacts:
- name: data
raw:
data: "{{ inputs.artifacts.any }}"
DAG304 Unexpected argument parameters¶
The task provides parameters that the referenced template does not declare. Remove the extra entries or update the target template so both sides align.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: print-message
arguments:
parameters:
- name: message
value: hello
- name: extra-param
value: ignored
- name: print-message
inputs:
parameters:
- name: message
- name: role
default: user
DAG305 Missing argument parameters¶
The task skips parameters that are required by the referenced template. Ensure every parameter without a default or static value on the template side is provided by the task.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: print-message
- name: print-message
inputs:
parameters:
- name: message
DAG306 Unexpected argument artifacts¶
The task provides artifacts that the referenced template does not declare. Remove the extra entries or update the target template so both sides align.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: data-processor
arguments:
artifacts:
- name: input-data
raw:
data: "data"
- name: extra-artifact
raw:
data: "ignored"
- name: data-processor
inputs:
artifacts:
- name: input-data
DAG307 Missing required argument artifacts¶
The task skips artifacts that are required by the referenced template. Ensure every artifact without a default or static value on the template side is provided by the task.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
template: data-processor
- name: data-processor
inputs:
artifacts:
- name: input-data
DAG401 Invalid task definition¶
The task definition is invalid according to the schema. This can happen when fields have the wrong type or unexpected values.
For example, nested a dag inside a task is not allowed:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: process
inline:
dag:
tasks: []
DAG901 Deprecated Field: onExit¶
The onExit field in a task definition is deprecated.
As of Argo Workflows 3.1, onExit is deprecated by the hooks field.
This rule is a variant of STP901 Deprecated Field: onExit specific to DAG templates.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: build
onExit: exit
template: run-build
- name: run-build
container:
image: alpine
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: build
template: run-build
hooks:
exit:
template: cleanup