Description of problem: Meet error 'unable to load template file "unable to load template file "openshift/hello-openshift": the path "openshift/hello-openshift" cannot be accessed: stat openshift/hello-openshift: not a directory' when run oc new-app openshift/hello-openshift:latest under a directory which contains the 'openshift' binary. Delete the openshift binary, or change to a nother directory without the openshift binary, oc new-app works well. Version-Release number of selected component (if applicable): oc v3.2.1.2-1-g64665fc kubernetes v1.2.0-36-g4a3f9c5 How reproducible: always Steps to Reproduce: 1. Login OpenShift and create project; 2. Suppose you have copied 'openshift' binary to a directory 'mydir' [root@pc ~]$ mkdir mydir [root@pc ~]$ cp /usr/bin/openshift mydir/ [root@pc ~]$ cd mydir/ [root@pc mydir] oc new-app openshift/hello-openshift:latest error: unable to load template file "openshift/hello-openshift:latest": the path "openshift/hello-openshift:latest" cannot be accessed: stat openshift/hello-openshift:latest: not a directory 3. Remove 'openshift' binary from 'mydir', then try oc new-app again [root@pc mydir] rm -f openshift [root@pc mydir] oc new-app openshift/hello-openshift:latest --> Found Docker image 3c55d5d (5 hours old) from Docker Hub for "openshift/hello-openshift:latest" * An image stream will be created as "hello-openshift:latest" that will track this image * This image will be deployed in deployment config "hello-openshift" * [WARNING] Image "hello-openshift" runs as the 'root' user which may not be permitted by your cluster administrator * Ports 8080/tcp, 8888/tcp will be load balanced by service "hello-openshift" --> Creating resources with label app=hello-openshift ... ... Actual results: 2. [root@pc mydir] oc new-app openshift/hello-openshift:latest error: unable to load template file "openshift/hello-openshift:latest": the path "openshift/hello-openshift:latest" cannot be accessed: stat openshift/hello-openshift:latest: not a directory Expected results: Create app successfully. Additional info: As far as I tried, old version of oc does not have the problem, e.g. oc v3.1.1.6-35-g0742c54, but oc v3.2.0.5 does have.
Pull request: https://github.com/openshift/origin/pull/11918 (I mixed up the BZ number, the one in commit message is wrong) Commit: https://github.com/openshift/origin/commit/b94313c00c053eaebf3f2183f15bd61b6516a7fd Should be included in OCP 3.5
This has been merged into ocp and is in OCP v3.5.0.7 or newer.
Confirmed with latest OCP, the issue has fixed: [root@zhouy testjson]# ll openshift -rwxr-xr-x. 1 root root 213234440 Jan 22 13:42 openshift [root@zhouy testjson]# oc new-app openshift/deployment-example --> Found Docker image 1c839d8 (18 months old) from Docker Hub for "openshift/deployment-example" * An image stream will be created as "deployment-example:latest" that will track this image * This image will be deployed in deployment config "deployment-example" * Port 8080/tcp will be load balanced by service "deployment-example" * Other containers can access this service through the hostname "deployment-example" * WARNING: Image "openshift/deployment-example" runs as the 'root' user which may not be permitted by your cluster administrator --> Creating resources ... imagestream "deployment-example" created deploymentconfig "deployment-example" created service "deployment-example" created --> Success Run 'oc status' to view your app. [root@zhouy testjson]# oc get po NAME READY STATUS RESTARTS AGE deployment-example-1-2mlwv 1/1 Running 0 1m [root@zhouy testjson]# oc version oc v3.5.0.7+390ef18 kubernetes v1.5.2+43a9be4 features: Basic-Auth GSSAPI Kerberos SPNEGO openshift v3.5.0.7+390ef18 kubernetes v1.5.2+43a9be4
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-2017:0884