HTTP Communication Issue between Podman Containers in the same Network #17637
Unanswered
mdsposadas
asked this question in
Q&A
Replies: 1 comment
-
@Luap99 PTAL |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Introduction
The setup is for 2 Containers (Client and Server) under the same Network using Podman.
We are trying to perform inter-container communication using HTTP Requests.
The Client container is running a python script that uses urllib which tries to send a HTTP Request to the Server Container.
Current issue is that the Client container encounters the following error: HTTP Error 503: Service Unavailable
The same setup was created using Docker and it works perfectly.
Also, the same setup was used but using Socket Communication instead of HTTP communication and it works for either Podman rootful or rootless containers.
Environment Setup (Files)
Server
index.html: file used to send as response to Client upon HTTP request

server.py: script used to create and start the Web Server

Dockerfile: file used to build the podman image for the Server Container

Client
client.py: script used to send request to Web Server, which in turn will acquire the response from the Server

Dockerfile: file used to build the podman image for the Client Container

Environment Setup (Commands)
The overall environment was created with the following commands:
To begin, the network is created in which the 2 containers (Client and Server) will operate.

sudo podman network create --subnet=172.18.0.0/16 test-network
Here is the network configuration of the network created:
Afterwards, the images are built for the containers of the Server and Client.


Server
Client
The containers are then built for the Server and the Client using the Images built from the previous step.
Server
sudo podman create --name=test_server --network=test-network --ip=172.18.0.2 --network-alias test_server -p 1234:1234 --restart always test_server:00.00.01 python ./server.py
Client
sudo podman create --name=test_client --network=test-network --ip=172.18.0.3 --network-alias test_client --restart always test_client:00.00.01 python ./client.py
Afterwards, 2 terminals are opened to attach to each container and the following error was encountered on the Client Container:


Server
Client
Results
Expected Result

The Client container should not encounter an error and should run smoothly, providing the message shown below which comes as the response from the Server container:
Actual Result

The Client container encounters the following error (HTTP Error 503: Service Unavailable) once the container starts running, as shown below:
Is there any way we can resolve this issue? This environment was also used when using docker and it works smoothly.

For additional information, we are using podman v4 for this environment setup:
Beta Was this translation helpful? Give feedback.
All reactions