2

I am building a maven project on OpenShift Dedicated with S2I, but the build fails with a "Generic Build failure - check logs for details."

enter image description here

However, the build log shows no error.

enter image description here

Why is this build failing?

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • 1
    Run ``oc get events`` or look at the events tab to see whether it got killed due to an out of memory event on the build. But then you seem to be aware of out of memory issues on builds as shown in your answer to https://stackoverflow.com/questions/49007076/optashift-employee-rostering-build-fails-on-openshift – Graham Dumpleton Apr 20 '18 at 10:36
  • Thanks - although this is now on OpenShift Dedicated, so memory should pose no problem (4GB) - unless the pod's limit is set to something like 512MB (although I am not quite sure how to determine if that's the case). – Geoffrey De Smet Apr 23 '18 at 07:43
  • See also [this issue report](https://github.com/openshift/origin/issues/19450) – Geoffrey De Smet Apr 23 '18 at 14:20
  • 1
    Memory for a build usually defaults to 512Mi. You need to override what the build is using to be able to increase it up to what your quota might allow. See section 'Overriding Build Resources' in free eBook at https://www.openshift.com/promotions/deploying-to-openshift.html – Graham Dumpleton Apr 23 '18 at 21:17

2 Answers2

3

After ptrk's answer to diagnose that this is the problem: There are 2 ways to give a wildfly pod more memory on OpenShift when running:

  • in the console: Deployments -> select deployment -> Edit resource limits
  • in the template

For build memory, you can also specify it in the template:

  - kind: BuildConfig
    ...
    spec:
      ...
      resources:
        limits:
          cpu: 1
          memory: 1Gi
        # requests:
          # cpu: 1
          # memory: 1Gi
Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
0

Check the limits as @Graham suggested, by:

oc -n yourproject get limits -o yaml
oc -n yourproject get quota -o yaml

Or even go straight to edit:

oc -n yourproject edit limits

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: LimitRange
metadata:
  creationTimestamp: 1999-08-11T13:58:34Z
  name: resource-limits
  namespace: yourproject
  resourceVersion: "61912526"
  selfLink: /api/v1/namespaces/betvictor/limitranges/resource-limits
  uid: 2a275347-7e9d-11e7-8242-005056957160
spec:
  limits:
  - max:
      memory: 3001Mi
    min:
      memory: 10Mi
    type: Pod
  - default:
      memory: 300Mi
    defaultRequest:
      memory: 250Mi
    max:
      memory: 3000Mi
    min:
      memory: 10Mi
    type: Container

Pay attention to the units, better if they are the same for each entry. Pod maximum has to be equal or more than the container max.

Half a gig for building a java app is not much for what I can tell...

ptrk
  • 1,800
  • 1
  • 15
  • 24
  • Thank you. `oc -n ... get limits` just says `resource-limits 3d`. `oc -n ... get quota` just says `No resources found.` Must be something else? – Geoffrey De Smet Apr 23 '18 at 14:44
  • 1
    You are better off using the Quotas page in the web console. For clusters where quotas are applied across projects, as is case for OpenShift Dedicated, you need to use ``oc describe appliedclusterresourcequota``, not ``oc describe quota``. – Graham Dumpleton Apr 23 '18 at 21:14