Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Gitrepos with wrong URLs #2520

Closed
mmartin24 opened this issue Jun 14, 2024 · 6 comments
Closed

Problems with Gitrepos with wrong URLs #2520

mmartin24 opened this issue Jun 14, 2024 · 6 comments
Labels
Milestone

Comments

@mmartin24
Copy link
Collaborator

mmartin24 commented Jun 14, 2024

Issue:

Some logs and performance degradation seem to occur on Rancher v2.9-e0af6cccbff0210e1538004dfc67f10f40597c20-head with fleet:v0.10.0-rc.15 when creating a GitRepo with spaces in URL and trying to fix.
There are more then one issue here, but I try to summarize as this:

  • Issue 1: Error Status not shown when adding an URL with space; Insted permanent Git Updating.
  • Issue 2: When correcting the URL, it takes more time than in Rancher v2.8.4 with fleet:103.1.5+up0.9.5to settle things.

This can be easier visualized as in this video of rancher v2.9-e0af6cccbff0210e1538004dfc67f10f40597c20-head | fleet:v0.10.0-rc.15 :

29_ko.webm

As opposed to this one in v2.8.4 | fleet:103.1.5+up0.9.5 where things look smoother:

284_ok.webm

Attaching logs of gitjob: gitjob_logs.json

Logs summary here

{"level":"error","ts":"2024-06-14T08:01:43Z","logger":"git-latest-commit-poll-watch","msg":"error fetching commit","gitrepo":{"kind":"GitRepo","apiVersion":"fleet.cattle.io/v1alpha1","metadata":{"name":"test29","namespace":"fleet-local","uid":"234426b7-3e2c-4e4d-9a │
│ {"level":"error","ts":"2024-06-14T08:01:58Z","logger":"git-latest-commit-poll-watch","msg":"error fetching commit","gitrepo":{"kind":"GitRepo","apiVersion":"fleet.cattle.io/v1alpha1","metadata":{"name":"test29","namespace":"fleet-local","uid":"234426b7-3e2c-4e4d-9a │
│ {"level":"info","ts":"2024-06-14T08:02:01Z","logger":"gitjob","msg":"job deletion triggered because of generation change","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","GitRepo":{"name":"test29","namespace":"fleet-local"},"na │
│ {"level":"error","ts":"2024-06-14T08:02:01Z","msg":"Reconciler error","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","GitRepo":{"name":"test29","namespace":"fleet-local"},"namespace":"fleet-local","name":"test29","reconcileID" │
│ {"level":"error","ts":"2024-06-14T08:03:09Z","logger":"git-latest-commit-poll-watch","msg":"error fetching commit","gitrepo":{"kind":"GitRepo","apiVersion":"fleet.cattle.io/v1alpha1","metadata":{"name":"test-29","namespace":"fleet-local","uid":"9b7677fb-c6a6-4904-a │
│ {"level":"error","ts":"2024-06-14T08:03:24Z","logger":"git-latest-commit-poll-watch","msg":"error fetching commit","gitrepo":{"kind":"GitRepo","apiVersion":"fleet.cattle.io/v1alpha1","metadata":{"name":"test-29","namespace":"fleet-local","uid":"9b7677fb-c6a6-4904-a │
│ {"level":"info","ts":"2024-06-14T08:03:39Z","logger":"git-latest-commit-poll-watch","msg":"new commit found","gitrepo":{"kind":"GitRepo","apiVersion":"fleet.cattle.io/v1alpha1","metadata":{"name":"test-29","namespace":"fleet-local","uid":"9b7677fb-c6a6-4904-aafe-64 │
│ {"level":"error","ts":"2024-06-14T08:04:09Z","logger":"git-latest-commit-poll-watch","msg":"error fetching commit","gitrepo":{"kind":"GitRepo","apiVersion":"fleet.cattle.io/v1alpha1","metadata":{"name":"test-29","namespace":"fleet-local","uid":"9b7677fb-c6a6-4904-a │
│ {"level":"info","ts":"2024-06-14T08:04:21Z","logger":"gitjob","msg":"job deletion triggered because of generation change","controller":"gitrepo","controllerGroup":"fleet.cattle.io","controllerKind":"GitRepo","GitRepo":{"name":"test-29","namespace":"fleet-local"},"n


Reproduction steps:

You can watch the video to better reproduce but in nutshell:

  1. Deploy Rancher 2.9 with fleet fleet:v0.10.0-rc.15. (You can use our ci if desired to spin a machine from here)
  2. Deploy on fleet-local a git repo with a space at the end of the URL. I used
Repository URL: `https://github.com/rancher/fleet-test-data ` (notice the space at the end)
Branch: `master`
Paths: `qa-test-apps/nginx-app`

Image
3. Observe Issue 1
4. Now go back to Git Repo and correct the incorrect space at the end of URL. Save
5. Observe Issue 2 (long time to update repo compared to 2.8.4)


Test environment

  • Deployed Rancher v2.9-e0af6cccbff0210e1538004dfc67f10f40597c20-head on single cluster K3s v1.28.8 +k3s1
@mmartin24 mmartin24 added this to Fleet Jun 14, 2024
@mmartin24 mmartin24 converted this from a draft issue Jun 14, 2024
@mmartin24
Copy link
Collaborator Author

Added this other issue to prevent from the UI that a Git Repo with invalid URL due to spaces or bad characters is allowed to go through: rancher/dashboard#11239

@0xavi0
Copy link
Contributor

0xavi0 commented Jun 20, 2024

Both issues are fleet related. Thanks for the hunt. 🕵️

  1. Issue 1 occurs because fleet is not updating the conditions in the gitrepo when detecting an error in the git poller
  2. Issue 2 occurs because fleet is not rescheduling the poller job when the Spec changes, so the user has to wait for the next cycle to pick up those changes. (We're only rescheduling if the user changes the interval, but in this case we're changing the url)

#2542 should fix both

@0xavi0 0xavi0 moved this from 🆕 New to 👀 In review in Fleet Jun 21, 2024
@0xavi0 0xavi0 moved this from 👀 In review to Needs QA review in Fleet Jun 21, 2024
@0xavi0
Copy link
Contributor

0xavi0 commented Jun 21, 2024

The following video shows the fix running with rancher 2.9-head and a dev version of fleet

Screen.Recording.2024-06-21.at.17.39.28.mov

@mmartin24 mmartin24 added this to the v2.9.0 milestone Jun 25, 2024
@mmartin24
Copy link
Collaborator Author

mmartin24 commented Jul 5, 2024

Checked in v2.9-1d34dbcbf674228c8e63d10449c6da35d8d16692-head with fleet fleet:104.0.0+up0.10.0-rc.19

It seems performance is still a bit slow compared to the one in fix.

Screencast.from.05-07-24.17.08.33.webm

@mmartin24
Copy link
Collaborator Author

FTR: noticed this other issue while testing this: rancher/dashboard#11404

@mmartin24
Copy link
Collaborator Author

Closing this issue given that the error message is fixed.
Opened #2631 to track the UX performance one

@github-project-automation github-project-automation bot moved this from Needs QA review to ✅ Done in Fleet Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants