Skip to content

Using an explicitly empty secret throws error #5584

@Oro

Description

@Oro

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug
Using an application with just the following manifest will always stay out-of-sync (which is kinda expected since data should always be non-empty for such a secret) but throws an error inside logs. While this example might be silly, I think it might be related to #4044 - when redis is restarted it will no longer show a diff and instead throw Unable to load data: cache: key is missing

To Reproduce
Use an application with just the following yaml:

data: {}
stringData: {}
apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
  name: an-empty-secret
  annotations:
    kubernetes.io/service-account.name: default
  • Let application sync, the secret will stay out of sync.
  • Kill the redis pod, wait for it to restart.
  • Observe error in GUI when trying to diff - Unable to load data: cache: key is missing

Expected behavior
I am not sure tbh. I guess staying out of sync is correct, however there should not be an error when redis was restarted.

Version

argocd: v1.8.3+ef5010c
  BuildDate: unknown
  GitCommit: ef5010c3a0b5e027fd642732d03c5b0391b1e574
  GitTreeState: clean
  GoVersion: go1.15.7
  Compiler: gc
  Platform: linux/amd64
argocd-server: v1.8.5+d0f8edf
  BuildDate: 2021-02-20T05:40:24Z
  GitCommit: d0f8edfec804c013d4fc535e8b9022eb47602617
  GitTreeState: clean
  GoVersion: go1.14.12
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: v3.8.1 2020-07-16T00:58:46Z
  Helm Version: v3.4.1+gc4e7485
  Kubectl Version: v1.17.8
  Jsonnet Version: v0.17.0

Logs

time="2021-02-23T15:31:43Z" level=info msg="getRepoObjs stats" application=empty-secret build_options_ms=0 helm_ms=0 plugins_ms=0 repo_ms=0 time_ms=854 unmarshal_ms=854 version_ms=0
time="2021-02-23T15:31:43Z" level=error msg="Failed to cache app resources: .data accessor error: <nil> is of the type <nil>, expected map[string]interface{}" application=empty-secret dedup_ms=0 diff_ms=6 git_ms=854 health_ms=0 live_ms=12 settings_ms=0 sync_ms=0
time="2021-02-23T15:31:43Z" level=info msg="Update successful" application=empty-secret
time="2021-02-23T15:31:43Z" level=info msg="Reconciliation completed" application=empty-secret dedup_ms=0 dest-name= dest-namespace=default dest-server="https://kubernetes.default.svc" diff_ms=6 fields.level=2 git_ms=854 health_ms=0 live_ms=12 settings_ms=0 sync_ms=0 time_ms=897

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbug/severity:majorMalfunction in one of the core component, impacting a majority of userscherry-pick/2.1Candidate for cherry picking into the 2.1 release branchcomponent:coreSyncing, diffing, cluster state cachegood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions