Reputation: 63
I created a Java Liberty application on Bluemix and cloned the sample code from the JazzHub Git repository linked to the application. I then copied the JavaHelloWorldApp.war file to the base directory of the sample code and created a Dockerfile with the following text:
FROM registry.ng.bluemix.net/ibmliberty:javaee7
ADD JavaHelloWorldApp.war /opt/ibm/wlp/usr/servers/defaultServer/dropins/
I set up the DevOps pipeline to build an image and then create a container following this example Node.js application: https://hub.jazz.net/deploy/index.html?repository=https://github.com/Puquios/hello-containers
The application successfully builds and deploys, however I receive the following error when I go to view the url for the new container application:
502 Bad Gateway: Registered endpoint failed to handle the request.
How do I fix this?
Upvotes: 0
Views: 239
Reputation: 141
A 502 error means that the router can not get a response from the container in your group. There are two possible causes for this:
To test #1, you will need to use cf ic to bind an IP address to the running container and then curl against that IP address:port to see if the container is responding.
Steps:
cf ic ps
--- this will give you the container ID. If you have multiple running containers you can do a cf ic inspect [container-ID] to see which one is in your group. It will also display the port
cf ic ip request
--- this will give you an IP address
cf ic ip bind [IP address] [container-ID]
Now go to the [IP address]:[port] and see if you can access your application.
If you can access your application via IP address let me know and I can follow-up with the router problem.
Upvotes: 1