siamaksade / openshift-jenkins-demo

CI/CD Demo on OpenShift
http://www.openshift.com
530 stars 928 forks source link

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

Open wipro-sdx opened 5 years ago

wipro-sdx commented 5 years ago

Hi Team,

Build Image tasks fails in CICD pipeline on openshift 3.9.

following is the error messages

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

{reference={}, err=Uploading directory "oc-build" as binary input for the build ...

.

Uploading finished

error: The build dev/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 --token=XXXXX start-build buildconfig/tasks --from-dir=oc-build --wait=true -o=name , out=build.build.openshift.io/tasks-2, status=1}

siamaksade commented 5 years ago

Where there any more info in the events or build logs?

andresmmujica commented 4 years ago

Hi Siam, I'm having the same issue here, look at the logs I've got:

<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 (InternalError): Internal error occurred: pods "tasks-2-build" is forbidden: cannot exec into or attach to a privileged container , verb=start-build, cmd=oc --server=https://172.30.0.1:443 --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --namespace=dev-aro --token=XXXXX start-build buildconfig/tasks --from-file=target/ROOT.war --wait=true -o=name , out=, status=1}

Finished: FAILURE>

andresmmujica commented 4 years ago

I'm using ARO (Azure Red Hat Openshift) and perhaps it's related to the access allowed to the pods?

if I try to log to the building pod as soon as it starts I get this error:

oc rsh tasks-5-build

Error from server (Forbidden): pods "tasks-5-build" is forbidden: exec operation is not allowed because the pod's security context exceeds your permissions: pods "tasks-5-build" is forbidden: unable to validate against any security context constraint: [spec.volumes[1]: Invalid value: "hostPath": hostPath volumes are not allowed to be used spec.volumes[2]: Invalid value: "hostPath": hostPath volumes are not allowed to be used spec.containers[0].securityContext.privileged: Invalid value: true: Privileged containers are not allowed]