-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expression results are printed incorrectly at random #6673
Comments
Well, this has me flummoxed. This is some more minimal YAML: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: hello-world
spec:
entrypoint: main
arguments:
parameters:
- name: config
value: '{"a": "1"}'
templates:
- name: main
container:
image: docker/whalesay
command:
- cowsay
args: [ "{{=jsonpath(workflow.parameters.config, '$.a')}}" ] All code around marshalling parameters is nasty, just the investigation has taken me 2h and I've really gotten nowhere. I'm going to leave this unfixed. |
Ah - one question - i could not reproduce this without using |
I only observed this issue with |
This works consistently (sample size ~10): args: [ "{{=jsonpath(workflow.parameters['config'], '$.a')}}" ] I bet sometimes the value of
Since that's not proper expr, it's failing. That's my theory anyway. |
I did wonder about that. Quoting is nasty in expressions. It's basically broken and we have many random calls to quote/unquote. |
This might be fixed by this: |
@terrytangyuan would you like to try #6442? |
Tested against that branch. Reproduced the issue 1/20 times. Soooo 🤷 |
I was thinking if it is only
|
Here's another more interesting example (note that
Results are different for every workflow:
So I doubt that it has something to do with jsonpath since even |
Ok. So not just jsonpath. What about, is this only expression tag templates? Does it affect the old style ones? |
Also, does it happen for examples without quotes? |
So far I only see it in expression tag templates.
For the example above, looks like if I replace the value by
|
I'm not sure what you can do with |
Does it also happen when the values do not also contain |
I haven't observed related issues yet. The majority of the use cases involves using curly braces though. |
OK. I think if we see a case where curly braces are not involved, we discus then. |
More minimal repo: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: hello-world-
spec:
entrypoint: main
arguments:
parameters:
- name: a
# quotes seem to be important
value: "v"
templates:
- name: main
container:
image: docker/whalesay
command:
- cowsay
args: [ '{{=workflow.parameters.a}}' ] |
Could be related to #6285. |
Could be fixed by #6442, if this is quoting issue. |
I think I've found the issue: |
@samene @ThSchrad @terrytangyuan I think I've tracked this issue down. I'll create a PR today and see if we can merge to master later on for testing. |
Signed-off-by: Alex Collins <alex_collins@intuit.com>
@alexec Nice! Thanks for tracking it down! |
…proj#6786) Signed-off-by: Alex Collins <alex_collins@intuit.com> Signed-off-by: kriti-sc <kathuriakriti1@gmail.com>
Summary
The container prints out the result correctly (see the printed "1" below).
However, it sometimes (1 out of 5 times) prints out the raw expression instead (see
{{=jsonpath(workflow.parameters.config, \ \ '$.a')}
below):Reproducible workflow YAML:
Diagnostics
👀 Yes! We need all of your diagnostics, please make sure you add it all, otherwise we'll go around in circles asking you for it:
What Kubernetes provider are you using?
k3d
What version of Argo Workflows are you running?
v3.2.0-rc1
What executor are you running? Docker/K8SAPI/Kubelet/PNS/Emissary
PNS
Did this work in a previous version? I.e. is it a regression?
Haven't checked.
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: