argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.6k stars 5.36k forks source link

`undefined/undefined` is wrong... #16643

Open jsoref opened 9 months ago

jsoref commented 9 months ago

Checklist:

Describe the bug

the details for a not found resource reflected undefined/undefined:

Resource not found in cluster: undefined/undefined:cert-manager-startupapicheck

To Reproduce

  1. let argocd manage a cert-manager install
  2. let argocd upgrade cert-manager install
  3. while argocd is triggering the cert-manager upgrade, a service account for cert-manager-startupapicheck will appear and can be clicked (?)
  4. click it
  5. depending on (hand waving) the cert-manager-startupapicheck will probably already be gone? so a confusing error will be rendered by argocd

note that for a while longer i could ask argocd to filter for service accounts and see it, but i couldn't click it to actually show the item... and it eventually stopped appearing...

Expected behavior

information about expect objects should be stored in the request pointer so that they can be filled in in cases when they no longer exist instead of asking the ui to imagine them after the fact

Screenshots

image

Version

{
    "Version": "v2.8.3+77556d9",
    "BuildDate": "2023-09-07T16:05:43Z",
    "GitCommit": "77556d9e64304c27c718bb0794676713628e435e",
    "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"
}

Logs

Paste any relevant application logs here.
faust64 commented 9 months ago

Not sure it's related ... but as of upgrading ArgoCD (from 2.7.14 to 2.8.4), I'm seeing similar messages. For just any object, eg:

Resource not found in cluster: v1/ConfigMap:cronjob-tektonruns-garbage-collect-7h57hctc55 Please update your resource specification to use the latest Kubernetes API resources supported by the target cluster. The recommended syntax is v1/ConfigMap:cronjob-tektonruns-garbage-collect-7h57hctc55

Object is present in cluster though. Application shows healthy, it's not OutOfSync. I would just get that message when looking at individual resources "Live Manifest" in ArgoCD console.

This affects all objects in my applications: Services, ConfigMaps, NetworkPolicies ... Although I don't have that "undefined/undefined" thing ...

Still testing 2.8 / first installation I'm upgrading. I can confirm this is a not an issue, with exact same applications, running 2.7.14 Using that OpenShift GitOps operator lifecycling my ArgoCD -- ArgoCD object did not change in a while, as we did proceed with sso/dex reconfiguration when upgrading from 2.6 to 2.7.

jsoref commented 9 months ago

Sorry, that's a different issue. If I were you, I'd join slack to debug and then file a ticket (feel free to reference it here so people can find it if they stumble on your note here instead of the new ticket).

faust64 commented 9 months ago

I am. Still I'm wondering: does the live manifest view works at all? You may be having two problems here.

jsoref commented 9 months ago

Yes, live manifest works fine for everything else.

ku524 commented 9 months ago

I am also experiencing the same issue. My version of ArgoCD is 2.9.1. In my case, it was a pod, and I couldn't delete this pod through any method supported by ArgoCD. Note that the actual pod had already been deleted. However, removing the owner allowed me to delete this pod.

스크린샷 2024-01-09 오후 1 48 57
pargupta12 commented 7 months ago

@jsoref: is your issue resolved? I am also facing same issue and getting error message something like "Resource not found in cluster: undefined/undefined:ly-job-a67f890-postsync-1707682950"

if you have some workaround. Please suggest.Thanks

jsoref commented 7 months ago

No, it isn't resolved. I just deal with it.

bofaalsarah commented 7 months ago

We just upgraded our ArgoCD from 2.7.6 to 2.10.1 and we are facing a similar issue

Resource not found in cluster: v1/ConfigMap:bitbucket-runner-configs-59t96976td Please update your resource specification to use the latest Kubernetes API resources supported by the target cluster. The recommended syntax is v1/ConfigMap:bitbucket-runner-configs-59t96976td

jsoref commented 7 months ago

Sorry, that's a different issue. If I were you, I'd join slack to debug and then file a ticket (feel free to reference it here so people can find it if they stumble on your note here instead of the new ticket).

bofaalsarah commented 7 months ago

I think it's still related because when I look into the live manifest tab of the pod, I am getting

Resource not found in cluster: undefined/undefined:bitbucket-runner-7c87665b77-m886p

jsoref commented 7 months ago

Oh, sorry, I didn't see that in what you pasted earlier. Yes, that's this problem :).

jsoref commented 7 months ago

Fwiw, this is more about error reporting than fixing the underlying problem causing any given error.

jsoref commented 7 months ago

Fwiw, this appears to have been introduced by @ashutosh16 in #13031 -- it's odd, because there are screenshots of it working there, so, presumably the feature works some of the time.

The relevant code is: https://github.com/argoproj/argo-cd/blob/891d08930470675c8851909254b0b5bd45eb79f0/ui/src/app/applications/components/application-node-info/application-node-info.tsx#L240-L241

LS80 commented 7 months ago

Are you missing the cluster rbac for the server component?

cmarasescu commented 7 months ago

I had the same issues myself after install ArgoCD v2.10.1. I've followed the official install instructions (https://argo-cd.readthedocs.io/en/stable/getting_started/, with the only difference that I've use a custom namespace for installation (argocd-test)

kubectl create ns argocd-test
kubectl apply -n argocd-test -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/core-install.yaml

Errors:

  1. Issue 1: live manifest was showing errors for all resources, even tough the resources were deployed successfuly. In example, the errors for a configMap:
Resource not found in cluster: v1/ConfigMap:public-ingress-controller-test 
Please update your resource specification to use the latest Kubernetes API resources supported by the target cluster. 
The recommended syntax is v1/ConfigMap:public-ingress-controller-test
  1. Issue 2: I was not able to delete resources from ArgoCD GUI - in example, while trying to delete a confgiMap, I got the following error:
    Unable to delete resource: error deleting resource: configmaps "public-ingress-controller-test" is forbidden: 
    User "system:serviceaccount:argocd-test:argocd-server" cannot delete resource "configmaps" in API group "" in the namespace "lu-ingress-controller"

Resolution:

The solution in my case was to adapt the argocd-server ClusterRoleBinding to also include the argocd-server serviceAccount from my custom namespace argocd-test. Basically, under subjects I've added the following 2 lines:

subjects:
- kind: ServiceAccount
  name: argocd-server
  namespace: argocd-test
ppodevlabs commented 6 months ago

i'm facing the same issue. I've deployed argocd 2.10.2 in cluster setup with the applications in any namespace, i've made the proper configuration and deployed https://github.com/argoproj/argo-cd/tree/master/manifests/cluster-rbac too.

But my application keeps syncing

Screenshot 2024-03-15 at 07 08 10

Actually the deployment/ingres/networkpolicy are deployed and healthy but argo does not seems to detect them.

Any idea what am i missing here?

cooervo commented 2 months ago

I was having this issue in our helm values file we had some custom config for server.clusterRoleRules.rules and had server.clusterRoleRules.enabled: true that was overriding default config notice:

{{- if .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: {{ include "argo-cd.server.fullname" . }}
  labels:
    {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
rules:
  {{- if .Values.server.clusterRoleRules.enabled }}
    {{- toYaml .Values.server.clusterRoleRules.rules | nindent 2 }}
  {{- else }}
  - apiGroups:
      - '*'

had to remove the custom rules and server.clusterRoleRules.enabled: false same as in default argocd values file. and now I can see all resources just fine