Bug 1253119 - [origin_devexp_555]Build unable to download the source code from authenticated origin-gitserver
[origin_devexp_555]Build unable to download the source code from authenticate...
Product: OpenShift Origin
Classification: Red Hat
Component: Build (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Cesar Wong
Wenjing Zheng
Depends On:
  Show dependency treegraph
Reported: 2015-08-12 23:13 EDT by DeShuai Ma
Modified: 2015-11-23 16:16 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-23 16:16:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description DeShuai Ma 2015-08-12 23:13:54 EDT
Description of problem:
When config REQUIRE_SERVER_AUTH or REQUIRE_GIT_AUTH in origin-gitserver it's authenticated, then use this gitserver repo to do build, the build unable to download the code. it's failed with erro: "Git clone failed: exit status 128"

Version-Release number of selected component (if applicable):
openshift v1.0.4-206-g4dc6b89
kubernetes v1.1.0-alpha.0-1155-gb73c53c

How reproducible:

Steps to Reproduce:
1.Deploy an authenticated gitserver
$ oc create -f examples/gitserver/gitserver.yaml -n dma1

2.Create a repo on the private gitserver
$ git clone

3.Use the private gitserver repo to create an application and start a build
4.Check the build.

Actual results:
4.The build is failed, it can't download the private source code.

Expected results:
4.The build should be succeed.

Additional info:
[fedora@ip-10-109-179-203 sample-app]$ oc build-logs ruby-sample-build-1 -n dma2
I0811 08:59:48.452202       1 builder.go:39] $BUILD env var is {"kind":"Build","apiVersion":"v1","metadata":{"name":"ruby-sample-build-1","namespace":"dma2","selfLink":"/oapi/v1/namespaces/dma2/builds/ruby-sample-build-1","uid":"4f4ab27c-4007-11e5-900f-22000ba294f3","resourceVersion":"4269","creationTimestamp":"2015-08-11T08:59:44Z","labels":{"buildconfig":"ruby-sample-build","name":"ruby-sample-build","template":"application-template-stibuild"}},"spec":{"serviceAccount":"builder","source":{"type":"Git","git":{"uri":""}},"strategy":{"type":"Source","sourceStrategy":{"from":{"kind":"DockerImage","name":"openshift/ruby-20-centos7:latest"}}},"output":{"to":{"kind":"DockerImage","name":""},"pushSecret":{"name":"builder-dockercfg-y6s2m"}},"resources":{}},"status":{"phase":"Pending","config":{"kind":"BuildConfig","namespace":"dma2","name":"ruby-sample-build"}}}
I0811 08:59:48.485092       1 cfg.go:78] Found Docker authentication configuration in '/root/.dockercfg'
I0811 08:59:48.485216       1 cfg.go:50] Problem accessing /root/.dockercfg: stat /root/.dockercfg: no such file or directory
I0811 08:59:48.552454       1 docker.go:199] Image openshift/ruby-20-centos7:latest available locally
I0811 08:59:48.552533       1 sti.go:93] Creating a new S2I builder with build config: "Builder Name:\t\tRuby 2.0\nBuilder Image:\t\topenshift/ruby-20-centos7:latest\nBuilder Image Version:\ta085e45\nBuilder Base Version:\tc7358a4\nSource:\t\t\thttp://\nOutput Image Tag:\t172.30.120.233:5000/dma2/origin-ruby-sample:latest\nEnvironment:\t\tOPENSHIFT_BUILD_NAMESPACE=dma2,OPENSHIFT_BUILD_SOURCE=,OPENSHIFT_BUILD_NAME=ruby-sample-build-1\nIncremental Build:\tdisabled\nRemove Old Build:\tdisabled\nForce Pull:\t\tdisabled\nQuiet:\t\t\tdisabled\nLayered Build:\t\tdisabled\nDocker Endpoint:\tunix:///var/run/docker.sock\n"
I0811 08:59:48.578225       1 docker.go:199] Image openshift/ruby-20-centos7:latest available locally
I0811 08:59:48.581989       1 sti.go:99] Starting S2I build from dma2/ruby-sample-build-1 BuildConfig ...
I0811 08:59:48.582044       1 sti.go:118] Building
I0811 08:59:48.582465       1 clone.go:28] Cloning into /tmp/sti487069336/upload/src
I0811 08:59:48.772584       1 clone.go:30] Git clone failed: exit status 128
I0811 08:59:48.772686       1 cleanup.go:23] Removing temporary directory /tmp/sti487069336
I0811 08:59:48.772695       1 fs.go:99] Removing directory '/tmp/sti487069336'
F0811 08:59:48.794139       1 builder.go:62] Build error: exit status 128
Comment 1 Clayton Coleman 2015-08-20 22:54:07 EDT
Need the build config to support token based secrets, which have to be added to Git when it clones, and then the auto build code needs to update the secret on the build config to point to its own secret (and save the old one in an annotation).
Comment 2 Ben Parees 2015-09-10 23:36:35 EDT
Cesar you can move this to on_qa if you think it's ready.  QE might need the docs updated before they can verify it though.
Comment 4 DeShuai Ma 2015-10-08 05:21:46 EDT
when config REQUIRE_GIT_AUTH with private gitserver, it works well can clone the private git repo.
But when config REQUIRE_SERVER_AUTH using token, it still error:
Comment 5 DeShuai Ma 2015-10-08 06:28:18 EDT
When the git repo is not empty will works well.
verify this bug.
[fedora@ip-172-18-2-255 gitserver]$ openshift version
openshift v1.0.6-328-gdf1f19e
kubernetes v1.1.0-alpha.1-653-g86b4e77

Note You need to log in before you can comment on or make changes to this bug.