argoproj / argo-cd

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

"error getting cached app state: cache: key is missing" when running `app diff` via CLI #10554

Open DerekTBrown opened 2 years ago

DerekTBrown commented 2 years ago

Describe the bug

I am unable to run the app diff command from the CLI successfully, although the UI correctly returns app diff results.

To Reproduce

argocd app diff my-application --server my-argo-server.local --auth-token ${ARGO_TOKEN} --grpc-web
ERRO[0009] finished unary call with code Unknown         error="error getting cached app state: cache: key is missing" grpc.code=Unknown grpc.method=ManagedResources grpc.service=application.ApplicationService grpc.start_time="2022-09-08T10:19:23-07:00" grpc.time_ms=1258.695 span.kind=server system=grpc
FATA[0009] rpc error: code = Unknown desc = error getting cached app state: cache: key is missing

Version

❯ argocd version                                                                                                                                                                                     ✘ 20
argocd: v2.4.11+3d9e9f2.dirty
  BuildDate: 2022-08-22T12:47:26Z
  GitCommit: 3d9e9f2f95b7801b90377ecfc4073e5f0f07205b
  GitTreeState: dirty
  GoVersion: go1.19
  Compiler: gc
  Platform: darwin/arm64
argocd-server: v2.4.11+3d9e9f2.dirty
  BuildDate: 2022-08-22T12:47:26Z
  GitCommit: 3d9e9f2f95b7801b90377ecfc4073e5f0f07205b
  GitTreeState: dirty
  GoVersion: go1.19
  Compiler: gc
  Platform: darwin/arm64
  Kustomize Version: could not get kustomize version: exec: "kustomize": executable file not found in $PATH
  Helm Version: v3.9.0+g7ceeda6
  Kubectl Version: v0.23.1
  Jsonnet Version: v0.18.0
DerekTBrown commented 2 years ago

I was able to resolve this error by performing an argocd login as admin, and then omitting the api-key parameter from the argocd diff command.

It seems like the api-key/server flags are being ignored?

nickma82 commented 1 year ago

Is duplicated by: https://github.com/argoproj/argo-cd/issues/14506 duplicates: https://github.com/argoproj/argo-cd/issues/4044

dosmanak commented 10 months ago

I experience the same using argocd core