Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Improve fluxctl sync error when Flux cannot clone the git repository #2657

Closed
2opremio opened this issue Dec 3, 2019 · 1 comment · Fixed by #2765
Closed

Improve fluxctl sync error when Flux cannot clone the git repository #2657

2opremio opened this issue Dec 3, 2019 · 1 comment · Fixed by #2765

Comments

@2opremio
Copy link
Contributor

2opremio commented Dec 3, 2019

From a user in Slack:

Hi, could someone point me how can I troubleshoot Error: git repository ssh://[email protected]/myrepo/flux.git is not ready to sync (status: new)

The user got that error because Flux couldn't clone the repository (the user later fixed the problem by mounting a known_hosts file which was missing).

That error is not very helpful because:

  • It leaks internal information of how we manage repos (new doesn't mean anything to users)
  • It's not actionable

A better error would be:

Error: git repository ssh://[email protected]/myrepo/flux.git cannot be cloned: actual cloning error
@dinosk
Copy link

dinosk commented Jan 19, 2020

Hi @2opremio, I would like to work on this issue.
I can reproduce it with a flux pod that fails to clone a repository with this error:

sync-loop err="git repo not ready: git clone --mirror: running git command: git [clone --mirror git@<a-gitlab-instance>:user/repo /tmp/flux-gitclone621862374]: context deadline exceeded"

and then using fluxctl to sync:

$ fluxctl sync --k8s-fwd-ns flux
Error: git repository ssh://git@<a-gitlab-instance>/user/repo is not ready to sync (status: new)
Run 'fluxctl sync --help' for usage.

I see the error is passed in daemon.go:627
If this contains the last error of the repo, my idea would be to extend the v6.GitConfig response in daemon.go:632 to include it and print it in the fluxctl error message.

Edit:
I opened #2765
The output now shows the message, but could be a bit shorter:

$ fluxctl sync --k8s-fwd-ns flux
Error: git repository ssh://git@<a-gitlab-instance>/user/repo is not ready to sync (full error: git clone --mirror: running git command: git [clone --mirror git@<a-gitlab-instance>:user/repo /tmp/flux-gitclone805737385]: context deadline exceeded)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants