Let’s say that the build proccess is successfull, but the deploy is not. As a result, the IBM Cloud portal is not very helpfull.
The error is Revision failed
You may wonder why ? Well, the IBM Cloud portal is not all that helpful in this regard.
In order to investigate, you need to install and configure IBM Cloud console - or use the one from IBM Cloud portal.
First, let’s see if we can get any more informations about our app:
$ ibmcloud ce app get --name quarkus-demo-application-4e
For troubleshooting information visit: https://cloud.ibm.com/docs/codeengine?topic=codeengine-troubleshoot-apps.
Run 'ibmcloud ce application events -n quarkus-demo-application-4e' to get the system events of the application instances.
Run 'ibmcloud ce application logs -f -n quarkus-demo-application-4e' to follow the logs of the application instances.
OK
Name: quarkus-demo-application-4e
ID: 3cb3fe6d-d6f2-4309-a98b-6d62744a99b3
Project Name: devOne
Project ID: 64952fd3-0f0b-4618-a0f5-5a3c5abcca9b
Age: 48m
Created: 2023-01-10T17:21:38Z
URL: https://quarkus-demo-application-4e.xjj87ixyscj.eu-de.codeengine.appdomain.cloud
Console URL: https://cloud.ibm.com/codeengine/project/eu-de/64952fd3-0f0b-4618-a0f5-5a3c5abcca9b/application/quarkus-demo-application-4e/configuration
Status Summary: Application failed to deploy, no revisions ready
Environment Variables:
Type Name Value
Literal CE_APP quarkus-demo-application-4e
Literal CE_DOMAIN eu-de.codeengine.appdomain.cloud
Literal CE_SUBDOMAIN xjj87ixyscj
Image: private.de.icr.io/codeengine-dev-project-2b09/codeengine-quarkus-demo-0e
Resource Allocation:
CPU: 1
Ephemeral Storage: 400M
Memory: 4G
Registry Secrets:
ce-auto-icr-private-eu-de
Port: 8080
Runtime:
Concurrency: 100
Maximum Scale: 10
Minimum Scale: 0
Timeout: 300
Build Information:
Build Name: quarkus-demo-application-4e-build-95rkt
Build Run Name: quarkus-demo-application-4e-build-95rkt-run-230002-1727500
Build Status: Succeeded
Build Reason: all validations succeeded
Run 'ibmcloud ce build get -n quarkus-demo-application-4e-build-95rkt' for details.
Build Run Summary: Succeeded
Build Run Status: Succeeded
Build Run Reason: All Steps have completed executing
Run 'ibmcloud ce buildrun get -n quarkus-demo-application-4e-build-95rkt-run-230002-1727500' for details.
Conditions:
Type OK Age Reason
ConfigurationsReady false 29m RevisionFailed : Revision "quarkus-demo-application-4e-00002" failed with message: Initial scale was never achieved.
Ready false 30m RevisionMissing : Configuration 'quarkus-demo-application-4e' does not have any ready Revision.
RoutesReady false 30m RevisionMissing : Configuration 'quarkus-demo-application-4e' does not have any ready Revision.
Events:
Type Reason Age Source Messages
Normal Created 48m service-controller Created Configuration "quarkus-demo-application-4e"
Normal Created 48m service-controller Created Route "quarkus-demo-application-4e"
The error seems to be :
Revision "quarkus-demo-application-4e-00002" failed with message: Initial scale was never achieved.
Now, this error has an easy first solution: make sure the port used by the app matches with the port configured in CodeEngine Listening Port configuration.
Unfortunately for me this was not the issue.
In order to get more details, let’s deploy again the build image, and in parallel, let’s try to get the live system events from Code Engine:
$ ibmcloud ce app events --app quarkus-demo-application-4e
Getting events for all instances of application 'quarkus-demo-application-4e'...
OK
quarkus-demo-application-4e-00003-deployment-98684b58d-tzhmp:
Type Reason Age Source Messages
Normal Scheduled 71s default-scheduler Successfully assigned xjj87ixyscj/quarkus-demo-application-4e-00003-deployment-98684b58d-tzhmp to 192.168.5.64
Normal Pulled 69s kubelet, 192.168.5.64 Container image "private.icr.io/obs/codeengine/istio/proxyv2:1.15.3-build.37" already present on machine
Normal Created 69s kubelet, 192.168.5.64 Created container istio-validation
Normal Started 68s kubelet, 192.168.5.64 Started container istio-validation
Normal Pulled 67s kubelet, 192.168.5.64 Container image "private.icr.io/obs/codeengine/istio/proxyv2:1.15.3-build.37" already present on machine
Normal Created 67s kubelet, 192.168.5.64 Created container istio-proxy
Normal Started 67s kubelet, 192.168.5.64 Started container istio-proxy
Normal Pulled 60s kubelet, 192.168.5.64 Successfully pulled image "private.de.icr.io/codeengine-dev-project-2b09/codeengine-quarkus-demo-0e@sha256:0610e8ee9fa2edb78aeb07d4f3d6be948d226882c5f5880dccac02875989dba1" in 1.649067413s
Normal Pulled 60s kubelet, 192.168.5.64 Container image "private.icr.io/obs/codeengine/serving/queue:v0.1.33-v0.33.0@sha256:3fa7ef07adceb590ef8631339841694f46610fb696859238de01703ee02a151e" already present on machine
Normal Created 60s kubelet, 192.168.5.64 Created container queue-proxy
Normal Started 59s kubelet, 192.168.5.64 Started container queue-proxy
Normal Pulled 59s kubelet, 192.168.5.64 Successfully pulled image "private.de.icr.io/codeengine-dev-project-2b09/codeengine-quarkus-demo-0e@sha256:0610e8ee9fa2edb78aeb07d4f3d6be948d226882c5f5880dccac02875989dba1" in 244.859369ms
Normal Started 58s (x2 over 60s) kubelet, 192.168.5.64 Started container user-container
Warning BackOff 57s (x2 over 58s) kubelet, 192.168.5.64 Back-off restarting failed container
Warning Unhealthy 50s (x3 over 57s) kubelet, 192.168.5.64 Readiness probe failed: Get "http://172.30.64.35:15020/app-health/queue-proxy/readyz": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Normal Pulling 43s (x3 over 62s) kubelet, 192.168.5.64 Pulling image "private.de.icr.io/codeengine-dev-project-2b09/codeengine-quarkus-demo-0e@sha256:0610e8ee9fa2edb78aeb07d4f3d6be948d226882c5f5880dccac02875989dba1"
Normal Created 43s (x3 over 60s) kubelet, 192.168.5.64 Created container user-container
Normal Pulled 43s kubelet, 192.168.5.64 Successfully pulled image "private.de.icr.io/codeengine-dev-project-2b09/codeengine-quarkus-demo-0e@sha256:0610e8ee9fa2edb78aeb07d4f3d6be948d226882c5f5880dccac02875989dba1" in 320.815002ms
In this case, the line that made all the difference is:
Readiness probe failed: Get "http://172.30.64.35:15020/app-health/queue-proxy/readyz": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
This can have many answers, but in my case the problem was that the Quarkus app I am building has a default JAR export that is NOT an Uber-Jar, and it needs all the libraries in target folder. I have a feeling that the build pack from IBM Cloud only uploads the final jar from target folder and not the libraries need.
Fortunately, in order to create an Uber-JAR, I only need to edit application.properties
file and add:
quarkus.package.type=uber-jar
After committing the change to GIT and rerunning a build and deploy, the Code Engine app is UP.
Create a simple Quarkus REST service
First we create a sample Quarkus maven project :
Documentation and links
- Code engine troubleshoot guide - https://cloud.ibm.com/docs/codeengine?topic=codeengine-troubleshoot-apps
- Why doesn’t my app ever become ready? - https://cloud.ibm.com/docs/codeengine?topic=codeengine-ts-app-neverready