argoproj / argoproj/argo-workflows
`malformed workflow template: quantities must match the regular expression` for `resources.requests.storage`
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 138
Description
### Pre-requisites
- [X] I have double-checked my configuration
- [X] I have tested with the `:latest` image tag (i.e. `quay.io/argoproj/workflow-controller:latest`) and can confirm the issue still exists on `:latest`. If not, I have explained why, **in detail**, in my description below.
- [X] I have searched existing issues and could not find a match for this bug
- [ ] I'd like to contribute the fix myself (see [contributing guide](https://github.com/argoproj/argo-workflows/blob/main/docs/CONTRIBUTING.md))
### What happened? What did you expect to happen?
argo workflow version: https://github.com/argoproj/argo-workflows/blob/main/manifests/quick-start-minimal.yaml
kubernetes version: 1.22.15
yaml example:
```yaml
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: nginx
spec:
arguments:
parameters:
- name: DISK_SIZE
entrypoint: nginx
templates:
- name: nginx
container:
image: nginx:latest
volumeMounts:
- mountPath: /usr/share/nginx/html/
name: html
volumes:
- name: html
ephemeral:
volumeClaimTemplate:
spec:
accessModes: [ "ReadWriteMany" ]
storageClassName: nfs-client
resources:
requests:
#storage: "30Gi"
storage: "{{workflow.parameters.DISK_SIZE}}"
---
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: nginx-workflow
spec:
workflowTemplateRef:
name: nginx
arguments:
parameters:
- name: DISK_SIZE
value: "30Gi"
```
Test yaml, workflow error:
### Version(s)
main
### Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
```YAML
Test yaml, workflow error: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'
```
### Logs from the workflow controller
```text
time="2024-07-17T05:00:49.373Z" level=info msg="Persistence configuration disabled"
time="2024-07-17T05:00:49.373Z" level=info executorImage="quay.io/argoproj/argoexec:latest" executorImagePullPolicy= managedNamespace=
time="2024-07-17T05:01:35.357Z" level=info msg="Alloc=6263 TotalAlloc=925869 Sys=28005 NumGC=559 Goroutines=175"
time="2024-07-17T05:06:35.364Z" level=info msg="Alloc=6946 TotalAlloc=929892 Sys=28005 NumGC=561 Goroutines=175"
time="2024-07-17T05:11:35.356Z" level=info msg="Alloc=6129 TotalAlloc=934040 Sys=28005 NumGC=564 Goroutines=176"
time="2024-07-17T05:16:35.357Z" level=info msg="Alloc=6811 TotalAlloc=937786 Sys=28005 NumGC=566 Goroutines=176"
time="2024-07-17T05:21:35.357Z" level=info msg="Alloc=6122 TotalAlloc=941692 Sys=28005 NumGC=569 Goroutines=176"
time="2024-07-17T05:22:26.469Z" level=info msg="Processing workflow" Phase= ResourceVersion=11598301 namespace=default workflow=nginx-workflow
time="2024-07-17T05:22:26.469Z" level=info msg="Updated phase -> Error" namespace=default workflow=nginx-workflow
time="2024-07-17T05:22:26.469Z" level=info msg="Updated message -> malformed workflow template \"default/nginx\": quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'" namespace=default workflow=nginx-workflow
time="2024-07-17T05:22:26.469Z" level=error msg="was unable to obtain node for nginx-workflow" namespace=default workflow=nginx-workflow
time="2024-07-17T05:22:26.469Z" level=info msg="Marking workflow completed" namespace=default workflow=nginx-workflow
time="2024-07-17T05:22:26.469Z" level=error msg="Unable to set ExecWorkflow" error="malformed workflow template \"default/nginx\": quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'" namespace=default workflow=nginx-workflow
time="2024-07-17T05:22:26.469Z" level=info msg="Workflow to be dehydrated" Workflow Size=927
time="2024-07-17T05:22:26.479Z" level=info msg="Workflow update successful" namespace=default phase=Error resourceVersion=11598302 workflow=nginx-workflow
time="2024-07-17T05:26:35.356Z" level=info msg="Alloc=6900 TotalAlloc=945779 Sys=28005 NumGC=571 Goroutines=176"
time="2024-07-17T05:31:35.356Z" level=info msg="Alloc=6087 TotalAlloc=949681 Sys=28005 NumGC=574 Goroutines=176"
```
### Logs from in your workflow's wait container
```text
kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
```
Contributor guide
Research direction
Start by reproducing the issue with the YAML example and compare the parameterized value with the literal value in manifests/quick-start-minimal.yaml. Trace validation of WorkflowTemplate resources.requests.storage and parameter substitution, then add a regression test showing that a parameter resolving to "30Gi" is accepted without the quantity error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- backend, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100