Converting docker compose file does not append necessary `.network` to network names
Hey :wave:
After setting up Penpot with its official docker compose file I wanted to add Quadlet systemd units to keep its containers restarted after a server reboot.
Using Podlet I converted the compose file, which resulted in the postgres and redis container to fail starting properly. systemctl --user status penpot-redis.service gave the following error (it was similar for penpot-postgres.service:
Failed to start penpot-redis.service.
penpot-redis.service: Scheduled restart job, restart counter is at 5.
penpot-redis.service: Start request repeated too quickly.
penpot-redis.service: Failed with result 'exit-code'.
Failed to start penpot-redis.service.
Unfortunately journalctl -xe did not show any more detail on this error.
While trying to understand this and fiddling around with a simple quadlet file setting up redis, I notices that adding Network=penpot was causing the same issue on the test quadlet file.
Researching a bit lead me to the clue to append .networkto that line resulting in Network=penpot.network, which solved the issue.
I assume this might be something getting lost in the convertion process?
Please let me know if any more details will help solving this issue.
System Info:
- Fedora 40
- Podman 5.1.1
- Podlet 0.3.0
I've just had the same issue just now.
You get more details in journalctl from root
I ran into this problem as well. It looks like a regression as it used to properly append .network to network names. See https://github.com/containers/podlet/issues/48
Hopefully this can be fixed but in the meantime, here is a bash script to fixup your generated quadlets:
for file in ./*.container; do
sed -i 's/^Network=.*/&.network/' "${file}"
done
EDIT:
Did a little bit of diving through the git history to see if I could identify when the regression happened and see if I can quickly fix it. Turned out it happened as part of the big refactor done in https://github.com/containers/podlet/pull/73
If you look at file src/cli/container/quadlet.rs and search for ".network" (including the quotes) you can see that entire file was heavily refactored and an unfortunate side effect was that this bug got introduced. I dont know this code base at all so I can't quickly fix it but hopefully someone with an understanding of the code can easily address it.
Perhaps @k9withabone can fix it?
Oops, my bad. I'll fix it for the next release.