argoproj / argo-cd

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

Can't disconnect a repository #8774

Open marcio-pessoa opened 2 years ago

marcio-pessoa commented 2 years ago

Checklist:

Describe the bug

Using the web user interface, I am unable to disconnect a repository with incorrect SSH private key data previously configured.

To Reproduce

Creating a repository connection:

Disconnecting:

Nothing happens, just an error on browser console.

Expected behavior

The repository connection must be removed from the "Repositories" list.

Version

argocd: v2.3.1+b65c169
  BuildDate: 2022-03-10T22:51:09Z
  GitCommit: b65c1699fa2a2daa031483a3890e6911eac69068
  GitTreeState: clean
  GoVersion: go1.17.6
  Compiler: gc
  Platform: linux/amd64

Logs

When I click on "Disconnect" and confirm I got the following errors on Google Chrome console:

main.c7ea22e999b3805bc676.js:388          DELETE https://example.com/argo-cd/api/v1/repositories/git%40git.example.com%3Auser%2Fportal.git 404
b._end @ main.c7ea22e999b3805bc676.js:388
b.end @ main.c7ea22e999b3805bc676.js:388
(anonymous) @ main.c7ea22e999b3805bc676.js:420
n.then @ main.c7ea22e999b3805bc676.js:420
delete @ main.c7ea22e999b3805bc676.js:54
(anonymous) @ main.c7ea22e999b3805bc676.js:54
o @ main.c7ea22e999b3805bc676.js:54
Promise.then (async)
a @ main.c7ea22e999b3805bc676.js:54
(anonymous) @ main.c7ea22e999b3805bc676.js:54
Im @ main.c7ea22e999b3805bc676.js:54
disconnectRepo @ main.c7ea22e999b3805bc676.js:54
action @ main.c7ea22e999b3805bc676.js:54
onItemClick @ main.c7ea22e999b3805bc676.js:363
onClick @ main.c7ea22e999b3805bc676.js:363
a @ main.c7ea22e999b3805bc676.js:404
p @ main.c7ea22e999b3805bc676.js:404
(anonymous) @ main.c7ea22e999b3805bc676.js:404
b @ main.c7ea22e999b3805bc676.js:404
st @ main.c7ea22e999b3805bc676.js:404
rt @ main.c7ea22e999b3805bc676.js:404
at @ main.c7ea22e999b3805bc676.js:404
pt @ main.c7ea22e999b3805bc676.js:404
F @ main.c7ea22e999b3805bc676.js:404
W @ main.c7ea22e999b3805bc676.js:404
Zt @ main.c7ea22e999b3805bc676.js:404
Xt @ main.c7ea22e999b3805bc676.js:404
t.unstable_runWithPriority @ main.c7ea22e999b3805bc676.js:412
zr @ main.c7ea22e999b3805bc676.js:404
P @ main.c7ea22e999b3805bc676.js:404
$t @ main.c7ea22e999b3805bc676.js:404
main.c7ea22e999b3805bc676.js:388 Uncaught (in promise) Error: Unsuccessful HTTP response
    at n.<anonymous> (main.c7ea22e999b3805bc676.js:388:51395)
    at n.i.emit (main.c7ea22e999b3805bc676.js:420:47964)
    at XMLHttpRequest.t.onreadystatechange (main.c7ea22e999b3805bc676.js:388:54810)
(anonymous) @ main.c7ea22e999b3805bc676.js:388
i.emit @ main.c7ea22e999b3805bc676.js:420
t.onreadystatechange @ main.c7ea22e999b3805bc676.js:388
Promise.then (async)
a @ main.c7ea22e999b3805bc676.js:54
o @ main.c7ea22e999b3805bc676.js:54
Promise.then (async)
a @ main.c7ea22e999b3805bc676.js:54
(anonymous) @ main.c7ea22e999b3805bc676.js:54
Im @ main.c7ea22e999b3805bc676.js:54
disconnectRepo @ main.c7ea22e999b3805bc676.js:54
action @ main.c7ea22e999b3805bc676.js:54
onItemClick @ main.c7ea22e999b3805bc676.js:363
onClick @ main.c7ea22e999b3805bc676.js:363
a @ main.c7ea22e999b3805bc676.js:404
p @ main.c7ea22e999b3805bc676.js:404
(anonymous) @ main.c7ea22e999b3805bc676.js:404
b @ main.c7ea22e999b3805bc676.js:404
st @ main.c7ea22e999b3805bc676.js:404
rt @ main.c7ea22e999b3805bc676.js:404
at @ main.c7ea22e999b3805bc676.js:404
pt @ main.c7ea22e999b3805bc676.js:404
F @ main.c7ea22e999b3805bc676.js:404
W @ main.c7ea22e999b3805bc676.js:404
Zt @ main.c7ea22e999b3805bc676.js:404
Xt @ main.c7ea22e999b3805bc676.js:404
t.unstable_runWithPriority @ main.c7ea22e999b3805bc676.js:412
zr @ main.c7ea22e999b3805bc676.js:404
P @ main.c7ea22e999b3805bc676.js:404
$t @ main.c7ea22e999b3805bc676.js:404
rishabh625 commented 2 years ago

on clicking disconnect it removes connection, can u please share more details?

marcio-pessoa commented 2 years ago

Hi @rishabh625,

Yes, normally it removes the connection, but it fails to remove only connections created with incorrect SSH key.

I recorded a video with the failure:

https://youtu.be/2KrRjcNHS10

rishabh625 commented 2 years ago

Looks like browser compatibility issues, can you please share browser used and it's version

marcio-pessoa commented 2 years ago

I'm using Google Chrome Version 99.0.4844.51 (Official Build) (64-bit). I just tested it on Firefox 98.0.1 (64-bit) and got the same issue.

marcio-pessoa commented 2 years ago

I also tested on another computer (Windows) with Internet Explorer and Microsoft Edge. I found the same problem.

kreeuwijk commented 2 years ago

I have the same issue, for me it is an incorrectly formatted repo URL that causes the behavior. The server logs show

level=info msg="finished unary call with code NotFound" error="rpc error: code = NotFound desc = repo 'ssh://git@gitlab.dreamworx.nl:argo/apps.git' not found"

A correctly formatted repo URL (git@gitlab.dreamworx.nl:argo/apps.git) can be deleted normally.

marcio-pessoa commented 2 years ago

I found a workaround on discussions:

https://github.com/argoproj/argo-cd/discussions/8547

mbrozzo commented 1 month ago

Hello, sorry for the necroposting, but I am using the ArgoCD operator for OpenShift in OKD and I am having a similar problem. When I click "Disconnect" on a repository I get this error: Unable to disconnect repository: repo 'git clone git@[ADDRESS].git' not found

I had wrongfully left "git clone" in the repository URL.

mbrozzo commented 1 month ago

Update: I was able to solve it, see https://github.com/argoproj-labs/argocd-operator/issues/1497#issuecomment-2270775761, but according to them it is an issue on your side.