Giter VIP home page Giter VIP logo

Comments (5)

kittaakos avatar kittaakos commented on July 26, 2024

After resolving #113, I have managed to use an external Git executable for cloning public repositories on both OS X and Windows. Unfortunately, it still fails on Linux. I can see such errors on the CI:

GitError: Cloning into '/tmp/d-11784-3076-1xxin47.zddvqs38fr'...
fatal: unable to access 'https://github.com/TypeFox/dugite-extra.git/': Problem with the SSL CA cert (path? access rights?)

The same test happily passes when I do not use an external Git executable but the one shipped with dugite.

What do you think, does my error somehow related to this ticket? Thanks in advance for your kind help!

from dugite.

shiftkey avatar shiftkey commented on July 26, 2024

@kittaakos yeah, this is related to your setup. Thanks for uncovering it!

The bundled certificates referred to here come from the upstream curl project.

I think the changes around using an external Git now break these lines (because you're using LOCAL_GIT_DIRECTORY rather than the inbuilt Git directory):

const sslCABundle = `${gitDir}/ssl/cacert.pem`
env.GIT_SSL_CAINFO = sslCABundle

What if we did something like this inside that last Linux conditional?

if (process.platform === 'linux') {
  // when building Git for Linux and then running it from
  // an arbitrary location, you should set PREFIX for the
  // process to ensure that it knows how to resolve things
  env.PREFIX = gitDir

  // if the user hasn't specified their own certificate bundle
  if (!process.env.GIT_SSL_CAINFO) {
    // resolve the path to the original Git directory
    const distroPath = ...
    
    // bypass whatever certificates might be set and use
    // the bundle included in the distribution
    const sslCABundle = `${distroPath}/ssl/cacert.pem`
    env.GIT_SSL_CAINFO = sslCABundle
  }
}

from dugite.

ShubhamManuSharma avatar ShubhamManuSharma commented on July 26, 2024

hello sir,
I am stuck in quite similar problem as i can seen here,
The main Issue is pipeline stuck. As i am pasting the stuck section of pipeline. The question is,
Is it the same problem due to GIT_SSL_CAINFO variable setting??

++ export GIT_SSL_CAINFO=/home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot.tmp/GIT_SSL_CAINFO
++ GIT_SSL_CAINFO=/home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot.tmp/GIT_SSL_CAINFO
++ mkdir -p /home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot.tmp/git-template
++ rm -r -f /home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot
++ git config -f /home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot.tmp/git-template/config fetch.recurseSubmodules false
++ echo 'Cloning repository...'
Cloning repository...
++ git clone --no-checkout https://gitlab-ci-token:[email protected]/buildroot_source/buildroot.git /home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot --template /home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot.tmp/git-template
Cloning into '/home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot'...
++ cd /home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot
++ echo 'Checking out 07939291 as sched...'
Checking out 07939291 as sched...
++ git checkout -f -q 079392912e17290f3de1167b42072db42293ee88
++ echo 'Skipping Git submodules setup'
Skipping Git submodules setup

  • exit 0
    ERROR: Job failed: execution took longer than 2h0m0s seconds

from dugite.

shiftkey avatar shiftkey commented on July 26, 2024

Is it the same problem due to GIT_SSL_CAINFO variable setting??

@ShubhamManuSharma I'm not sure where this value is coming from:

++ export GIT_SSL_CAINFO=/home/gitlab-runner/builds/541451b1/1/buildroot_source/buildroot.tmp/GIT_SSL_CAINFO

From the Git documentation:

http.sslCAInfo::
	File containing the certificates to verify the peer with when
	fetching or pushing over HTTPS. Can be overridden by the
	`GIT_SSL_CAINFO` environment variable.

This should point to a file on disk containing certificates that can be used, but it doesn't look like a valid file.

from dugite.

shiftkey avatar shiftkey commented on July 26, 2024

@ShubhamManuSharma actually, I think you'll need to talk with GitLab runner support as it seems that the Git operations are successful and the job times out somewhere in the pipeline:

exit 0
ERROR: Job failed: execution took longer than 2h0m0s seconds

from dugite.

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.