Giter Club home page Giter Club logo

Comments (11)

mgilbir avatar mgilbir commented on August 19, 2024 2

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.

stp-ip avatar stp-ip commented on August 19, 2024

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.

stp-ip avatar stp-ip commented on August 19, 2024

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.

sjernigan avatar sjernigan commented on August 19, 2024

See #34

from git-sync.

stp-ip avatar stp-ip commented on August 19, 2024

Fixed via #37.

from git-sync.

luckymagic7 avatar luckymagic7 commented on August 19, 2024

@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.

mgilbir avatar mgilbir commented on August 19, 2024

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.

fairyhunter13 avatar fairyhunter13 commented on August 19, 2024

@stp-ip Hello, I still get the same problem with @ursuad in my GKE cluster, can you help me?

from git-sync.

stp-ip avatar stp-ip commented on August 19, 2024

@fairyhunter13 What's the specific problem? Which version are you using?

from git-sync.

fairyhunter13 avatar fairyhunter13 commented on August 19, 2024

@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.

SingularBunny avatar SingularBunny commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.