Jenkins BUILD FAILED/CANCELLED on openshift

2019-08-22 05:33发布

I have problems pushing new code to my openshift application with jenkins. I have enabled jenkins from web console admin and it works(no custom settings). However I have to push at least 2 times before it pushes new changes to my app.
I have bronze plan. I use 3 apps (main app, database app, jenkins) and when pushing, jenkins creates 4th app.
Pushing new version of app takes a long time, since I upgrade search index after every push. When I push for the first time, this is what I get:

git push origin
Counting objects: 38, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (20/20), 2.33 KiB | 0 bytes/s, done.
Total 20 (delta 15), reused 0 (delta 0)
remote: Syncing git content to other proxy gears
remote: Executing Jenkins build.
remote: 
remote: You can track your build at https://jenkins-myapp.rhcloud.com/job/digrin-build
remote: 
remote: Waiting for build to schedule.....................................................................
remote: **BUILD FAILED/CANCELLED**
remote: Please see the Jenkins log for more details via 'rhc tail'
remote: !!!!!!!!
remote: Deployment Halted!
remote: If the build failed before the deploy step, your previous
remote: build is still running.  Otherwise, your application may be
remote: partially deployed or inaccessible.
remote: Fix the build and try again.
remote: !!!!!!!!
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: CLIENT_ERROR: Failed to execute: 'control post-receive' for /var/lib/openshift/55a0310e4...4/jenkins-client
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.

This is my second push:

$ git push origin
Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 481 bytes | 0 bytes/s, done.
Total 6 (delta 5), reused 0 (delta 0)
remote: Syncing git content to other proxy gears
remote: Executing Jenkins build.
remote: 
remote: You can track your build at https://jenkins-myapp.rhcloud.com/job/digrin-build
remote: 
remote: Waiting for build to schedule......Done
remote: Waiting for job to complete.............................................................................................................................................................................Retrying job 3 lookup....Done.
remote: .................................Retrying job 3 lookup....Done.
remote: ............................................................................................Retrying job 3 lookup....Done.
remote: ..................................................Retrying job 3 lookup....Done.
remote: ................................................................Retrying job 3 lookup....Done.
remote: ........................................Retrying job 3 lookup....Done.
remote: ........Retrying job 3 lookup....Done.
remote: ..................................Retrying job 3 lookup....Done.
remote: .........................................................................................................Retrying job 3 lookup....Done.
remote: .....Retrying job 3 lookup....Done.
remote: ...............................................................................................................Done
remote: SUCCESS
remote: New build has been deployed.
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Deployment completed with status: success
To ssh://55a000094@digrin-myapp.rhcloud.com/~/git/digrin.git/
   af390d4..f47120e  master -> master

Why my first push always fails? I do not see any error regarding jenkins in rhc tail myapp

1条回答
萌系小妹纸
2楼-- · 2019-08-22 05:56

When I push first commit, it yells BUILD FAILED/CANCELLED. On second push it is a success. If I do third push right after second, it is success too. Almost like jenkins app would hibernate, but it cannot. I have bronze plan and I tried to load jenkins url so I was sure jenkins app is running.
Only possible reason for first failed push that I can think of is that I have 3 out of 16 apps and probably 4th app creation takes too long and Jenkins does not wait and ends with error.

So I will just keep doing two pushes instead of one every time I want to push new version of my app.

查看更多
登录 后发表回答