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

Issue: PHP Apps - Jenkinsfile issue? #3

Open
jstrachan opened this issue Nov 28, 2016 · 8 comments
Open

Issue: PHP Apps - Jenkinsfile issue? #3

jstrachan opened this issue Nov 28, 2016 · 8 comments

Comments

@jstrachan
Copy link
Contributor

moved issue from: fabric8io/gofabric8#291

When trying to install the default php chassis app, or even the quick start php app, the build fails.

+ docker build -t 10.3.241.175:80/dev/saasforge:33f0717 .

WARNING: Error loading config file:EOF

An error occurred trying to connect: Post http:///var/run/docker.sock/v1.21/build?buildargs=%7B%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=10.3.241.175%3A80%2Fdev%2Fsaasforge%3A33f0717&ulimits=null: write unix /var/run/docker.sock: broken pipe
@rawlingsj
Copy link
Contributor

Hmm I'm not too sure about this one. I just ran the OOTB php quickstart on minikube and it worked. Does it fail repeatably for you? @jeremy-wilson

+ docker build -t 10.0.0.171:80/default/my-php-app:d5fdba6 .

WARNING: Error loading config file:EOF

Sending build context to Docker daemon 61.44 kB Sending build context to Docker daemon 61.44 kB

Step 1 : FROM fabric8/php:onbuild
onbuild: Pulling from fabric8/php
6a5a5368e0c2: Pulling fs layer
de059afc6b5d: Pulling fs layer
9b1ac0143753: Pulling fs layer
a05dcf7da589: Pulling fs layer
5e38500c0906: Pulling fs layer
a9cba9364455: Pulling fs layer
cc53f7ef4906: Pulling fs layer
6b6a63a6d903: Pulling fs layer
451d9efcb5d6: Pulling fs layer
850743d4e387: Pulling fs layer
720bc600730d: Pulling fs layer
631b7b76ef12: Pulling fs layer
9704d22c95df: Pulling fs layer
c7a2e15686b0: Pulling fs layer
215bf3ae45d0: Pulling fs layer
1392babe1fbe: Pulling fs layer
2b6c1260b1f0: Pulling fs layer
a05dcf7da589: Waiting
5e38500c0906: Waiting
a9cba9364455: Waiting
cc53f7ef4906: Waiting
6b6a63a6d903: Waiting
451d9efcb5d6: Waiting
850743d4e387: Waiting
720bc600730d: Waiting
631b7b76ef12: Waiting
9704d22c95df: Waiting
c7a2e15686b0: Waiting
215bf3ae45d0: Waiting
1392babe1fbe: Waiting
2b6c1260b1f0: Waiting
9b1ac0143753: Verifying Checksum
9b1ac0143753: Download complete
a05dcf7da589: Verifying Checksum
a05dcf7da589: Download complete
5e38500c0906: Verifying Checksum
5e38500c0906: Download complete
a9cba9364455: Verifying Checksum
a9cba9364455: Download complete
cc53f7ef4906: Verifying Checksum
cc53f7ef4906: Download complete
6a5a5368e0c2: Verifying Checksum
6a5a5368e0c2: Download complete
6b6a63a6d903: Verifying Checksum
6b6a63a6d903: Download complete
850743d4e387: Verifying Checksum
850743d4e387: Download complete
de059afc6b5d: Verifying Checksum
de059afc6b5d: Download complete
451d9efcb5d6: Verifying Checksum
451d9efcb5d6: Download complete
631b7b76ef12: Verifying Checksum
631b7b76ef12: Download complete
9704d22c95df: Verifying Checksum
9704d22c95df: Download complete
6a5a5368e0c2: Pull complete
720bc600730d: Verifying Checksum
720bc600730d: Download complete
c7a2e15686b0: Verifying Checksum
c7a2e15686b0: Download complete
215bf3ae45d0: Verifying Checksum
215bf3ae45d0: Download complete
1392babe1fbe: Verifying Checksum
1392babe1fbe: Download complete
2b6c1260b1f0: Verifying Checksum
2b6c1260b1f0: Download complete
de059afc6b5d: Pull complete
9b1ac0143753: Pull complete
a05dcf7da589: Pull complete
5e38500c0906: Pull complete
a9cba9364455: Pull complete
cc53f7ef4906: Pull complete
6b6a63a6d903: Pull complete
451d9efcb5d6: Pull complete
850743d4e387: Pull complete
720bc600730d: Pull complete
631b7b76ef12: Pull complete
9704d22c95df: Pull complete
c7a2e15686b0: Pull complete
215bf3ae45d0: Pull complete
1392babe1fbe: Pull complete
2b6c1260b1f0: Pull complete
Digest: sha256:e571b2326a63e9af2328407f66ebf71a9cf0104f26ffb954936358f862252f14
Status: Downloaded newer image for fabric8/php:onbuild
�[91m# Executing 1 build trigger...
�[0mStep 1 : COPY . /var/www/html/
sh-4.2# exit
exit
---> b0b4e193d637
Removing intermediate container 1f8824d1f162
Successfully built b0b4e193d637

@antifragileer
Copy link

A while ago, I did have it running up in Minikube, but I am no longer using a local stack and instad opting for cloud dev stacks. I was also able to get it running in MiniKube as well. But this might be a docker/google issue.

I just tried to build a new one again this morning. Same results. One thing to note though, is that I have been also getting ElasticSearch errors from time to time too. I have not had a chance to dive into that yet. Let me know if I need to raise that as a separate issue. But the PHP app is still failing based on that docker EOF error again.

Could this be a similar problem that fluentd is having with the wrong volume and volume mounts inside docker? There are differences between how the containers should be setup in Google (see my last post in the following thread)
fabric8io/gofabric8#281

Started by user anonymous

> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository

> /usr/bin/git config remote.origin.url http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git # timeout=10

Fetching upstream changes from http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git

> /usr/bin/git --version # timeout=10

> /usr/bin/git fetch --tags --progress http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git +refs/heads/*:refs/remotes/origin/*

> /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10

> /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10

Checking out Revision abd3b4b0f0c1296ecbe8426defea50a55c22cfb0 (refs/remotes/origin/master)

> /usr/bin/git config core.sparsecheckout # timeout=10

> /usr/bin/git checkout -f abd3b4b0f0c1296ecbe8426defea50a55c22cfb0

> /usr/bin/git rev-list 3d0e62faac7233ad32b355b96cfc2a128790f1e3 # timeout=10

Loading library github.com/fabric8io/fabric8-pipeline-library@master

> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10

Setting origin to https://github.com/fabric8io/fabric8-pipeline-library.git

> /usr/bin/git config remote.origin.url https://github.com/fabric8io/fabric8-pipeline-library.git # timeout=10

Fetching & pruning origin...

Fetching upstream changes from origin

> /usr/bin/git --version # timeout=10

> /usr/bin/git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune

Getting remote branches...

Seen branch in repository origin/master

Seen branch in repository origin/new-k8s-plugin

Seen 2 remote branches

Checking branch master

> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository

> /usr/bin/git config remote.origin.url https://github.com/fabric8io/fabric8-pipeline-library.git # timeout=10

Fetching upstream changes from https://github.com/fabric8io/fabric8-pipeline-library.git

> /usr/bin/git --version # timeout=10

> /usr/bin/git fetch --tags --progress https://github.com/fabric8io/fabric8-pipeline-library.git +refs/heads/*:refs/remotes/origin/*

Checking out Revision d20c4c6326489b18684e0782d185257ad9d3bb61 (master)

> /usr/bin/git config core.sparsecheckout # timeout=10

> /usr/bin/git checkout -f d20c4c6326489b18684e0782d185257ad9d3bb61

> /usr/bin/git rev-list d20c4c6326489b18684e0782d185257ad9d3bb61 # timeout=10

[Pipeline] node

Running on master in /var/jenkins_home/workspace/php-app

[Pipeline] {

[Pipeline] podTemplate

[Pipeline] {

[Pipeline] node

Still waiting to schedule task

kubernetes-ddd4dd052deb4684840eefa87b44e654-10507de17cd42 is offline

Running on kubernetes-ddd4dd052deb4684840eefa87b44e654-10507de17cd42 in /home/jenkins/workspace/php-app

[Pipeline] {

[Pipeline] git

Cloning the remote Git repository

Cloning repository http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git

> /usr/bin/git init /home/jenkins/workspace/php-app # timeout=10

Fetching upstream changes from http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git

> /usr/bin/git --version # timeout=10

> /usr/bin/git fetch --tags --progress http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git +refs/heads/*:refs/remotes/origin/*

> /usr/bin/git config remote.origin.url http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git # timeout=10

> /usr/bin/git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10

> /usr/bin/git config remote.origin.url http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git # timeout=10

Fetching upstream changes from http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git

> /usr/bin/git fetch --tags --progress http://gogs.app.saasforgeapp.com/gogsadmin/php-app.git +refs/heads/*:refs/remotes/origin/*

> /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10

> /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10

Checking out Revision abd3b4b0f0c1296ecbe8426defea50a55c22cfb0 (refs/remotes/origin/master)

> /usr/bin/git config core.sparsecheckout # timeout=10

> /usr/bin/git checkout -f abd3b4b0f0c1296ecbe8426defea50a55c22cfb0

> /usr/bin/git branch -a -v --no-abbrev # timeout=10

> /usr/bin/git checkout -b master abd3b4b0f0c1296ecbe8426defea50a55c22cfb0

[Pipeline] stage (Canary release)

Using the ‘stage’ step without a block argument is deprecated

Entering stage Canary release

Proceeding

[Pipeline] echo

NOTE: running pipelines for the first time will take longer as build and base docker images are pulled onto the node

[Pipeline] fileExists

[Pipeline] writeFile

[Pipeline] container

[Pipeline] {

[Pipeline] echo

NOTE: until we support pushing tags to remote repos with correct secrets lets default to use the short commit sha as the version

[Pipeline] sh

[php-app] Running shell script

Executing shell script inside container [client] of pod [kubernetes-ddd4dd052deb4684840eefa87b44e654-10507de17cd42]

Executing command: sh -c echo $$ > '/home/jenkins/workspace/php-app@tmp/durable-848edacd/pid'; jsc=durable-4a45709bd52142b2f2a61f06d5fe08c0; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/php-app@tmp/durable-848edacd/script.sh' > '/home/jenkins/workspace/php-app@tmp/durable-848edacd/output.txt' 2> '/home/jenkins/workspace/php-app@tmp/durable-848edacd/jenkins-log.txt'; echo $? > '/home/jenkins/workspace/php-app@tmp/durable-848edacd/jenkins-result.txt'

�[?1034hsh-4.2# cd /home/jenkins/workspace/php-app

sh-4.2# sh -c echo $$ > '/home/jenkins/workspace/php-app@tmp/durable-848edacd/pi d'; jsc=durable-4a45709bd52142b2f2a61f06d5fe08c0; JENKINS_SERVER_COOKIE=$jsc '/h ome/jenkins/workspace/php-app@tmp/durable-848edacd/script.sh' > '/home/jenkins/w orkspace/php-app@tmp/durable-848edacd/output.txt' 2> '/home/jenkins/workspace/ph p-app@tmp/durable-848edacd/jenkins-log.txt'; echo $? > '/home/jenkins/workspace/ php-app@tmp/durable-848edacd/jenkins-result.txt'

sh-4.2# exit

exit

+ git rev-parse --short HEAD

[Pipeline] echo

using new version abd3b4b

[Pipeline] echo

got namespace app

[Pipeline] sh

[php-app] Running shell script

Executing shell script inside container [client] of pod [kubernetes-ddd4dd052deb4684840eefa87b44e654-10507de17cd42]

Executing command: sh -c echo $$ > '/home/jenkins/workspace/php-app@tmp/durable-7893a197/pid'; jsc=durable-4a45709bd52142b2f2a61f06d5fe08c0; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/php-app@tmp/durable-7893a197/script.sh' > '/home/jenkins/workspace/php-app@tmp/durable-7893a197/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/php-app@tmp/durable-7893a197/jenkins-result.txt'

�[?1034hsh-4.2# cd /home/jenkins/workspace/php-app

sh-4.2# sh -c echo $$ > '/home/jenkins/workspace/php-app@tmp/durable-7893a197/pi d'; jsc=durable-4a45709bd52142b2f2a61f06d5fe08c0; JENKINS_SERVER_COOKIE=$jsc '/h ome/jenkins/workspace/php-app@tmp/durable-7893a197/script.sh' > '/home/jenkins/w orkspace/php-app@tmp/durable-7893a197/jenkins-log.txt' 2>&1; echo $? > '/home/je nkins/workspace/php-app@tmp/durable-7893a197/jenkins-result.txt'

+ docker build -t 10.3.246.227:80/app/php-app:abd3b4b .

sh-4.2# exit

exit

WARNING: Error loading config file:EOF

An error occurred trying to connect: Post http:///var/run/docker.sock/v1.21/build?buildargs=%7B%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=10.3.246.227%3A80%2Fapp%2Fphp-app%3Aabd3b4b&ulimits=null: write unix /var/run/docker.sock: broken pipe

[Pipeline] }

[Pipeline] // container

[Pipeline] }

[Pipeline] // node

[Pipeline] }

[Pipeline] // podTemplate

[Pipeline] }

[Pipeline] // node

[Pipeline] End of Pipeline

Found Elasticsearch server, sending:{"timestamp":"2016-11-28T14:45:04.897+0000","build_number":2,"app":"php-app","build_result":"FAILURE","start_time":"2016-11-28T14:45:04.898+0000","duration":0,"env_vars":{"BUILD_DISPLAY_NAME":"#2","BUILD_ID":"2","BUILD_NUMBER":"2","BUILD_TAG":"jenkins-php-app-2","CLASSPATH":"","HUDSON_HOME":"/var/jenkins_home","HUDSON_SERVER_COOKIE":"da843d65f9767bda","JENKINS_HOME":"/var/jenkins_home","JENKINS_SERVER_COOKIE":"da843d65f9767bda","JOB_BASE_NAME":"php-app","JOB_NAME":"php-app","library.github.com/fabric8io/fabric8-pipeline-library.version":"master","VERSION_PREFIX":"1.0"},"build_url":"job/php-app/2/","causes":[{"short_description":"Started by user anonymous","user_name":"anonymous"}]}

ERROR: Elasticsearch response: Field name [library.github.com/fabric8io/fabric8-pipeline-library.version] cannot contain '.'

ERROR: script returned exit code 1

Finished: FAILURE

@jstrachan
Copy link
Contributor Author

do other kinds of apps work; but just not PHP on your cluster?

@rawlingsj
Copy link
Contributor

So WARNING: Error loading config file:EOF shouldn't matter, it's just a warning, I think the real error is on the next line

An error occurred trying to connect: Post http:///var/run/docker.sock/v1.21/build?buildargs=%7B%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=10.3.246.227%3A80%2Fapp%2Fphp-app%3Aabd3b4b&ulimits=null: write unix /var/run/docker.sock: broken pipe

FWIW I fixed the ES issue you're seeing and will be in the next release jenkinsci/kubernetes-pipeline-plugin@6de5e0d

@rawlingsj
Copy link
Contributor

We mount the docker socket into the build pod using a volume https://github.com/fabric8io/fabric8-pipeline-library/blob/master/vars/clientsNode.groovy#L13 I wonder if that's not the right path for the docker socket on your host machine?

@antifragileer
Copy link

I looked at the Jenkins pod as an example, and it has "/var/run/docker.sock" as a mount. So I am not sure that it would be an issue.

@jstrachan
Copy link
Contributor Author

@jeremy-wilson do any other non-java projects work in your cluster?

@antifragileer
Copy link

Just checked. They are all failing with the same error. Java applications work fine though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants