Code Monkey home page Code Monkey logo

Comments (6)

adwk67 avatar adwk67 commented on September 2, 2024

For some more context: we tried to test the same git-sync call (as far as is possible) against a private github repository (access token, using the main branch, same gitsync 4.x etc.), which worked without problem.

from git-sync.

thockin avatar thockin commented on September 2, 2024

I'm going to need you to post all of the flags that you used to try to reproduce this. We have a battery of end-to-end tests, so you must be doing something that I have not considered before.

Ideally, you could run your sink with '-v6' and post the full logs here. That will show me the command line arguments, which commands it executed and what the results of them were.

from git-sync.

lucabtg avatar lucabtg commented on September 2, 2024

Thanks for your answer! This is the command with all the flags we're using right now:

git-sync --repo=<GITLAB_REPO_URL> --ref=main --depth=1 --period=20s --link=current --root=/tmp/git --verbose=6 --git-config='safe.directory:/tmp/git,http.sslVerify:false'

The corresponding logs are:

{"logger":"","ts":"2024-08-28 07:55:52.215110","caller":{"file":"main.go","line":528},"level":0,"msg":"starting up","pid":8,"uid":1000,"gid":0,"home":"/stk","flags":["--add-user=false","--askpass-url=","--branch=","--change-permissions=0","--cookie-file=false","--credential=[]","--
{"logger":"","ts":"2024-08-28 07:55:52.215437","caller":{"file":"main.go","line":613},"level":2,"msg":"created private gitconfig file","path":"/tmp/git-sync.gitconfig.273869993"}
{"logger":"","ts":"2024-08-28 07:55:52.215497","caller":{"file":"main.go","line":1878},"level":5,"msg":"running command","cwd":"","cmd":"git config --global gc.autoDetach false"}
{"logger":"","ts":"2024-08-28 07:55:52.218330","caller":{"file":"main.go","line":1878},"level":6,"msg":"command result","stdout":"","stderr":"","time":"2.782773ms"}
{"logger":"","ts":"2024-08-28 07:55:52.218403","caller":{"file":"main.go","line":1878},"level":5,"msg":"running command","cwd":"","cmd":"git config --global gc.pruneExpire now"}
{"logger":"","ts":"2024-08-28 07:55:52.226229","caller":{"file":"main.go","line":1878},"level":6,"msg":"command result","stdout":"","stderr":"","time":"7.777354ms"}
{"logger":"","ts":"2024-08-28 07:55:52.226258","caller":{"file":"main.go","line":1878},"level":5,"msg":"running command","cwd":"","cmd":"git config --global credential.helper \"cache --timeout 3600\""}
{"logger":"","ts":"2024-08-28 07:55:52.281476","caller":{"file":"main.go","line":1878},"level":6,"msg":"command result","stdout":"","stderr":"","time":"55.179183ms"}
{"logger":"","ts":"2024-08-28 07:55:52.281576","caller":{"file":"main.go","line":1878},"level":5,"msg":"running command","cwd":"","cmd":"git config --global core.askPass true"}
{"logger":"","ts":"2024-08-28 07:55:52.283900","caller":{"file":"main.go","line":1878},"level":6,"msg":"command result","stdout":"","stderr":"","time":"2.274704ms"}
{"logger":"","ts":"2024-08-28 07:55:52.283958","caller":{"file":"main.go","line":1878},"level":5,"msg":"running command","cwd":"","cmd":"git config --global safe.directory *"}
{"logger":"","ts":"2024-08-28 07:55:52.286138","caller":{"file":"main.go","line":1878},"level":6,"msg":"command result","stdout":"","stderr":"","time":"2.134505ms"}
{"logger":"","ts":"2024-08-28 07:55:52.286173","caller":{"file":"main.go","line":1747},"level":1,"msg":"setting up git SSH credentials"}                                                                                                                                                    
{"logger":"","ts":"2024-08-28 07:55:52.286205","caller":{"file":"main.go","line":1892},"level":1,"msg":"setting additional git configs","configs":[{},{}]}
{"logger":"","ts":"2024-08-28 07:55:52.286244","caller":{"file":"main.go","line":1894},"level":5,"msg":"running command","cwd":"","cmd":"git config --global safe.directory /tmp/git"}
{"logger":"","ts":"2024-08-28 07:55:52.288334","caller":{"file":"main.go","line":1894},"level":6,"msg":"command result","stdout":"","stderr":"","time":"2.036647ms"}
{"logger":"","ts":"2024-08-28 07:55:52.288371","caller":{"file":"main.go","line":1894},"level":5,"msg":"running command","cwd":"","cmd":"git config --global http.sslVerify false"}
{"logger":"","ts":"2024-08-28 07:55:52.290286","caller":{"file":"main.go","line":1894},"level":6,"msg":"command result","stdout":"","stderr":"","time":"1.859783ms"}
{"logger":"","ts":"2024-08-28 07:55:52.290331","caller":{"file":"main.go","line":1558},"level":3,"msg":"syncing","repo":"<GITLAB_REPO_URL>"}
{"logger":"","ts":"2024-08-28 07:55:52.290346","caller":{"file":"main.go","line":1734},"level":1,"msg":"storing git credential","url":"<GITLAB_REPO_URL>"}
{"logger":"","ts":"2024-08-28 07:55:52.290433","caller":{"file":"main.go","line":1738},"level":5,"msg":"running command","cwd":"","cmd":"git credential approve"}
{"logger":"","ts":"2024-08-28 07:55:52.292093","caller":{"file":"main.go","line":1738},"level":6,"msg":"command result","stdout":"","stderr":"","time":"1.615245ms"}
{"logger":"","ts":"2024-08-28 07:55:52.292137","caller":{"file":"main.go","line":1093},"level":3,"msg":"repo directory exists","path":"/tmp/git"}
{"logger":"","ts":"2024-08-28 07:55:52.292153","caller":{"file":"main.go","line":1165},"level":3,"msg":"sanity-checking git repo","repo":"/tmp/git"}
{"logger":"","ts":"2024-08-28 07:55:52.292219","caller":{"file":"main.go","line":1176},"level":5,"msg":"running command","cwd":"/tmp/git","cmd":"git rev-parse --show-toplevel"}
{"logger":"","ts":"2024-08-28 07:55:52.294117","caller":{"file":"main.go","line":1176},"level":6,"msg":"command result","stdout":"/tmp/git","stderr":"","time":"1.786947ms"}
{"logger":"","ts":"2024-08-28 07:55:52.294152","caller":{"file":"main.go","line":1189},"level":5,"msg":"running command","cwd":"/tmp/git","cmd":"git fsck --no-progress --connectivity-only"}
{"logger":"","ts":"2024-08-28 07:55:52.381773","caller":{"file":"main.go","line":1189},"level":6,"msg":"command result","stdout":"","stderr":"notice: HEAD points to an unborn branch (git-sync)\nnotice: No default references","time":"87.575774ms"}
{"logger":"","ts":"2024-08-28 07:55:52.381819","caller":{"file":"main.go","line":1095},"level":4,"msg":"repo directory is valid","path":"/tmp/git"}
{"logger":"","ts":"2024-08-28 07:55:52.381837","caller":{"file":"main.go","line":1122},"level":5,"msg":"running command","cwd":"/tmp/git","cmd":"git remote get-url origin"}
{"logger":"","ts":"2024-08-28 07:55:52.384369","caller":{"file":"main.go","line":1122},"level":6,"msg":"command result","stdout":<GITLAB_REPO_URL>","stderr":"","time":"2.46834ms"}
{"logger":"","ts":"2024-08-28 07:55:52.384457","caller":{"file":"main.go","line":804},"msg":"too many failures, aborting","error":"readlink /tmp/git/current: invalid argument","failCount":1}

We are running git-sync in a sidecar container to our pod.

from git-sync.

thockin avatar thockin commented on September 2, 2024

It looks.like readlink() is legitimately failing.

Can you run ls -la /tmp/git - what is the "current" item?

from git-sync.

lucabtg avatar lucabtg commented on September 2, 2024

Unfortunately our Container always crashes, so we can't do the command. In another container, that still uses v3 we get the following output:
image

from git-sync.

thockin avatar thockin commented on September 2, 2024

Can you run it with the container command set to [ sleep, inf ] and then kubectl exec into it and run the exact same git-sync command by hand?

Which exact version of git-sync is this?

Are you mounting a volume somewhere?

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.