Bug 1244696 - Build keeps pending if using either incorrect sourcesecretname or incorrect pullsecrectname
Summary: Build keeps pending if using either incorrect sourcesecretname or incorrect p...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Gaoyun Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-20 10:04 UTC by DeShuai Ma
Modified: 2015-11-23 14:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-23 14:26:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description DeShuai Ma 2015-07-20 10:04:52 UTC
Description of problem:
When delete the secret, then restart a build which use the secret to access private repo, the build status is always Pending and blocked.

Version-Release number of selected component (if applicable):
openshift v3.0.1.0-338-g9dfce43
kubernetes v1.0.0

How reproducible:
Always

Steps to Reproduce:
1. Generate a ssh key and upload the public key to github
$ ssh-keygen
$ cat ~/.ssh/id_rsa.pub

2. Create a new project
$ osadm new-project test

3. Create a secret
$ cat secret.json
{
   "apiVersion": "v1beta3",
   "kind": "Secret",
   "metadata": {
      "name": "mysecret"
   },
   "data": {
      "ssh-privatekey": "<<< place here the result of base64 -w 0 ~/.ssh/id_rsa >>>"
   }
}
$ osc create -f secret.json -n test

4. Edit application-template-stibuild.json, add ref info to it like below:
$ cd /data/src/github.com/openshift/origin/examples/sample-app
$ vim application-template-stibuild.json
{
   "apiVersion": "v1beta1",
   "kind": "BuildConfig",
   "metadata": {
     "name": "ruby-sample-build",
...
     "source": {
       "git": {
         "uri": "git:openshift/ruby-hello-world.git"
       },
       "sourceSecretName": "mysecret",
       "type": "Git"
     },
}

5. Submit the application template for processing and create the application using the processed template:
$ osc process -n test -f application-template-stibuild.json | osc create -n test -f -

6. Start a build and check the build result
$ osc start-build $buildConfig -n test
$ osc get build -n test

7. Delete the secret
$ osc delete secret mysecret -n test

8. Restart build and check the build result
$ osc start-build $buildConfig -n test
$ osc get build -n test
$ osc build-logs $buildname -n test

Actual results:
8.The build ruby-sample-build-2 status is always Pending
$ osc get build -n test
NAME                  TYPE      STATUS     POD
ruby-sample-build-1   STI       Complete   ruby-sample-build-1
ruby-sample-build-2   STI       Pending    ruby-sample-build-2
$ osc build-logs ruby-sample-build-2 -n test
Error from server: timed out waiting for build

Expected results:
8.The build should be failed, and tip can't find secret in buildlogs.

Additional info:
On origin, this bug have fixed: https://bugzilla.redhat.com/show_bug.cgi?id=1220979

Comment 1 Ben Parees 2015-09-11 03:38:46 UTC
guessing this has made it to OSE by now since it was fixed in origin a while ago.

Comment 2 DeShuai Ma 2015-09-11 08:41:00 UTC
bash-4.2$ [fedora@ip-172-18-9-103 kubernetes]$ openshift version
openshift v1.0.5-344-gd9fb965
kubernetes v1.1.0-alpha.0-1605-g44c91b1

dhcp-128-95:sample-app dma$ oc get build
NAME                  TYPE      STATUS    POD
ruby-sample-build-1   Source    Failed    ruby-sample-build-1-build
dhcp-128-95:sample-app dma$ oc build-logs ruby-sample-build-1
I0911 04:21:13.413566       1 sti.go:74] The value of ALLOWED_UIDS is [1-]
I0911 04:21:13.721301       1 docker.go:211] Image openshift/ruby-20-centos7@sha256:97630cc0a75f553315ea7723fcfb23c281fe879ffb02dde85834312db07833a8 available locally
I0911 04:21:13.721420       1 sti.go:96] Creating a new S2I builder with build config: "Builder Name:\t\tRuby 2.0\nBuilder Image:\t\topenshift/ruby-20-centos7@sha256:97630cc0a75f553315ea7723fcfb23c281fe879ffb02dde85834312db07833a8\nBuilder Image Version:\t86fb96b\nBuilder Base Version:\tda8a37c\nSource:\t\t\tgit:openshift/ruby-hello-world.git\nOutput Image Tag:\t172.30.70.99:5000/dma6/origin-ruby-sample:latest\nEnvironment:\t\tOPENSHIFT_BUILD_NAME=ruby-sample-build-1,OPENSHIFT_BUILD_NAMESPACE=dma6,OPENSHIFT_BUILD_SOURCE=git:openshift/ruby-hello-world.git\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"
I0911 04:21:14.107555       1 docker.go:211] Image openshift/ruby-20-centos7@sha256:97630cc0a75f553315ea7723fcfb23c281fe879ffb02dde85834312db07833a8 available locally
I0911 04:21:14.333356       1 sti.go:123] Preparing to build 172.30.70.99:5000/dma6/origin-ruby-sample:latest
I0911 04:21:14.334725       1 clone.go:28] Cloning into /tmp/sti923750021/upload/src
I0911 04:21:15.320874       1 clone.go:30] Git clone failed: exit status 128
I0911 04:21:15.320954       1 cleanup.go:23] Removing temporary directory /tmp/sti923750021
I0911 04:21:15.320966       1 fs.go:99] Removing directory '/tmp/sti923750021'
F0911 04:21:15.321407       1 builder.go:54] Build error: exit status 128

Comment 3 Brenton Leanhardt 2015-11-23 14:26:02 UTC
This fix is available in OpenShift Enterprise 3.1.


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