I am getting the error "Server error, status code: 502, error code: 0, message:" while pushing my war file. In the bluemix UI it is showing that 0 of 1 instances are running. How to rectify it?
Follow these steps. This is a 14 step must-gather when the app fails to stage or does not work correctly at runtime ....
cf logs appName --recent
cf events appNamewill reveal errors that staging sometimes won't like OOM errors or PORT not being listened on.
cf files appName logs/messages.log logs/staging_task.logand other log files in the
cf files appName logs/env.log | grep VCAP_SERVICESwill give you any service connection and credential information.
cf files appName app/.liberty/usr/servers/defaultServer/server.xml
cf se JBP_LOG_LEVEL DEBUGwill turn on debug logs in the buildpack that can be accessed with
cf files appName app/.buildpack-diagnostics/buildpack.log
GUIDsetc to talk to the cloud controller via REST APIs then set the environment variable
CF_TRACE to trueon the command line. Syntax depends on the OS.
war/ear/jar/server-packagefile works on standalone liberty
VCAP_SERVICESenvironment variable information from the ace tool.
cf push appName -p /absolute/path/my.war -b https://github.com/cloudfoundry/ibm-websphere-liberty-buildpack.git
Thanks to Ann Paungam who reviewed this post