Skip to content

fix(cmdeploy): Install dovecot .deb packages atomically#899

Merged
j4n merged 1 commit intomainfrom
j4n/dovecot-atomic-install
Mar 21, 2026
Merged

fix(cmdeploy): Install dovecot .deb packages atomically#899
j4n merged 1 commit intomainfrom
j4n/dovecot-atomic-install

Conversation

@j4n
Copy link
Contributor

@j4n j4n commented Mar 21, 2026

Since change 635ac7 we try to install Dovecot, even if it is already running, which fails Dovecot upgrades fail when the installed version differs from the target because dovecot-imapd/lmtpd dependencies on dovecot-core: packages are installed one at a time via apt.deb(), i.e. dpkg -i, and dpkg cannot satisfy them dependencies:

  dpkg: dependency problems prevent configuration of dovecot-imapd:
    dovecot-imapd depends on dovecot-core (= 1:2.3.21+dfsg1-3); however:
      Version of dovecot-core on system is 1:2.3.21.1+dfsg1-1~bpo12+1.

Split _install_dovecot_package into _download_dovecot_package (download only, return path) and a single server.shell call that passes all .deb files to dpkg -i together. Uses the same 3-step pattern as pyinfra's apt.deb: tolerant first dpkg -i, apt-get --fix-broken, then final dpkg -i to fail if there are still errors.

Since change 635ac7 we try to install Dovecot, even if it is already
running, which fails Dovecot upgrades fail when the installed version
differs from the target because dovecot-imapd/lmtpd dependencies
on dovecot-core: packages are installed one at a time via apt.deb(),
i.e. `dpkg -i`, and dpkg cannot satisfy them dependencies:
```
  dpkg: dependency problems prevent configuration of dovecot-imapd:
    dovecot-imapd depends on dovecot-core (= 1:2.3.21+dfsg1-3); however:
      Version of dovecot-core on system is 1:2.3.21.1+dfsg1-1~bpo12+1.
```

Split _install_dovecot_package into _download_dovecot_package (download
only, return path) and a single server.shell call that passes all .deb
files to dpkg -i together. Uses the same 3-step pattern as pyinfra's
apt.deb: tolerant first dpkg -i, apt-get --fix-broken, then final
dpkg -i to fail if there are still errors.
@j4n j4n requested a review from ccclxxiii March 21, 2026 15:02
@j4n j4n temporarily deployed to staging2.testrun.org March 21, 2026 15:02 — with GitHub Actions Inactive
@j4n j4n temporarily deployed to staging-ipv4.testrun.org March 21, 2026 15:02 — with GitHub Actions Inactive
@j4n j4n marked this pull request as draft March 21, 2026 15:03
@j4n j4n marked this pull request as ready for review March 21, 2026 15:05
@j4n j4n merged commit e687120 into main Mar 21, 2026
6 checks passed
@j4n j4n deleted the j4n/dovecot-atomic-install branch March 21, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants