Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 53324 - mail-mta/postfix: upgrade from incompatible versions with postfix running corrupts mail.
Summary: mail-mta/postfix: upgrade from incompatible versions with postfix running cor...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High critical
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-08 09:08 UTC by Paul Varner (RETIRED)
Modified: 2005-04-27 10:38 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
postfix-2.2.1.diff (postfix-2.2.1.diff,2.08 KB, patch)
2005-03-15 13:25 UTC, Tuan Van (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Varner (RETIRED) gentoo-dev 2004-06-08 09:08:56 UTC
I'm running an ~x86 system immediately after emerging mail-mta/postfix-2.1.1 I started to see the following in /var/log/messages

Jun  7 12:23:18 garath postfix/qmgr[5577]: 589DC78813: from=<gentoo-user-return-68065-gentoo-user=varnerfamily.org@lists.gentoo.org>, size=2859, nrcpt=1 (queue active)
Jun  7 12:23:18 garath postfix/qmgr[5577]: warning: bad extra offset  file active/5/589DC78813
Jun  7 12:23:18 garath postfix/qmgr[5577]: warning: 589DC78813: envelope records out of order
Jun  7 12:23:18 garath postfix/qmgr[5577]: warning: saving corrupt file "589DC78813" from queue "active" to queue "corrupt"

After restarting postfix, the problem went away.

I lost quite a bit of mail before I realized I wasn't receiving mail and started to investigate.  It appears that you can't upgrade to this version of postfix with a previous version running.  The ebuild needs to detect if postfix is already running and if it is, instruct the user to shutdown and restart it after the emerge is complete.

Reproducible: Didn't try
Steps to Reproduce:
1. Running mail-mta/postfix-2.0.19-r3
2. emerge mail-mta/postfix-2.1.1


Actual Results:  
Incoming mail after the emerge was corrupted and unrepairable, so the incoming
mail was lost.

Expected Results:  
If a postfix system is running, it should refuse to do the emerge until the
postfix system is shutdown.

Portage 2.0.51_pre10 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0,
2.6.5-gentoo-r1)
=================================================================
System uname: 2.6.5-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5
Binutils: sys-devel/binutils-2.14.90.0.8-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/bind
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache fixpackages sandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi alsa arts artswrappersuid avi berkdb cdr crypt cups dvd encode fam
fbcon foomaticdb gdbm gif gpm gtk gtk2 imlib java javascript jpeg kde libg++
libwww mad mbox mikmod mmx motif mozilla moznocompose moznoirc moznomail mpeg
ncurses nls nptl oggvorbis opengl pam pda pdflib perl png ppds python qt
quicktime readline sasl sdl slang spell sse ssl svga tcltk tcpd tiff truetype
usb x86 xml2 xmms xv zlib linguas_en"
Comment 1 Tuan Van (RETIRED) gentoo-dev 2004-06-08 09:21:17 UTC
It is OK to upgrade with the previous version running, you just have to reload it after the upgrade (thought you would do that after you run an etc-update anyway)

quoted from release note:
[quote]:
[Incompat 20021119] You can upgrade Postfix 2.0 without stopping.
After upgrading an existing Postfix 2.0 system you must use "postfix
reload".  Some internal protocols have changed, but the master-child
protocols are the same as with Postfix 2.0.
[/quote]
Comment 2 Paul Varner (RETIRED) gentoo-dev 2004-06-08 10:28:55 UTC
That may be true, but even if I had been on the ball and issued a postfix reload after emerging the package I still would have lost mail, since it immediately started to corrupt the mail that was coming in.  Based upon my experience, I definitely would not recommend upgrading to this version with the older version running.
Comment 3 Tuan Van (RETIRED) gentoo-dev 2004-07-05 22:42:30 UTC
Fixed in postfix-2.1.3. Ebuild will detect and die if you are going to upgrade from <2.1 while postfix is running. Thanks.
Comment 4 Malcolm Scott 2004-08-25 15:12:06 UTC
This now means that a mail server is put completely out of action for the duration of the compile, which isn't really acceptable on a production mail server. Could the ebuild instead just stop Postfix for the installation stage, i.e. after compiling? (Having of course warned the user about this.)
Comment 5 Wolfram Schlich (RETIRED) gentoo-dev 2005-03-12 09:34:10 UTC
maybe we could move the postfix-is-running check from pkg_setup() to pkg_install,
because the installation part is the only one having a problem with a running
postfix, all others (compilation etc.) don't.

this also affects the latest =mail-mta/postfix-2.2.0 ebuild.
Comment 6 Tuan Van (RETIRED) gentoo-dev 2005-03-15 10:30:54 UTC
I can move the check to pkg_install(), but I need to inform the user how to merge  postfix with ebuild command (or something similar). I would tell the user to `ebuild /path/to/postfix-2.2.0.ebuild merge` but that command doesn't unmerge the installed postfix. Portage would unmerge it in the next emerge command, but it doesn't look like a clean solution to me.
I am thinking about emerge -B postfix then emerge -K postfix, but that wouldn't work because postfix provides and blocks virtual/mta, for some reason emerge -K postfix blocks itself.

comment/suggestion?
Comment 7 Tuan Van (RETIRED) gentoo-dev 2005-03-15 11:24:37 UTC
nm my previous comment wrt emerge -K postfix blocks itself. I'll attach the propose diff here shortly for discuss.
Comment 8 Grant Goodyear (RETIRED) gentoo-dev 2005-03-15 12:23:30 UTC
How about a simple system.  How about having postfix fail to build while an existing postfix is running unless MIGHT_CAUSE_SERIOUS_BREAKAGE is set?  Then we document why we're doing this in an ewarn, and we're done.
Comment 9 Tuan Van (RETIRED) gentoo-dev 2005-03-15 13:25:28 UTC
Created attachment 53560 [details, diff]
postfix-2.2.1.diff

proposed patch to allow emerge postfix with FORCE_UPGRADE vaiable. Please note
my wording  in there is poor, feel free to change it so it is readable. Thanks.
Comment 10 Brett Dikeman 2005-04-17 10:04:10 UTC
2.1.5-r2 ebuild refuses to build even if Postfix has been stopped:

 * You are upgrading from the incompatible version.
 * Please stop Postfix then emerge again.

!!! ERROR: mail-mta/postfix-2.1.5-r2 failed.
!!! Function pkg_setup, Line 59, Exitcode 0
!!! Upgrade from incompatible version.
!!! If you need support, post the topmost build error, NOT this status message.

Also, why is 2.2 still masked and not in unstable?  It's been out quite some time now.
Comment 11 Fernando J. Pereda (RETIRED) gentoo-dev 2005-04-27 10:38:36 UTC
A new fix is in CVS right now, it will touch the mirrors in a while. Reopen if it still fails

Thanks.

Cheers,
Ferdy