Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running origin as a container, I cannot create new app #7256

Closed
rualthan opened this issue Feb 12, 2016 · 10 comments
Closed

Running origin as a container, I cannot create new app #7256

rualthan opened this issue Feb 12, 2016 · 10 comments

Comments

@rualthan
Copy link

I am trying OO on a RHEL Atomic Host. I spun up OO master as a container following this guide
https://docs.openshift.org/latest/getting_started/administrators.html

After attaching a shell to the Master Container, I cannot deploy an app following the "Try it out" steps
https://docs.openshift.org/latest/getting_started/administrators.html#try-it-out

# oc new-app openshift/deployment-example
error: can't look up Docker image "openshift/deployment-example": Internal error occurred: Get    https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection
 error: no match for "openshift/deployment-example"

 The 'oc new-app' command will match arguments to the following types:

 1. Images tagged into image streams in the current project or the 'openshift' project
 - if you don't specify a tag, we'll add ':latest'
 2. Images in the Docker Hub, on remote registries, or on the local Docker engine
 3. Templates in the current project or the 'openshift' project
 4. Git repository URLs or local paths that point to Git repositories

--allow-missing-images can be used to point to an image that does not exist yet.

See 'oc new-app -h' for examples.

The Atomic host needs proxy to access Internet. I have configured proxy in /etc/sysconfig/docker and that is how I could pull the origin image in the same place.

I am using the image pushed 3 hours ago

oc version

oc v1.1.2-223-g2ca50e6
kubernetes v1.2.0-origin

# oc new-app --loglevel=8  openshift/deployment-example
I0212 15:00:01.715506   71421 loader.go:242] Config loaded from file /var/lib/origin/openshift.local.config/master/admin.kubeconfig
I0212 15:00:01.716388   71421 loader.go:242] Config loaded from file /var/lib/origin/openshift.local.config/master/admin.kubeconfig
I0212 15:00:01.716813   71421 round_trippers.go:264] GET https://192.168.96.49:8443/oapi
I0212 15:00:01.716820   71421 round_trippers.go:271] Request Headers:
I0212 15:00:01.716826   71421 round_trippers.go:274]     User-Agent: oc/v1.1.2 (linux/amd64) openshift/2ca50e6
I0212 15:00:01.716830   71421 round_trippers.go:274]     Authorization: Bearer TrITg8mFc9n2nZLV4jf6r1wVLYhaUhHegZFQHthqWiU
I0212 15:00:01.754203   71421 round_trippers.go:289] Response Status: 200 OK in 37 milliseconds
I0212 15:00:01.754218   71421 round_trippers.go:292] Response Headers:
I0212 15:00:01.754224   71421 round_trippers.go:295]     Date: Fri, 12 Feb 2016 15:00:01 GMT
I0212 15:00:01.754228   71421 round_trippers.go:295]     Content-Length: 59
I0212 15:00:01.754233   71421 round_trippers.go:295]     Cache-Control: no-store
I0212 15:00:01.754237   71421 round_trippers.go:295]     Content-Type: application/json
I0212 15:00:01.754280   71421 request.go:878] Response Body: {"kind":"APIVersions","apiVersion":"v1","versions":["v1"]}
I0212 15:00:01.755319   71421 loader.go:242] Config loaded from file /var/lib/origin/openshift.local.config/master/admin.kubeconfig
I0212 15:00:01.756148   71421 loader.go:242] Config loaded from file /var/lib/origin/openshift.local.config/master/admin.kubeconfig
I0212 15:00:01.758052   71421 loader.go:242] Config loaded from file /var/lib/origin/openshift.local.config/master/admin.kubeconfig
I0212 15:00:01.758978   71421 loader.go:242] Config loaded from file /var/lib/origin/openshift.local.config/master/admin.kubeconfig
I0212 15:00:01.759264   71421 round_trippers.go:264] GET https://192.168.96.49:8443/api
I0212 15:00:01.759272   71421 round_trippers.go:271] Request Headers:
I0212 15:00:01.759276   71421 round_trippers.go:274]     Authorization: Bearer TrITg8mFc9n2nZLV4jf6r1wVLYhaUhHegZFQHthqWiU
I0212 15:00:01.760898   71421 round_trippers.go:289] Response Status: 200 OK in 1 milliseconds
I0212 15:00:01.760920   71421 round_trippers.go:292] Response Headers:
I0212 15:00:01.760925   71421 round_trippers.go:295]     Cache-Control: no-store
I0212 15:00:01.760930   71421 round_trippers.go:295]     Content-Type: application/json
I0212 15:00:01.760935   71421 round_trippers.go:295]     Date: Fri, 12 Feb 2016 15:00:01 GMT
I0212 15:00:01.760939   71421 round_trippers.go:295]     Content-Length: 69
I0212 15:00:01.760958   71421 request.go:878] Response Body: {"kind":"APIVersions","apiVersion":"v1","versions":["v1","v1beta3"]}
I0212 15:00:01.761158   71421 round_trippers.go:264] GET https://192.168.96.49:8443/apis
I0212 15:00:01.761166   71421 round_trippers.go:271] Request Headers:
I0212 15:00:01.761170   71421 round_trippers.go:274]     Authorization: Bearer TrITg8mFc9n2nZLV4jf6r1wVLYhaUhHegZFQHthqWiU
I0212 15:00:01.762870   71421 round_trippers.go:289] Response Status: 200 OK in 1 milliseconds
I0212 15:00:01.762888   71421 round_trippers.go:292] Response Headers:
I0212 15:00:01.762893   71421 round_trippers.go:295]     Date: Fri, 12 Feb 2016 15:00:01 GMT
I0212 15:00:01.762898   71421 round_trippers.go:295]     Content-Length: 223
I0212 15:00:01.762903   71421 round_trippers.go:295]     Cache-Control: no-store
I0212 15:00:01.762908   71421 round_trippers.go:295]     Content-Type: application/json
I0212 15:00:01.762926   71421 request.go:878] Response Body: {"kind":"APIGroupList","apiVersion":"v1","groups":[{"name":"extensions","versions":[{"groupVersion":"extensions/v1beta1","version":"v1beta1"}],"preferredVersion":{"groupVersion":"extensions/v1beta1","version":"v1beta1"}}]}
I0212 15:00:01.763390   71421 imagestreamlookup.go:47] checking ImageStreams openshift/deployment-example with ref "latest"
I0212 15:00:01.763468   71421 round_trippers.go:264] GET https://192.168.96.49:8443/oapi/v1/namespaces/openshift/imagestreams
I0212 15:00:01.763475   71421 round_trippers.go:271] Request Headers:
I0212 15:00:01.763480   71421 round_trippers.go:274]     User-Agent: oc/v1.1.2 (linux/amd64) openshift/2ca50e6
I0212 15:00:01.763495   71421 round_trippers.go:274]     Authorization: Bearer TrITg8mFc9n2nZLV4jf6r1wVLYhaUhHegZFQHthqWiU
I0212 15:00:01.765495   71421 round_trippers.go:289] Response Status: 200 OK in 1 milliseconds
I0212 15:00:01.765508   71421 round_trippers.go:292] Response Headers:
I0212 15:00:01.765513   71421 round_trippers.go:295]     Cache-Control: no-store
I0212 15:00:01.765519   71421 round_trippers.go:295]     Content-Type: application/json
I0212 15:00:01.765524   71421 round_trippers.go:295]     Date: Fri, 12 Feb 2016 15:00:01 GMT
I0212 15:00:01.765529   71421 round_trippers.go:295]     Content-Length: 149
I0212 15:00:01.765554   71421 request.go:878] Response Body: {"kind":"ImageStreamList","apiVersion":"v1","metadata":{"selfLink":"/oapi/v1/namespaces/openshift/imagestreams","resourceVersion":"412"},"items":[]}
I0212 15:00:01.765782   71421 round_trippers.go:264] GET https://192.168.96.49:8443/oapi/v1/namespaces/test/templates
I0212 15:00:01.765791   71421 round_trippers.go:271] Request Headers:
I0212 15:00:01.765795   71421 round_trippers.go:274]     User-Agent: oc/v1.1.2 (linux/amd64) openshift/2ca50e6
I0212 15:00:01.765800   71421 round_trippers.go:274]     Authorization: Bearer TrITg8mFc9n2nZLV4jf6r1wVLYhaUhHegZFQHthqWiU
I0212 15:00:01.767624   71421 round_trippers.go:289] Response Status: 200 OK in 1 milliseconds
I0212 15:00:01.767635   71421 round_trippers.go:292] Response Headers:
I0212 15:00:01.767640   71421 round_trippers.go:295]     Content-Length: 138
I0212 15:00:01.767645   71421 round_trippers.go:295]     Cache-Control: no-store
I0212 15:00:01.767650   71421 round_trippers.go:295]     Content-Type: application/json
I0212 15:00:01.767654   71421 round_trippers.go:295]     Date: Fri, 12 Feb 2016 15:00:01 GMT
I0212 15:00:01.767690   71421 request.go:878] Response Body: {"kind":"TemplateList","apiVersion":"v1","metadata":{"selfLink":"/oapi/v1/namespaces/test/templates","resourceVersion":"412"},"items":[]}
I0212 15:00:01.767922   71421 round_trippers.go:264] GET https://192.168.96.49:8443/oapi/v1/namespaces/openshift/templates
I0212 15:00:01.767930   71421 round_trippers.go:271] Request Headers:
I0212 15:00:01.767935   71421 round_trippers.go:274]     User-Agent: oc/v1.1.2 (linux/amd64) openshift/2ca50e6
I0212 15:00:01.767939   71421 round_trippers.go:274]     Authorization: Bearer TrITg8mFc9n2nZLV4jf6r1wVLYhaUhHegZFQHthqWiU
I0212 15:00:01.769786   71421 round_trippers.go:289] Response Status: 200 OK in 1 milliseconds
I0212 15:00:01.769797   71421 round_trippers.go:292] Response Headers:
I0212 15:00:01.769802   71421 round_trippers.go:295]     Cache-Control: no-store
I0212 15:00:01.769807   71421 round_trippers.go:295]     Content-Type: application/json
I0212 15:00:01.769812   71421 round_trippers.go:295]     Date: Fri, 12 Feb 2016 15:00:01 GMT
I0212 15:00:01.769816   71421 round_trippers.go:295]     Content-Length: 143
I0212 15:00:01.769834   71421 request.go:878] Response Body: {"kind":"TemplateList","apiVersion":"v1","metadata":{"selfLink":"/oapi/v1/namespaces/openshift/templates","resourceVersion":"412"},"items":[]}
I0212 15:00:01.770373   71421 request.go:583] Request Body: {"kind":"ImageStreamImport","apiVersion":"v1","metadata":{"name":"newapp","creationTimestamp":null},"spec":{"import":false,"images":[{"from":{"kind":"DockerImage","name":"openshift/deployment-example"},"importPolicy":{}}]},"status":{}}
I0212 15:00:01.770403   71421 round_trippers.go:264] POST https://192.168.96.49:8443/oapi/v1/namespaces/test/imagestreamimports
I0212 15:00:01.770409   71421 round_trippers.go:271] Request Headers:
I0212 15:00:01.770413   71421 round_trippers.go:274]     Content-Type: application/json
I0212 15:00:01.770418   71421 round_trippers.go:274]     User-Agent: oc/v1.1.2 (linux/amd64) openshift/2ca50e6
I0212 15:00:01.770422   71421 round_trippers.go:274]     Authorization: Bearer TrITg8mFc9n2nZLV4jf6r1wVLYhaUhHegZFQHthqWiU
I0212 15:00:16.772960   71421 round_trippers.go:289] Response Status: 201 Created in 15002 milliseconds
I0212 15:00:16.772987   71421 round_trippers.go:292] Response Headers:
I0212 15:00:16.772993   71421 round_trippers.go:295]     Content-Length: 736
I0212 15:00:16.772998   71421 round_trippers.go:295]     Cache-Control: no-store
I0212 15:00:16.773002   71421 round_trippers.go:295]     Content-Type: application/json
I0212 15:00:16.773007   71421 round_trippers.go:295]     Date: Fri, 12 Feb 2016 15:00:16 GMT
I0212 15:00:16.773061   71421 request.go:878] Response Body: {"kind":"ImageStreamImport","apiVersion":"v1","metadata":{"name":"newapp","namespace":"test","selfLink":"/oapi/v1/namespaces/test/imagestreamimports/newapp","uid":"4aacf3f7-d199-11e5-8e9e-42f2e9941fd1","creationTimestamp":"2016-02-12T15:00:01Z"},"spec":{"import":false,"images":[{"from":{"kind":"DockerImage","name":"openshift/deployment-example"},"importPolicy":{}}]},"status":{"images":[{"status":{"metadata":{},"status":"Failure","message":"Internal error occurred: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection","reason":"InternalError","details":{"causes":[{"message":"Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection"}]},"code":500}}]}}
I0212 15:00:16.773676   71421 dockerimagelookup.go:195] image import failed: api.ImageImportStatus{Tag:"", Status:unversioned.Status{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, ListMeta:unversioned.ListMeta{SelfLink:"", ResourceVersion:""}, Status:"Failure", Message:"Internal error occurred: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection", Reason:"InternalError", Details:(*unversioned.StatusDetails)(0xc20868fe00), Code:500}, Image:(*api.Image)(nil)}
I0212 15:00:16.773724   71421 componentresolvers.go:59] Error from resolver: [can't look up Docker image "openshift/deployment-example": Internal error occurred: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection]
F0212 15:00:16.773800   71421 helpers.go:104] error: can't look up Docker image "openshift/deployment-example": Internal error occurred: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection
error: no match for "openshift/deployment-example"

