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

stage-Build Image failure #112

Open
babujii opened this issue Oct 30, 2018 · 16 comments
Open

stage-Build Image failure #112

babujii opened this issue Oct 30, 2018 · 16 comments

Comments

@babujii
Copy link

babujii commented Oct 30, 2018

While executing this step in the pipeline,

stage('Build Image') {
  steps {
    sh "cp target/openshift-tasks.war target/ROOT.war"
    script {
      openshift.withCluster() {
        openshift.withProject(env.DEV_PROJECT) {
              openshift.selector("bc", "tasks").startBuild("--from-file=target/ROOT.war", "--wait=true")
        }
      }
    }
  }
}

Error in the Jenkins Console :

ERROR: Error running start-build on at least one item: [buildconfig/tasks];
{reference={}, err=Uploading file "target/ROOT.war" as binary input for the build ...
Error from server (NotFound): buildconfigs.build.openshift.io "tasks" not found, verb=start-build, cmd=oc --server=https://172.30.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=dev --token=XXXXX start-build buildconfig/tasks --from-file=target/ROOT.war --wait=true -o=name , out=, status=1}

Finished: FAILURE

@rperezsnap
Copy link

rperezsnap commented Oct 30, 2018

Almost the same issue but when is making the deployment to stage:

ERROR: rollout:latest returned an error;
{reference={}, err=Error from server (NotFound): deploymentconfigs.apps.openshift.io "tasks" not found, verb=rollout, cmd=oc rollout latest deploymentconfig/tasks --server=https://172.30.0.1:443 --namespace=stage --token=XXXXX , out=, status=1}

It says that the task is not found.

@babujii
Copy link
Author

babujii commented Oct 31, 2018

i am facing problem in Dev environment itself, Is it working for you Dev environment(deployment script) ? if yes, Could you please share your Dev deployment script.

@rperezsnap
Copy link

Hello Babujii, I'm using the same script from the project. I'm not replacing project values because I found several errors during the process.
I mean if you change the dev project name and stage project name you can face several errors. Maybe those are the errors you are having.

The problem I was having is when i was deploying to stage and the script do not create the deployment config for that project, so I got " task not found"..

@babujii
Copy link
Author

babujii commented Oct 31, 2018

Thanks for update Rperezsnap !
Even i am suspecting with source code issue. Are you using same source code or different source code..
source code: https://github.com/OpenShiftDemos/openshift-tasks

@babujii
Copy link
Author

babujii commented Oct 31, 2018

We have followed with installation script instructions and working fines . It's solved issue. Thanks for your support.

@rperezsnap
Copy link

Hello Babujii,
I'm glad it worked for you.
Did your pipeline finish successfully from the beginning to the deployment stage?

@babujii
Copy link
Author

babujii commented Nov 3, 2018

Hi Rperezsnap,

Yes, It is working fine now(Dev,Stage).
I was used below steps,
MAKE SURE YOU ARE LOGGED IN:
Step1:$ oc login http://console.your.openshift.com
ID:system
password:admin

step2:git clone https://github.com/siamaksade/openshift-cd-demo.git (locally)

Step3:go to script path and run the script.

./provision.sh deploy

Step4: Deployment Stage(just click promote button)

Done ... Enjoy !!

@babujii
Copy link
Author

babujii commented Nov 3, 2018

you have to login : #oc login http://:8443

@Johnny2136
Copy link

Johnny2136 commented Nov 27, 2018

I get the same:

Error running start-build on at least one item: [buildconfig/tasks];

{reference={}, err=Uploading file "target/ROOT.war" as binary input for the build ...

Error from server (NotFound): buildconfigs.build.openshift.io "tasks" not found, verb=start-build, cmd=oc --server=https://172.30.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=dev --token=XXXXX start-build buildconfig/tasks --from-file=target/ROOT.war --wait=true -o=name , out=, status=1}

What did you do to fix this?

@rperezsnap
Copy link

rperezsnap commented Nov 27, 2018 via email

@Johnny2136
Copy link

I tried that

C:\Users\johnn>oc get bc -n dev
NAME      TYPE      FROM      LATEST
tasks     Source    Binary    0

@Johnny2136
Copy link

Step3:go to script path and run the script.

./provision.sh deploy

Step4: Deployment Stage(just click promote button)

So is this in a windows env or linux?

@Johnny2136
Copy link

Well now I got past build but failed on deploy to dev:

[rollout:latest:deploymentconfig/tasks] 

rollout:latest returned an error;

{reference={}, err=Error from server (NotFound): deploymentconfigs.apps.openshift.io "tasks" not found, verb=rollout, cmd=oc --server=https://172.30.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=dev --token=XXXXX rollout latest deploymentconfig/tasks , out=, status=1}

@AnthonyWong1216
Copy link

I still have same error
how you all fix it??

[cicd-admin-tasks-pipeline] Running shell script

  • cp target/openshift-tasks.war target/ROOT.war
    [Pipeline] script
    [Pipeline] {
    [Pipeline] echo

[Pipeline] _OcContextInit
[Pipeline] _OcContextInit
[Pipeline] readFile
[Pipeline] _OcAction
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy DEV)
Stage "Deploy DEV" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Promote to STAGE?)
Stage "Promote to STAGE?" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy STAGE)
Stage "Deploy STAGE" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Error running start-build on at least one item: [buildconfig/tasks];
{reference={}, err=Uploading file "target/ROOT.war" as binary input for the build ...
error: The build dev-admin/tasks-2 status is "Failed", verb=start-build, cmd=oc --server=https://172.30.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=dev-admin --token=XXXXX start-build buildconfig/tasks --from-file=target/ROOT.war --wait=true -o=name , out=build/tasks-2, status=1}

Finished: FAILURE

@dirtyA
Copy link

dirtyA commented Dec 26, 2019

docker pull openshift/wildfly-120-centos7@sha256:a1fbd1b235102ae18344527b44201c34ad4c2181b0b4cbf295b1a8f0cbde8e73

@dirtyA
Copy link

dirtyA commented Dec 26, 2019

no wildfly-120-centos7 image

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

5 participants