Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 435334

Summary: mail-mail/queue-repair - netqmail pkg_postinst(): queue-repair failed
Product: Gentoo Linux Reporter: G.Wolfe Woodbury <redwolfe>
Component: Current packagesAssignee: Net-Mail Packages <net-mail>
Status: RESOLVED DUPLICATE    
Severity: major CC: bcddd214, patrick, powerman-asdf
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info output (201 lines)
output of emerge -pqv command
captured porthole build log. Emerge did *not* preserve /var/tmp/ build directory

Description G.Wolfe Woodbury 2012-09-17 15:14:32 UTC
Installing netqmail-1.06 fails to properly complete the install setup phase with a failure to perform the queue hierarcy setup.  The call /usr/bin/queue-repair.py has incorrect parameters.
This failure did *not* preserve the usual emerge build log in /var/tmp/portage, but I was running in porthole and got the terminal output captured.



Reproducible: Always

Steps to Reproduce:
1.emerge netqmail
2.
3.
Actual Results:  
partially functioning qmail setup that complains during user configuration

Expected Results:  
the queue hierarchy should be properly setup by install phase

Install is to gentoo amd64 (stable) guest 
on a virtualbox-4.2.0 on a gentoo amd64 (stable) host machine.
Testing install prior to switching to qmail.

will attach requested logs and dumps.
(cannot paste 201 line emerge-info here -- will attach)
Comment 1 G.Wolfe Woodbury 2012-09-17 15:16:13 UTC
Created attachment 324098 [details]
emerge --info output (201 lines)
Comment 2 G.Wolfe Woodbury 2012-09-17 15:17:05 UTC
Created attachment 324100 [details]
output of emerge -pqv command
Comment 3 G.Wolfe Woodbury 2012-09-17 15:18:28 UTC
Created attachment 324102 [details]
captured porthole build log.  Emerge did *not* preserve /var/tmp/ build directory
Comment 4 G.Wolfe Woodbury 2012-09-17 15:19:47 UTC
I think I saw a vague comment float by on the mailing lists about a recent ebuild change for qmail?
Comment 5 G.Wolfe Woodbury 2012-10-13 16:22:54 UTC
Found the problem(s)

First, queue-repair wants python2 not python3 as its interpreter

2)  octal constants are in old python1 form, should be recast to
    proper 0o777 form. [starting line 60->88]

3)  it uses an old '<>' operator instead of '!=' [line 108]


The problem belongs to the net-mail/queue-repair package, not really netqmail.
Comment 6 G.Wolfe Woodbury 2012-10-14 02:42:44 UTC
additional errors in queue-repair:

"except" statement syntax:
     uses old form "except OSErr, o"  instead of "except OSErr as o"

     similar problem in raise getopt.error and definitions

and one I can't solve yet

     trying to sort directory list it can't locate a "sort" handler for
     dirs_sort(...)
     generates traceback I could not capture or save



At this point I'm at the limit of my Python skills, so I need a fair bit of help.
Comment 7 G.Wolfe Woodbury 2012-10-14 06:59:16 UTC
ok, changing the #!/usr/bin/python to #!/usr/bin/python2 solves the sort problem.

where should I put a diff file for the fixes?  here?
Comment 8 G.Wolfe Woodbury 2012-10-14 19:09:10 UTC
Final report:
    The only change necessary is to change the shbang
           #!/usr/bin/python
    to
           #!/usr/bin/python2.7

solves all the problems noted.
This is required if you have both python 2.7 and python 3.x installed and the
python3 version is default.  Most of the installations of gentoo are going to have both versions of python installed since the stage 3 image put them both in. Also, the eselect pointer defaults to python3 in generic installs.

Sorry for all the noise, but it took a while to e things installed in a virtual machine and tested. Add a few false leads amd learning a new language, and it takes a bit of time.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-05-27 00:20:56 UTC
*** Bug 448910 has been marked as a duplicate of this bug. ***
Comment 10 Jan Hejl 2013-06-13 13:53:00 UTC
It would be great if someone makes an update in portage for queue-repair ebuild. Is it possible?
Comment 11 Ciprian Ciubotariu 2013-07-02 09:43:47 UTC
Confirmed during fresh install:

 * Setting up the message queue hierarchy
  File "/usr/bin/queue-repair.py", line 69
    'queue' :           ('qmailq', 'qmail', 0750, 0),
                                               ^
SyntaxError: invalid token
 * ERROR: mail-mta/netqmail-1.06-r2 failed (postinst phase):
 *   queue-repair failed

Please fix this in official stable tree.
Comment 12 G.Wolfe Woodbury 2013-08-07 00:27:40 UTC
The problem, as I see it, is that netqmail (and qmail itself) uses python for large parts of its implementation, and yet,

there is no dependency information in the ebuilds that reflect this need


Simply correcting this missing dependency would solve this.
Comment 13 G.Wolfe Woodbury 2014-03-08 22:22:36 UTC
There is still no indications in the dependency graphs to make postfix depend on queue-repair  nor for queue-repair to depend on python2.
Comment 14 Patrick Lauer gentoo-dev 2014-06-16 03:24:55 UTC
>>> Done.
 * >>> SetUID: [chmod go-r] /var/qmail/bin/qmail-queue ...
 [ ok ]
 * Setting up the message queue hierarchy
  File "/usr/bin/queue-repair.py", line 69
    'queue' :           ('qmailq', 'qmail', 0750, 0),
                                               ^
SyntaxError: invalid token
 * ERROR: mail-mta/netqmail-1.06-r2::gentoo failed (postinst phase):
 *   queue-repair failed


Yup yup, still there
Comment 15 zlg (RETIRED) gentoo-dev 2014-07-28 05:11:26 UTC
Confirmed on amd64 stable, hardened.

Correcting the shebang and doing the following seemed to work:

cd /usr/portage/mail-mta/netqmail
ebuild netqmail-1.06-r2.ebuild postinst
Comment 16 G.Wolfe Woodbury 2015-06-01 19:40:26 UTC
Any status on this fix?  I switched to postfix so I don't know if recent Qmail ebuilds have fixed this.
Comment 17 Pacho Ramos gentoo-dev 2016-05-06 08:45:22 UTC

*** This bug has been marked as a duplicate of bug 405899 ***