The 'oc new-app' command will match arguments to the following types:

  1. Images tagged into image streams in the current project or the 'openshift' project
     - if you don't specify a tag, we'll add ':latest'
  2. Images in the Docker Hub, on remote registries, or on the local Docker engine
  3. Templates in the current project or the 'openshift' project
  4. Git repository URLs or local paths that point to Git repositories

--allow-missing-images can be used to point to an image that does not exist yet.

See 'oc new-app -h' for examples.
@smarterclayton
Copy link
Contributor

Try setting HTTPS_PROXY and HTTP_PROXY on your openshift container as env vars (-e to docker)

@bparees
Copy link
Contributor

bparees commented Feb 12, 2016

@smarterclayton thought you said those env vars will have no effect on new-app? isn't the issue here that new-app is attempting to make a direct connection to the registry and it's not going through a proxy to do so?

@bparees
Copy link
Contributor

bparees commented Feb 12, 2016

@rualthan note that --allow-missing-images actually should get you past this, since it will allow new-app to ignore the fact that it couldn't find the image in the registry. As long as your openshift env itself (and docker daemon) have the right proxy configuration, it should ultimately succeed, though it's a bad way to have to run since new-app is supposed to be able to query registries so it can help you find the right image to use.

@smarterclayton
Copy link
Contributor

Those env vars need to be on the server, not on the client in order to work
with the new import path.

On Fri, Feb 12, 2016 at 12:23 PM, Ben Parees notifications@github.com
wrote:

@rualthan https://github.com/rualthan note that --allow-missing-images
actually should get you past this, since it will allow new-app to ignore
the fact that it couldn't find the image in the registry. As long as your
openshift env itself (and docker daemon) have the right proxy
configuration, it should ultimately succeed, though it's a bad way to have
to run since new-app is supposed to be able to query registries so it can
help you find the right image to use.


Reply to this email directly or view it on GitHub
#7256 (comment).

@bparees
Copy link
Contributor

bparees commented Feb 12, 2016

@smarterclayton yeah sorry was thinking we were in the old direct registry lookup path. makes sense, thanks.

@rualthan
Copy link
Author

@smarterclayton Sorry I am not sure I understand what needs to be done. In the container, I have done

export  http_proxy=http://proxy.x.com:8080
export  https_proxy=http://proxy.cat.x:8080

# env | grep proxy
http_proxy=http://proxy.x.com:8080
https_proxy=http://proxy.x.com:8080

This is the part I didn't get "as env vars (-e to docker)".

@rualthan
Copy link
Author

@bparees

After setting the env vars

oc new-app --allow-missing-images openshift/deployment-example

error: can't look up Docker image "openshift/deployment-example": Internal error occurred: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection

@bparees
Copy link
Contributor

bparees commented Feb 18, 2016

@rualthan you need to pass a -e argument to your docker run command when you start the openshift master image.

the -e arguments you need to pass should set the HTTP_PROXY and HTTPS_PROXY values (case sensitive).

you should also pull a new image as we've fixed a couple issues around new-app and this behavior.

@rualthan
Copy link
Author

@bparees @smarterclayton That works. Thank you. For the benefit of others(newbies) here is my Docker run command

docker run -d --name "origin" --privileged --pid=host --net=host \
-v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys \
-v /var/lib/docker:/var/lib/docker:rw \
-v /var/lib/origin/openshift.local.volumes:/var/lib/origin/openshift.local.volumes \
-e HTTP_PROXY=http://proxy.xxx.com:8080 \ 
-e HTTPS_PROXY=http://proxy.xxx.com:8080 \
 openshift/origin start

I also tried export HTTP_PROXY and HTTPS_PROXY (in upper case). In both cases, they showed up in env output. What is the difference between exporting env vars inside container and passing it to the Docker run command?

@bparees
Copy link
Contributor

bparees commented Feb 19, 2016

exporting env vars inside the container won't affect the process that's already started within the container.

@bparees bparees closed this as completed Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants