Comments (11)
I know this is closed, but I just hit something similar today in a cluster that was working fine until today.
The fix proposed in #37 didn't solve the issue for me.
I ended up changing the deployment to override the default command with tail -f /dev/null
and I exec'ed into the container to play around.
I was getting the aforementioned error:
error syncing repo: error running command: exit status 128: "Cloning into '/git'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
and running the git clone command directly offered the same output.
Only after getting more debug on the git command I saw the problem:
# GIT_SSH_COMMAND="ssh -vvv" git clone [email protected]:myorg/repo.git
Cloning into 'repo'...
OpenSSH_7.2p2-hpn14v4, OpenSSL 1.0.2j 26 Sep 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "gitlab.com" port 22
ssh-binary: Could not resolve hostname gitlab.com: Try again
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The container had no DNS because the CNI was borked on that node. After fixing the CNI problems, everything went back to running perfectly without needing to run the container as root.
YMMV but after spending a few hours sorting this out, I thought it might be useful to write it down somewhere for others that have no luck with the runAsRoot fix.
from git-sync.
To "fix" it try running the container with "runAsUser: 0". Still looking into why this works or better why running it without it fails.
Also the recommended container to run is: "gcr.io/google_containers/git-sync-amd64:v2.0.4"
from git-sync.
Just to gather some more info:
What cluster version did you run?
Where did the cluster run? GKE?
Was it an updated version of the cluster?
What was the actual permission on the ssh key?
from git-sync.
See #34
from git-sync.
Fixed via #37.
from git-sync.
@mgilbir
Hi, I have a same problem with you.
You said that you fixed the CNI problems
, and I don't know what it is..
Can you please elaborate it??
Thanks!
from git-sync.
CNI is the Container Network Interface.
In my case, it was not working properly and the container was not able to resolve DNS.
from git-sync.
@stp-ip Hello, I still get the same problem with @ursuad in my GKE cluster
, can you help me?
from git-sync.
@fairyhunter13 What's the specific problem? Which version are you using?
from git-sync.
@stp-ip With the latest version. And it seems I always get this log.
I1114 15:06:08.050003 1 main.go:269] "level"=0 "msg"="starting up" "args"=["/git-sync","[email protected]:kitabisa/tyk-plugins","-branch=master","-root=/opt/tyk-gateway/plugins","-dest=compiled-plugins","-one-time=true","-ssh=true","-max-sync-failures=3"]
E1114 15:06:08.785486 1 main.go:299] "msg"="unexpected error syncing repo, will retry" "error"="error running command: exit status 128: \"Cloning into '/opt/tyk-gateway/plugins'...\\nfatal: Could not read from remote repository.\\n\\nPlease make sure you have the correct access rights\\nand the repository exists.\\n\""
I1114 15:06:08.785690 1 main.go:300] "level"=0 "msg"="waiting before retrying" "waitTime"=0
E1114 15:06:09.514627 1 main.go:299] "msg"="unexpected error syncing repo, will retry" "error"="error running command: exit status 128: \"Cloning into '/opt/tyk-gateway/plugins'...\\nfatal: Could not read from remote repository.\\n\\nPlease make sure you have the correct access rights\\nand the repository exists.\\n\""
I1114 15:06:09.514674 1 main.go:300] "level"=0 "msg"="waiting before retrying" "waitTime"=0
E1114 15:06:10.250051 1 main.go:299] "msg"="unexpected error syncing repo, will retry" "error"="error running command: exit status 128: \"Cloning into '/opt/tyk-gateway/plugins'...\\nfatal: Could not read from remote repository.\\n\\nPlease make sure you have the correct access rights\\nand the repository exists.\\n\""
I1114 15:06:10.250094 1 main.go:300] "level"=0 "msg"="waiting before retrying" "waitTime"=0
E1114 15:06:11.014989 1 main.go:294] "msg"="failed to sync repo, aborting" "error"="error running command: exit status 128: \"Cloning into '/opt/tyk-gateway/plugins'...\\nfatal: Could not read from remote repository.\\n\\nPlease make sure you have the correct access rights\\nand the repository exists.\\n\""
Do you know how to show log level 5? I want to see the command that got executed inside the container.
from git-sync.
Could be useful. You could try to use full URL with ssh://
scheme:
ssh://git@yourhost/path/repo.git
or with specified port:
ssh://git@yourhost:port/path/repo.git
For me it solved the problem.
from git-sync.
Related Issues (20)
- Sync on tag addition? HOT 11
- Simplify inner loop
- Consider putting the local repo in a subdir of the --root HOT 3
- Wrong path for check of local git hash HOT 3
- Error msg exposes token in URL HOT 4
- GitLab via ssh key HOT 3
- How to disable commit hash in the target folder? HOT 2
- Allow the submodule functionality for repos copied using vcs tool HOT 1
- Temporarily missing files when using $GITSYNC_LINK HOT 4
- Remediate security vulnerabilities on 4.1.0 HOT 5
- High vulnerability CVE-2023-6246 and CVE-2023-6779 HOT 1
- Issue with PYTHONPATH Resolution in git-sync 4.0.0 HOT 2
- v4 slack webhook HOT 6
- exechook behavior HOT 4
- Remediate 4.2.2 security vulnerabilities HOT 1
- Support GitHub App authentication HOT 7
- TODO: infra to make #878 work HOT 1
- Curious about real example raising race condition when using v3 HOT 1
- exechook working HOT 8
- TODO: shellcheck test_e2e.sh and test_git.sh HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-sync.