Description of problem: When running a successful docker build in OpenShift 3.1.1.6, we can see the following error message in the logs of the build: Error getting git info: error invoking 'config --get remote.origin.url': exit status 1 In our build, we have configured a private github repository accessed via an http proxy requiring basic authentication and the server is requiring a configuration of a CA certificate. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: It shows an error message even the build succeeds. Expected results: We shouldn't see this message when the application is build without any issue. Additional info:
Fixed in origin with https://github.com/openshift/origin/pull/8260
This has been merged and is in OSE v3.3.0.8 or newer.
Reproduced with openshift v3.2.1.10-1-g668ed0a kubernetes v1.2.0-36-g4a3f9c5 etcd 2.2.5 Step: 1.Create a git server, and push code to git server $oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/gitserver/gitserver-ephemeral.yaml $oc policy add-role-to-user edit -z git 1.1 Setup your credentials $oc get route g [ $ Ruta oc get] [ $ Ruta oc get] it $ git config --global credential.http://<route>.helper '!f() { echo "username=<username>"; echo "password=<oc whoami -t>"; }; f' 1.2 Push a repository to your git server .In an existing repository, add a remote that points to the git server and push to it $ git clone https://github.com/openshift/ruby-hello-world.git $ cd ruby-hello-world $ git remote add openshift http://<route>/ruby-hello-world.git $ git push openshift master 2.Trigger a docker build from this private repo with secret of gitconfig auth 2.1. Disable anonymous to clone gitserver repo $oc set env dc/git ALLOW_ANON_GIT_PULL=false 2.2. Create a .gitconfig file under home dir(.gitconfig Must be the below format) $cat .gitconfig [url "http://<username>:<oc whoami -t>@git:8080/ruby-hello-world.git"] insteadOf = "http://git:8080/ruby-hello-world.git" 2.3. Create a secret $ oc secrets new mysecret path/to/.gitconfig 3. Add sourcesecret into bc, trigger new build Actual result: Build is successful, and get error in buildlog I0722 04:03:26.673993 1 repository.go:298] Executing git config --get remote.origin.url I0722 04:03:26.676257 1 repository.go:318] Exec error: exit status 1
test with openshift v3.3.0.8 kubernetes v1.3.0+57fb9ac etcd 2.3.0+git repeat step like above comment actual result: get error in buildlog-- I0722 04:34:03.338528 1 repository.go:349] Executing GIT_ASKPASS=true HOME=/tmp/git500124267 GIT_CONFIG=/tmp/git500124267/.gitconfig PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr /bin:/sbin:/bin HOSTNAME=ruby-hello-world-2-build BUILD={"kind":"Build","apiVersion":"v1","metadata":{"name":"ruby-hello-world-2","namespace":"dyan7","selfLink":"/oapi/v1/namespaces/dyan7/b uilds/ruby-hello-world-2","uid":"034c19c7-4fe7-11e6-acd7-0e212aa9b5c7","resourceVersion":"22965","creationTimestamp":"2016-07-22T08:33:49Z","labels":{"app":"ruby-hello-world","buildconfig": "ruby-hello-world","openshift.io/build-config.name":"ruby-hello-world","openshift.io/build.start-policy":"Serial"},"annotations":{"openshift.io/build-config.name":"ruby-hello-world","opensh ift.io/build.number":"2"}},"spec":{"serviceAccount":"builder","source":{"type":"Git","git":{"uri":"http://git:8080/ruby-hello-world.git"},"sourceSecret":{"name":"mysecret"},"secrets":[]},"s trategy":{"type":"Docker","dockerStrategy":{"from":{"kind":"DockerImage","name":"centos/ruby-22-centos7@sha256:64461b5111fc71ec4ef79670c57fe4a55e46df01d6a6d2ef5d8451da84784b8a"}}},"output": {"to":{"kind":"DockerImage","name":"172.30.139.34:5000/dyan7/ruby-hello-world:latest"},"pushSecret":{"name":"builder-dockercfg-3ep4u"}},"resources":{},"postCommit":{},"triggeredBy":[{"messa ge":"Generic WebHook","genericWebHook":{"secret":"hG4YUhYETx***"}}]},"status":{"phase":"New","outputDockerImageReference":"172.30.139.34:5000/dyan7/ruby-hello-world:latest","config":{"kind" :"BuildConfig","namespace":"dyan7","name":"ruby-hello-world"}}} BUILD_LOGLEVEL=5 SOURCE_REPOSITORY=http://git:8080/ruby-hello-world.git SOURCE_URI=http://git:8080/ruby-hello-world.git ORIGIN_VERSION=v3.3.0.8 PUSH_DOCKERCFG_PATH=/var/run/secrets/openshi ft.io/push SOURCE_SECRET_PATH=/var/run/secrets/openshift.io/source GIT_PORT_8080_TCP_PORT=8080 KUBERNETES_PORT_443_TCP_ADDR=172.30.0.1 RUBY_HELLO_WORLD_PORT=tcp://172.30.15.32:8080 GIT_PORT=tcp://172.30.18.163:8080 RUBY_HELLO_WORLD_PORT_8080_TCP_PORT=8080 KUBERNETES_PORT_53_UDP_PORT=53 KUBERNETES_PORT_53_TCP_PROTO=tcp KUBERNETES_PORT_53_TCP_PORT=53 RUBY_HELLO_WORLD_SERVICE_HOST=172.30.15.32 RUBY_HELLO_WORLD_PORT_8080_TCP=tcp://172.30.15.32:8080 KUBERNETES_SERVICE_PORT_DNS_TCP=53 GIT_PORT_8080_TCP=tcp://172.30.18.163:8080 GIT_PORT_8080_TCP_PROTO=tcp KUBERNETES_PORT=tcp://172.30.0.1:443 KUBERNETES_PORT_443_TCP=tcp://172.30.0.1:443 KUBERNETES_PORT_443_TCP_PORT=443 RUBY_HELLO_WORLD_SERVICE_PORT=8080 GIT_SERVICE_HOST=172.30.18.163 KUBERNETES_PORT_53_UDP=udp://172.30.0.1:53 KUBERNETES_PORT_53_TCP_ADDR=172.30.0.1 RUBY_HELLO_WORLD_PORT_8080_TCP_ADDR=172.30.15.32 KUBERNETES_SERVICE_PORT_DNS=53 KUBERNETES_PORT_53_TCP=tcp://172.30.0.1:53 KUBERNETES_SERVICE_HOST=172.30.0.1 KUBERNETES_SERVICE_PORT_HTTPS=443 KUBERNETES_PORT_53_UDP_ADDR=172.30.0.1 KUBERNETES_PORT_443_TCP_PROTO=tcp KUBERNETES_PORT_53_UDP_PROTO=udp GIT_SERVICE_PORT=8080 GIT_PORT_8080_TCP_ADDR=172.30.18.163 KUBERNETES_SERVICE_PORT=443 RUBY_HELLO_WORLD_SERVICE_PORT_8080_TCP=8080 RUBY_HELLO_WORLD_PORT_8080_TCP_PROTO=tcp container=docker OPENSHIFT_CONTAINERIZED=true KUBECONFIG=/var/lib/origin/openshift.local.config/master/admin.kubeconfig git config --get remote.origin.url I0722 04:34:03.340710 1 repository.go:402] Error executing command: exit status 1
The error still gets surfaced with BUILD_LOGLEVEL set to 4 or greater. What https://github.com/openshift/origin/pull/8260 fixes is that it no longer should fail the build or surface the error in default (level 2 or less) logging.
Test with openshift v3.3.0.11 kubernetes v1.3.0+57fb9ac etcd 2.3.0+git When set build loglevel to 2, the error will not surface $ oc start-build ruby-hello-world --build-loglevel=2 log: Downloading "http://git:8080/ruby-hello-world.git" ... Step 1 : FROM centos/ruby-22-centos7@sha256:6762bce40196b43d8a63fc3a3644d37197082ed173c5aec158980b5f1c1944e2 ---> e5a9e7f675cb Step 2 : ENV "BUILD_LOGLEVEL" "2" ---> Running in 062ff7a28dd8 ---> 85a86dcfd1c1
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1933