-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Error constructing app status patch: unable to find api field in struct RawExtension for the json field \"autoscaling\" #15126
Comments
Application yaml for one exhibiting the problem: |
Found these issues that look relevant:
|
I've bumped into this today as well, on 2 applications installing Istio and Mimir. I don't yet see any pattern, it seems to be happening randomly on various fields. I've checked the Application resources, and the This is Argo 2.8.0. {
"Version": "v2.8.0+804d4b8",
"BuildDate": "2023-08-07T14:25:33Z",
"GitCommit": "804d4b8ca6bc4c2cf02c5c971aa923ec5b8623f0",
"GitTreeState": "clean",
"GoVersion": "go1.20.6",
"Compiler": "gc",
"Platform": "linux/amd64",
"KustomizeVersion": "v5.1.0 2023-06-19T16:58:18Z",
"HelmVersion": "v3.12.1+gf32a527",
"KubectlVersion": "v0.24.2",
"JsonnetVersion": "v0.20.0"
} |
I managed to reproduce this consistently. This only happens if the Steps:
Expected: App syncs and refreshes correctly. Actual Result: The app refresh breaks. Go to the UI and hit Refresh. The Refresh button will be greyed out. The error is visible in the controller logs. I've managed to also reproduce this by running Argo locally. Strategicmerge shouldn't be used for Unstructured dataThis is an older issue also found in Helm, and fixed here. The fix is to use the json merge for Unstructured data, because it seems that the strategicmerge functionality isn't meant to be used on CRDs or other unstructured inputs. I'll work on a PR to address it this week. Meanwhile, the workaround could be to quote all values, including numbers. |
Brilliantly diagnosed. Looking forward to the PR, thanks @vladfr! |
…j#15126) Signed-off-by: Vlad Fratila <[email protected]>
…j#15126) Signed-off-by: Vlad Fratila <[email protected]>
@crenshaw-dev added a PR, tests are passing, feedback is welcomed! |
is it going to be available in 2.8.5 ? Would def help a lot to work with valuesObject! |
We encounter the problem too. This prevents us from using the valuesObject, which would simplify our deployment-pipelines a lot |
@vladfr We also experience this problem. It would be great to be able to use valueObjects. Any idea when this will be merged? |
tbh I'm fairly concerned about changing the patch calculation mechanism in a patch release since it changes how every single reconciliation works. I wonder if there's an interim solution to avoid the problem for just this field, but leave the rest of the patch calculation untouched. Then we can switch over to the new mechanism entirely in 2.9. |
Yes, that's my thinking as well. I'm working on the change for just this
field, I should be ready soon.
…On Mon, 18 Sept 2023, 20:01 Michael Crenshaw, ***@***.***> wrote:
tbh I'm fairly concerned about changing the patch calculation mechanism in
a patch release since it changes how every single reconciliation works.
I wonder if there's an interim solution to avoid the problem for *just
this field*, but leave the rest of the patch calculation untouched. Then
we can switch over to the new mechanism entirely in 2.9.
—
Reply to this email directly, view it on GitHub
<#15126 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABT5B62FWOUEUJGHDUCMPDX3B45ZANCNFSM6AAAAAA3YB66W4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Is there any progress? |
Any target release planned ? |
currently running on 2.8.5 and seeing this. Also seems to lock up refreshing and messes with application health status. I see that #15227 hasn't been merged yet so I imagine this is still an issue in 2.9.X? Are there any plans on getting that merged? |
I'm running app version |
I suppose there will be patch versions for 2.8 and 2.9 ? |
Using application sets to generate applications, but even quoting in the applicationset template all the valuesObject values is not fix for us, as all the quotes disappear in generated Application manifest. So seems we have to stay with values: only multiline string. |
I believe this PR needs to be modified to only calculate json patches (instead of strategic merge patches) for changes to the Right now the PR changes the patch calculation logic for every single field, which seems likely excessive. |
We just discoverd this problem by accident .. I just happened to be tailing our logs. Is there any metric that ArgoCD reports when it has an error like this? I couldn't find anything in the argocd application controller metrics. :/ |
I hit this problem after upgrading ArgoCD server and the cli from v2.7.2 to v2.9.2. It seems that, after v2.8.0, the cli generates the yaml with |
Here is a simple search regex that should catch argo application and argo application set. You can use search:
replace:
Once the fix is out you simply do it in reverse (note the escaping of the pipe)
replace:
|
Thank you for the issue and debug efforts! We are also hitting this issue in version |
We use the app of apps pattern with kustomization patches, so the |
I'm confused - this issue should exclusively impact people who use argocd applications with a helm |
On another note; some more debugging of this issue: While looking into the the kubernetes documentation on RawExtension, which is the type used to define the So - the reason other operators don't have these issues might be something as simple as the fact that they don't use the
Overall, I do think this requires a proper discussion with some ArgoCD maintainers - would love to hear some thoughts :) |
I'm pretty new the ArgoCD and was interested and mildly frustrated to find that my apps fail once and then seem to never change state. We also use the ValuesObject to pass config in to a helm chart for just about all our apps. I'd be happy to help where I can with information. It makes it rather annoying and pointless to see the state of an app as always red. |
indeed, weird how this issue hasn't been tackled for this long. personally i switched from |
|
Yes, we are using the |
As a workaround, we ended up putting in a |
@garyiwu just got hit by this bug, can you share the example of your plugin? Our whole cluster is down, so everyone is scrambling to migrate. |
This works for our application layout. You might need to tailor to suit.
|
@Kyle-Cooley Aha, gotcha - so you use kustomize to deploy your applications, which then deploy helm charts with valuesObjects. And you need the valuesObjects for patches. All clear - thanks for clarifying! |
I get your confusion too. Unfortunately, even if the fix for this issue is simple, the way it integrates with the rest of ArgoCD is not. I'm not aware of any other project that does such complex difffing. I am still in favor of doing the fix. As shown by other people here, |
Building on top of what @garyiwu shared, I've added the following two patch files to my kustomize build for argocd.
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-repo-server
spec:
template:
spec:
containers:
- name: my-plugin
image: busybox
command: ["/var/run/argocd/argocd-cmp-server"]
securityContext:
runAsNonRoot: true
runAsUser: 999
volumeMounts:
- name: var-files
mountPath: /var/run/argocd
- name: plugins
mountPath: /home/argocd/cmp-server/plugins
- name: my-plugin-config
mountPath: /home/argocd/cmp-server/config/plugin.yaml
subPath: plugin.yaml
- name: cmp-tmp
mountPath: /tmp
volumes:
- name: my-plugin-config
configMap:
name: my-plugin-config
- name: cmp-tmp
emptyDir: {} and the # from https://github.com/argoproj/argo-cd/issues/15126#issuecomment-2033317852
# used to patch values since there's some bug with argo.
# See also https://argo-cd.readthedocs.io/en/stable/operator-manual/config-management-plugins/#place-the-plugin-configuration-file-in-the-sidecar
apiVersion: v1
kind: ConfigMap
metadata:
name: my-plugin-config
data:
plugin.yaml: |
apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
name: valuesobjectworkaround
spec:
init:
command: ["/bin/true"]
generate:
command: ["/bin/bash", "-c"]
args:
- find -name "*.yaml" -exec cat {} \; -exec printf "\\n\\n---\\n\\n" \; | sed 's/valuesObject:/values:\ |/g' Once those two files are added to the ...
resources:
...
- ./config-values-workaround.yaml
...
patches:
- path: plugin-patch.yaml
... We can install argo as usual with |
I'm also looking forward to use Thanks a ton to @garyiwu and @issmirnov for sharing your fixes which gave me an idea. Your implementation will replace all occurrences of So instead of using Once the bug is fixed you should be able to simply remove the plugin so that the
Also notice that the
Lastly add the plugin to your
|
this is NOT a solution both cases define the same YAML, and im amazed it leads to different results
|
Good day Sirs, it looks like a critical issue or design flaw in ArgoCD and show-stopper for it's usage. Are any ideas when it would be patched? I am very appreciate any feedback (ofk, for the exception of "bring your PRs") |
if you use values: | you cant patch it as part of a crossplane composition, i believe. That's how i ended up using valuesObject to begin with. |
Sorry, @PaulSonOfLars, I totally forgot to give you credit for the e2e tests. Fixing authorship in this PR: #18515 |
Checklist:
argocd version
.Describe the bug
We've switched some applications to the new
valuesObject
syntax, and those apps have gotten "stuck". They go into a refreshing status and never finishTo Reproduce
Not clear to us how to reproduce. We deleted the entire
.status
of an affected application and it seemed to start working again. Not left it long enough yet to determine if it'll break againExpected behavior
Screenshots
Version
Logs
The text was updated successfully, but these errors were encountered: