Bug: pg: multiple rows in result set when configuring GitOps
📜 Description
Just installed Devtron and caught a nasty error while configuring GitOps
Similar closed issue in another part of system: https://github.com/devtron-labs/devtron/issues/3871
👟 Reproduction steps
I don't have the exact playback steps. But the error occurred after I tried to add a github gitops repository.
- First I entered wrong token and the page crashed with "Try Again" error (separate page with button).
- After refreshing the page, I entered the correct token and now my gitops configuration has broken completely.
👍 Expected behavior
Updating the gitops configuration should not throw an error
👎 Actual Behavior
throw an error
☸ Kubernetes version
v1.27.3-gke.100
Cloud provider
🌍 Browser
Chrome
🧱 Your Environment
No response
✅ Proposed Solution
Apparently, more values than necessary were written to the database. Maybe this is because I entered the wrong token first. Or maybe I just clicked the buttons too fast.
Complicating the situation is the fact that I can not delete the old configuration from the interface, and how to connect to the internal database is not very clear to me.
I apologize if the bug is not clear enough.
👀 Have you spent some time to check if this issue has been raised before?
- [x] I checked and didn't find any similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
AB#8224
I was able to connect to the database by looking up the password in the resource manager. There were indeed six records in the database, one with the old token.
Apparently the duplication happened because I have configured gloo VirtualService for devtron. I had it set to repeat requests at 500 responses. And for some reason when saving GitOps settings I get a 504 error. Despite the 504 code in the body the response is like 200.
apiVersion: gateway.solo.io/v1
kind: VirtualService
metadata:
name: devtron-virtualservice
namespace: gloo-system
spec:
virtualHost:
domains:
- 'devtron.saa.sh'
routes:
- matchers:
# l7-xlb-basic-check-http is using the root path for health checking
- prefix: /
options:
# Because the cluster uses spot nodes that can be shut down at any time, having a retry mechanism
# is a good idea in case the pod/node shutdown process isn't clean leaving the possibility of request failures
retries:
retryOn: 'connect-failure,5xx'
numRetries: 5
perTryTimeout: 1s # Default is 15s
routeAction:
single:
kube:
ref:
name: 'devtron-service'
namespace: 'devtroncd'
port: 80