Bug 1275549 - Build failed when using 'oc new-app --context-dir'
Summary: Build failed when using 'oc new-app --context-dir'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Scott Dodson
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-27 08:35 UTC by Wang Haoran
Modified: 2015-11-23 14:44 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description Wang Haoran 2015-10-27 08:35:22 UTC
Description of problem:

After create app using oc new-app --context-dir , the build will failed.Since the files under contextdir should copy to the src dir in the build pod, not the whole git repo.
Version-Release number of selected component (if applicable):
openshift v3.0.2.903-29-g49953d6
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
oc v3.0.2.903-29-g49953d6

How reproducible:
always

Steps to Reproduce:
1.create a project
$oc new-project test
2.new app
$oc new-app  https://github.com/openshift/sti-nodejs.git --context-dir=0.10/test/test-app/ --name='nodejs-test'
3.check the build log
$oc get build
$oc build-logs nodejs-test-1


Actual results:
the build failed
I1027 04:09:46.950918       1 sti.go:448] ---> Installing application source
I1027 04:09:46.982971       1 sti.go:448] ---> Building your Node application from source
E1027 04:09:48.033881       1 util.go:85] npm info it worked if it ends with ok
E1027 04:09:48.033911       1 util.go:85] npm info using npm.28
E1027 04:09:48.033930       1 util.go:85] npm info using node.35
E1027 04:09:48.254073       1 util.go:85] npm ERR! install Couldn't read dependencies
E1027 04:09:48.254108       1 util.go:85] npm ERR! package.json ENOENT, open '/opt/app-root/src/package.json'
E1027 04:09:48.254135       1 util.go:85] npm ERR! package.json This is most likely not a problem with npm itself.
E1027 04:09:48.254143       1 util.go:85] npm ERR! package.json npm can't find a package.json file in your current directory.
E1027 04:09:48.254149       1 util.go:85] 
E1027 04:09:48.254155       1 util.go:85] npm ERR! System Linux 3.10.0-324.el7.x86_64
E1027 04:09:48.254161       1 util.go:85] npm ERR! command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install" "-d"
E1027 04:09:48.254167       1 util.go:85] npm ERR! cwd /opt/app-root/src
E1027 04:09:48.254173       1 util.go:85] npm ERR! node -v v0.10.35
E1027 04:09:48.254351       1 util.go:85] npm ERR! npm -v 1.4.28
E1027 04:09:48.254363       1 util.go:85] npm ERR! path /opt/app-root/src/package.json
E1027 04:09:48.254369       1 util.go:85] npm ERR! code ENOPACKAGEJSON
E1027 04:09:48.254377       1 util.go:85] npm ERR! errno 34
E1027 04:09:48.254401       1 util.go:85] npm ERR! 
E1027 04:09:48.254438       1 util.go:85] npm ERR! Additional logging details can be found in:
E1027 04:09:48.254461       1 util.go:85] npm ERR!     /opt/app-root/src/npm-debug.log
E1027 04:09:48.254474       1 util.go:85] npm ERR! not ok code 0

Expected results:
the build should success.

Additional info:
using sti command manually will success.like this:
s2i build https://github.com/openshift/sti-nodejs.git --context-dir=0.10/test/test-app/ openshift/nodejs-010-centos7 nodejs-sample-app

Comment 2 Ben Parees 2015-10-27 19:50:53 UTC
I tested this and it worked as expected.  If you can recreate it, please provide the following additional information:

1) the json for the buildconfig that was defined by new-app
2) run openshift with --loglevel=5 provide the failing build logs from that (setting openshift to loglevel 5 also enables verbose logging for the builds)

Comment 3 Wang Haoran 2015-10-28 02:15:26 UTC
Ben ,I test it again, same problem, see the buiconfig and build log with level 5.
http://pastebin.test.redhat.com/323097

Comment 4 Ben Parees 2015-10-28 02:58:14 UTC
i'm afraid you're going to need to wait for a new puddle to verify this, it appears the fix for context-dir behavior isn't in the level you're using.  can you confirm against origin?

Comment 5 Ben Parees 2015-10-28 03:17:00 UTC
looks like the commit in question that fixed this was f076ce8eac7f5dab51f69de4e48d5a56adb99fd5 which went into origin on 10/24.

it was broken since b10d7000b8a149e823e2874916fe9ca399e23aff which went in on 10/15.

Comment 6 Wang Haoran 2015-10-28 05:39:58 UTC
it works with origin env , will verify again when the fix is merged to ose

Comment 7 Wang Haoran 2015-10-29 12:13:08 UTC
verified on this version:
openshift v3.0.2.903-114-g2849767
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4

still failed.

Comment 8 Ben Parees 2015-10-29 15:05:28 UTC
Looks like the images weren't rebuilt with that puddle and this fix requires a new origin-sti-builder image.

Assigning to scott to move to ON_QA when that happens.

Comment 9 Scott Dodson 2015-11-02 21:22:28 UTC
Images have been rebuilt.

Comment 10 Wang Haoran 2015-11-03 05:33:38 UTC
Verified with version:
openshift v3.0.2.905
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4


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