[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Container all-in-one can't build ruby sample



Hi there,

As the documentation says using the container image would be the easiest
way to start using OpenShift Origin 1.0 / OpenShift 3.0 I decided to try
this way. So i setup a KVM VM with RHEL7, installed docker from Red Hat
repos and begin with OpenShift install.

I must say, documentation is somewhat fragmented. I was following /
merging instructions from:

- https://github.com/openshift/origin/
- https://docs.openshift.org/latest/admin_guide/install/prerequisites.html
-
https://github.com/openshift/origin/blob/master/examples/sample-app/container-setup.md

I installed the recommended packages, configured the insegure openshift
registry into docker, disabled NetworkManager and firealld. I configured
no DNS, using just 8.8.8.8 and /etc/hosts for the VM hostname and
www.example.com. I also configured no storage, using the default
loopback storage from docker. I also pre-pulled images.

It started with docker pull for the origin image, then started the
origin container using the biggest command-line from all those docs. It
looked to me there was no need to configure KUBECONFIG and
CURL_CA_BUNDLE. Then started the internal openshift docker registy.

So far so good. I can oc status, oc login, oc new-project and access the
web console.

Some docs say I should start the registry with --create, others miss
this option. It made no difference in my setup. Anyway "oc describe
service docker-registry" showed the expected output. I could even curl
the registry.

The problem was creating the sample ruby app:

$ oc new-app -f
https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json

The database pod starts fine, but the frontend pod doesn't, because if
failed at build. I tried rebuild it a few times with no success.

Digging deeper, here's what I found:

$ osc build-logs ruby-sample-build-1
...
I0702 18:46:01.979495       1 sti.go:131] Using provided push secret for
pushing 172.30.46.199:5000/test/origin-ruby-sample image
I0702 18:46:01.979516       1 sti.go:134] Pushing
172.30.46.199:5000/test/origin-ruby-sample image ...
E0702 18:46:05.886696       1 dockerutil.go:50] push for image
172.30.46.199:5000/test/origin-ruby-sample failed, will retry in 10s ...
E0702 18:46:18.387417       1 dockerutil.go:50] push for image
172.30.46.199:5000/test/origin-ruby-sample failed, will retry in 10s ...
F0702 18:46:31.923328       1 builder.go:70] Build error: Failed to push
image: Error pushing to registry: Server error: unexpected 500 response
status trying to initiate upload of test/origin-ruby-sample

So the build actually works fine, but it can't upload the resulting
image to the registry (which looks like running ok).

I grabbled the logs from the registry pod, but they give no clue about
what's wrong with the registry:

[root teste-ose3 ~]# docker ps
CONTAINER ID        IMAGE                                    
COMMAND                CREATED             STATUS             
PORTS               NAMES
eca0f7f1fa92        openshift/mysql-55-centos7:latest        
"run-mysqld.sh mysql   14 minutes ago      Up 14
minutes                          
k8s_ruby-helloworld-database.4b02d161_database-1-rbsrc_test_762ded54-2111-11e5-85df-52540061c0ba_242b8ae0  

9654ead88d06        openshift/origin-pod:v1.0.1              
"/pod"                 14 minutes ago      Up 14
minutes                          
k8s_POD.b1d7e54c_database-1-rbsrc_test_762ded54-2111-11e5-85df-52540061c0ba_6abde4b9                       

bf05783ab89c        openshift/origin-docker-registry:v1.0.1   "/bin/sh
-c 'REGISTR   19 minutes ago      Up 19
minutes                          
k8s_registry.f54002f1_docker-registry-1-a4j2l_default_dcad7d19-2110-11e5-85df-52540061c0ba_b0387f67        

c4babec386c1        openshift/origin-pod:v1.0.1              
"/pod"                 19 minutes ago      Up 19
minutes                          
k8s_POD.a670e545_docker-registry-1-a4j2l_default_dcad7d19-2110-11e5-85df-52540061c0ba_a0967787             

9db36d7f08bf        openshift/origin:latest                  
"/usr/bin/openshift    22 minutes ago      Up 22
minutes                          
origin                                                                                                     

