argoproj / argo-cd

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

Trying to delete a repo I added by mistake and getting "permission denied" #20921

Open davidt-gh opened 1 day ago

davidt-gh commented 1 day ago

Checklist:

Describe the bug I've copy paste git url from bitbucket, not sure why, they provide it with git clone command in prefix, and by mistake I've try to add the repo like that. After I saw the connection status fail and I added it in right way, but now I'm not able to delete the wrong typo, not from CLI and not from UI.

To Reproduce Instead put git http url, add git clone https://bitbucket.org/workspace/repo.git

Expected behavior Just allow to delete

Screenshots image

Version

➜  ~ argocd version
argocd: v2.12.6+4dab5bd
  BuildDate: 2024-10-18T21:32:12Z
  GitCommit: 4dab5bd6a60adea12e084ad23519e35b710060a2
  GitTreeState: clean
  GoVersion: go1.23.2
  Compiler: gc
  Platform: darwin/arm64
WARN[0001] Failed to invoke grpc call. Use flag --grpc-web in grpc calls. To avoid this warning message, use flag --grpc-web. 
argocd-server: v2.13.0+347f221
  BuildDate: 2024-11-04T12:09:06Z
  GitCommit: 347f221adba5599ef4d5f12ee572b2c17d01db4d
  GitTreeState: clean
  GoVersion: go1.23.1
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.4.3 2024-07-19T16:40:33Z
  Helm Version: v3.15.4+gfa9efb0
  Kubectl Version: v0.31.0
  Jsonnet Version: v0.20.0

Logs This is me trying to delete the repo from CLI

➜  ~ argocd repo rm "git clone https://bitbucket.org/workspace/repo.git"
WARN[0001] Failed to invoke grpc call. Use flag --grpc-web in grpc calls. To avoid this warning message, use flag --grpc-web. 
FATA[0001] rpc error: code = PermissionDenied desc = permission denied 

I did not saw any related logs in ArgoCD NS after trying to run the command or delete from UI, here is the last logs I saw: image

andrii-korotkov-verkada commented 22 hours ago

What's your RBAC configuration? It looks like it has permissions to create, but not delete.

davidt-gh commented 9 hours ago

What's your RBAC configuration? It looks like it has permissions to create, but not delete. But if it's a valid repo it been deleted without any error - only this case. I did not configured anything related to RBAC, here is my vaulues:

global:
  domain: argocd.domain.net

configs:
  params:
    server.insecure: true

dex:
  enabled: false

server:
  ingress:
    hostname: "argocd.domain.net"
    enabled: true
    ingressClassName: nginx
    tls: false
    extraTls:
      - secretName: compamny-net-tls-certificate
        hosts:
          - argocd.domain.net

I've found a workaround - which is to delete the secret created by ArgoCD, and it vanished.

andrii-korotkov-verkada commented 8 hours ago

Sorry, I've meant argocd-rbac-cm.