#999640 fail2ban: [regression] fails to install in bullseye Docker containers (but not buster): Have not found any log file for sshd jail

#999640#5
Date:
2021-11-14 05:54:09 UTC
From:
To:
When I try to install fail2ban (as a dependency of a metapackage) into
a Debian bullseye Docker container, the fail2ban postinst errors with
the message "Have not found any log file for sshd jail", causing the
dpkg process ran by apt to fail. A similar message occurs in buster,
but the message does not result in an error and apt install failure.

   root@bullseye:/# apt install fail2ban
   Reading package lists... Done
   Building dependency tree... Done
   Reading state information... Done
   Suggested packages:
     mailx system-log-daemon monit sqlite3
   Recommended packages:
     nftables | iptables whois python3-pyinotify python3-systemd
   The following NEW packages will be installed:
     fail2ban
   0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
   Need to get 451 kB of archives.
   After this operation, 2,142 kB of additional disk space will be used.
   Get:1 https://friskrepo/debian bullseye/main amd64 fail2ban all 0.11.2-2 [451 kB]
   Fetched 451 kB in 0s (9,125 kB/s)
   Selecting previously unselected package fail2ban.
   (Reading database ... 19895 files and directories currently installed.)
   Preparing to unpack .../fail2ban_0.11.2-2_all.deb ...
   Unpacking fail2ban (0.11.2-2) ...
   Setting up fail2ban (0.11.2-2) ...
   invoke-rc.d: could not determine current runlevel
   Starting Authentication failure monitor: fail2ban2021-11-14 05:39:39,575 fail2ban                [98]: ERROR   Failed during configuration: Have not found any log file for sshd jail
    failed!
   invoke-rc.d: initscript fail2ban, action "start" failed.
   dpkg: error processing package fail2ban (--configure):
    installed fail2ban package post-installation script subprocess returned error exit status 1
   Processing triggers for man-db (2.9.4-2) ...
   Errors were encountered while processing:
    fail2ban
   E: Sub-process /usr/bin/dpkg returned an error code (1)

   root@buster:/# apt install fail2ban
   Reading package lists... Done
   Building dependency tree
   Reading state information... Done
   Suggested packages:
     mailx system-log-daemon monit sqlite3
   Recommended packages:
     python iptables | nftables whois python3-pyinotify python3-systemd
   The following NEW packages will be installed:
     fail2ban
   0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
   Need to get 385 kB of archives.
   After this operation, 1,777 kB of additional disk space will be used.
   Get:1 https://friskrepo/debian buster/main amd64 fail2ban all 0.10.2-2.1 [385 kB]
   Fetched 385 kB in 0s (11.2 MB/s)

   Selecting previously unselected package fail2ban.
   (Reading database ... 19493 files and directories currently installed.)
   Preparing to unpack .../fail2ban_0.10.2-2.1_all.deb ...
   Unpacking fail2ban (0.10.2-2.1) ...
   Setting up fail2ban (0.10.2-2.1) ...
   invoke-rc.d: could not determine current runlevel
   [....] Starting authentication failure monitor: fail2ban No file(s) found for glob /var/log/auth.log
    Failed during configuration: Have not found any log file for sshd jail
    failed!
   Processing triggers for man-db (2.8.5-2) ...