NixOS Podman LogDriver issues

Hello. This issue has some overlap with this topic.

When the log driver is set to journald, podman logs produces no output.

This is my Podman configuration:

virtualisation.containers.enable = true;

virtualisation.containers.containersConf.settings = {
  containers.log_driver = "k8s-file";
};

virtualisation.podman = {
  enable = true;
  extraPackages = with pkgs; [ podman-compose ];
  defaultNetwork.settings.dns_enabled = true;
};

As a workaround, I configure the log driver to k8s-file, which restores expected behavior for podman logs.

To reproduce the issue, I ran:

podman run --replace -d --name logger --log-driver journald docker.io/library/busybox \
  sh -c 'while true; do echo tick; sleep 1; done'

Running podman logs logger produces no output, even though the logs are visible via journalctl --user -f.

Same happens in my setup.

I can access the logs via journalctl --user CONTAINER_NAME=<container_name> but not via podman logs <container_name>.

I have same issue, after joining systemd-journal group, fixed it

This fix doesn’t work for me (I logged out and then in to make sure the group membership applied)

It seems like the commit podman: use `systemdMinimal` · NixOS/nixpkgs@d060dee · GitHub broke podman logs. I have changed virtualisation.podman.package = pkgs.podman.override { systemdMinimal = pkgs.systemd; }; and the logs started showing again.

Going to investigate this asap

2 Likes

I tried locally and it seems that it works.

Do you have the issue on NixOS? or on another OS (where podman would be available through Nix)?

It’s on NixOS. I saw that testcontainers couldn’t get logs which are used to check if a database is started. It’s configured dotfiles-nix/nixos/work/configuration.nix at 723f3bed1c217e2310f5924e6f4a79e55b846d20 · adomixaszvers/dotfiles-nix · GitHub and dotfiles-nix/nixos/pi/configuration.nix at 723f3bed1c217e2310f5924e6f4a79e55b846d20 · adomixaszvers/dotfiles-nix · GitHub and I do run podman in rootless mode with my users.

Thanks @adomixaszvers !
@drupol I saw you were the author of the commit, I created an issue to track this regression here fyi!

Hello,

It has been fixed in https://github.com/NixOS/nixpkgs/pull/471084 already!

Going to close the issue.