[root teste-ose3 ~]# docker logs bf05783ab89c
...
time="2015-07-02T23:26:12Z" level=error msg="error authorizing context:
authorization header with basic token required"
http.request.host="172.30.251.229:5000"
http.request.id=d3b50c5d-6a40-4d46-8913-c010b8cc69f3
http.request.method=GET http.request.remoteaddr="172.17.42.1:49115"
http.request.uri="/v2/" http.request.useragent="docker/1.6.2 go/go1.4.2
kernel/3.10.0-229.el7.x86_64 os/linux arch/amd64"
instance.id=2e73c4f0-7e82-4638-b4bb-b0640e51f30c
172.17.42.1 - - [02/Jul/2015:23:26:12 +0000] "GET /v2/ HTTP/1.1" 401 114
"" "docker/1.6.2 go/go1.4.2 kernel/3.10.0-229.el7.x86_64 os/linux
arch/amd64"
time="2015-07-02T23:26:12Z" level=info msg="response completed"
http.request.host="172.30.251.229:5000"
http.request.id=d3b50c5d-6a40-4d46-8913-c010b8cc69f3
http.request.method=GET http.request.remoteaddr="172.17.42.1:49115"
http.request.uri="/v2/" http.request.useragent="docker/1.6.2 go/go1.4.2
kernel/3.10.0-229.el7.x86_64 os/linux arch/amd64"
http.response.contenttype="application/json; charset=utf-8"
http.response.duration=1.306566ms http.response.written=0
instance.id=2e73c4f0-7e82-4638-b4bb-b0640e51f30c
time="2015-07-02T23:26:15Z" level=debug msg="authorizing request"
http.request.host="172.30.251.229:5000"
http.request.id=f9fee7dd-09c5-4309-b233-75fa1fb9a35e
http.request.method=POST http.request.remoteaddr="172.17.42.1:49122"
http.request.uri="/v2/test/origin-ruby-sample/blobs/uploads/"
http.request.useragent="docker/1.6.2 go/go1.4.2
kernel/3.10.0-229.el7.x86_64 os/linux arch/amd64"
instance.id=2e73c4f0-7e82-4638-b4bb-b0640e51f30c
vars.name="test/origin-ruby-sample"
time="2015-07-02T23:26:15Z" level=debug msg="OpenShift auth: checking
for access to repository:test/origin-ruby-sample:pull"
time="2015-07-02T23:26:15Z" level=debug msg="OpenShift auth: checking
for access to repository:test/origin-ruby-sample:push"
time="2015-07-02T23:26:15Z" level=debug msg="(*layerStore).Upload"
http.request.host="172.30.251.229:5000"
http.request.id=f9fee7dd-09c5-4309-b233-75fa1fb9a35e
http.request.method=POST http.request.remoteaddr="172.17.42.1:49122"
http.request.uri="/v2/test/origin-ruby-sample/blobs/uploads/"
http.request.useragent="docker/1.6.2 go/go1.4.2
kernel/3.10.0-229.el7.x86_64 os/linux arch/amd64"
instance.id=2e73c4f0-7e82-4638-b4bb-b0640e51f30c
vars.name="test/origin-ruby-sample"
time="2015-07-02T23:26:15Z" level=info msg=Base.PutContent
trace.duration=134.7┬Ás
trace.file="/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/docker/distribution/registry/storage/driver/base/base.go"
trace.func="github.com/docker/distribution/registry/storage/driver/base.(*Base).PutContent"
trace.id=2d195e92-8337-4115-9329-337e3b658930 trace.line=67
time="2015-07-02T23:26:15Z" level=info msg="response completed"
http.request.host="172.30.251.229:5000"
http.request.id=f9fee7dd-09c5-4309-b233-75fa1fb9a35e http.request.mey
thod=POST http.request.remoteaddr="172.17.42.1:49122"
http.request.uri="/v2/test/origin-ruby-sample/blobs/uploads/"
http.request.useragent="docker/1.6.2 go/go1.4.2
kernel/3.10.0-229.el7.x86_64 os/linux arch/amd64"
http.response.contenttype="application/json; charset=utf-8"
http.response.duration=150.272569ms http.response.written=0
instance.id=2e73c4f0-7e82-4638-b4bb-b0640e51f30c
172.17.42.1 - - [02/Jul/2015:23:26:15 +0000] "POST
/v2/test/origin-ruby-sample/blobs/uploads/ HTTP/1.1" 500 111 ""
"docker/1.6.2 go/go1.4.2 kernel/3.10.0-229.el7.x86_64 os/linux arch/amd64"

Any hints on possible configuration mistakes and troubleshooring steps
will be much appreciated.

I found no signs of permission problems (doing everything as root with
selinux enabled) or other common issues like out-of-disk space (my VM
has a 20GB qcow2 file as its single disk).

I also found https://github.com/openshift/origin/issues/2740 which looks
very similar to by problems. So maybe the all-in-one container is not
working for the sample ruby app? Just for it, or it won't work for any
app that requires a build?


[]s, Fernando Lozano





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]