-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker-Compose cannot start containers with static ip addresses with Podman as a backend #11493
Comments
That error message usually pops up when the requested IP address isn't present inside of the network. I notice you're not specifying a subnet for the network you create - are you absolutely certain it's always being assigned a |
@mheon - Yes I create the docker-compose network outside of docker-compose explicitley in my systemd service file. The file shown below fails because of the error described in the bug.
|
I'm fairly certain |
@mheon - Yes, docker-compose does create the network ( and remove it when stopped ). However, if I let docker-compose create it I still get the assignment bug:
|
I think cleanup is not working, can you run the podman service with |
@Luap99 - I agree, there is an issue with the cleanup. A few issues shown in the Podman API debugging output:
Here is how I get the error to happen:
And here is the total debugging output from the Podman API:
|
Can you provide the output of |
Podman is installed with Yocto. Here is the output - I grabbed the latest tagged version 2 days ago:
I'll try that workaround now. |
I tried the workaround - unfortunately it did not work. Error:
Here is the systemd service file I used:
|
You have to add |
I also recommend to reboot before you test again to get rid of the tmpfiles. |
I appreciate the help with this - Okay, I rebooted and tried with this service file:
Unfortunately it still fails:
Logs:
|
It is very hard to debug. I would recommend to start removing stuff from your compose file? Does it fail if you only have one container with a static ip, etc... |
I would also try different IPs. If they work first time but subsequently fail, we have a bug with CNI where it's not removing address leases on exit. |
I tried the following outside of docker-compose and I can start the containers with static ip addresses, remove them, and start new instances - and they work consistently. It seems to have to do with docker-compose interaction with the Podman API?
Output:
|
@mheon - I tried with different IP Addresses per your suggestion. Interestingly, the bringup failed the very first time. However, just like the initial set of IP Addresses, the very first container works, but not the second one. No container had ever used the 3 new addresses that I assigned.
|
If I have the following static addresses set in my docker-compose.yml file:
And then run the following commands - the docker-compose environment starts up. Perhaps something is not clearing the files 10.89.0.X files that get stored in /var/lib/cni/networks/docker-compose_company_internal_net/:
However, I do not need to cleanup those files outside of docker-compose - if I use the 'podman run' commands directly. |
So there is only one dangling ip file in this directory? It sounds like the docker compat api parses the ip wrong and all containers end up with the same thus failing when the network is setup. |
I think that is exactly it. |
Okay, I think this proves it. I hacked together a patch for docker-compose that just clears out those IP address files prior to creating the container and now it works as expected:
|
Can you try with |
@Luap99 - Yes, I actually did try that during testing. It still happens in detached mode. |
Not sure if it is relevant - but the test/system/200-pod.bats file in the podman 3.3.1 source code has this line:
|
I don't think this is related. |
Any chance that you could try this with #11751? |
@Luap99 - it looks like your branch is working!
|
OK, just to confirm could you try with the main branch and check if this fails? I just want to be sure that my PR fixed it and not some other change since v3.3. |
Yes, I can try that. Yesterday afternoon it did fail with the latest in Tag v3.4.0-rc2. |
A friendly reminder that this issue had no activity for 30 days. |
I believe this is fixed, since we have not heard back. Reopen if I am mistaken. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I am using Podman and Docker-Compose to start a docker-compose.yml container environment on an embedded Linux device with static ip addresses assigned to each container in the environment with the following syntax:
If I do not use static ip addresses for each of the 3 containers in the yml file, Podman correctly starts the environment and it works as expected.
When I attempt to start the environment with static ip addresses in the yml file, I get the following errors and the environment fails to start:
From podman system service logs:
From docker-compose output:
The only workaround I have found so far is to manually delete the CNI-created last_reserved_ip.0 and 10.89.0.x files between multiple attempts to bring up the environment:
I have tried many different methods of cleaning the 'CNI Cache'. None of the following commands remedy the error:
The docker-compose.yml file is:
Steps to reproduce the issue:
Create the yaml file above and try to use docker-compose to start the environment.
You should see output such as:
Describe the results you received:
The errors described above under "Description".
Describe the results you expected:
The docker-compose environment is successfully started with Podman using static IP address assignment for each container.
Additional information you deem important (e.g. issue happens only occasionally):
This issue happens every single time I try to start the environment with static IP addresses enabled in the docker-compose.yml file.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):None - this is a Yocto build. Versions are shown above under 'Output of
podman version
'.Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Embedded Linux Yocto build for Microchip SAMA5D27 ARM device.
The text was updated successfully, but these errors were encountered: