postfix: fatal: /etc/postfix/postfix-script: No such file or directory

Bug #42947 reported by Christer Edwards
72
This bug affects 9 people
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Expired
Medium
Unassigned

Bug Description

Binary package hint: postfix

On initial installation of postfix I receive an error when starting the process. Below is a capture of attempted installation thru errror:

Reading package lists... Done
Building dependency tree... Done
postfix is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up postfix (2.2.10-1) ...
Creating /etc/postfix/dynamicmaps.cf
Adding tcp map entry to /etc/postfix/dynamicmaps.cf
setting myhostname: whitebox
setting alias maps
setting alias database
setting myorigin
setting destinations: $myhostname, $mydomain
setting relayhost:
setting mynetworks: 127.0.0.1/32 192.168.0.3/32
setting mailbox_command
setting mailbox_size_limit: 0
setting recipient_delimiter: +
setting inet_interfaces: all

Postfix is now set up with a default configuration. If you need to make
changes, edit /etc/postfix/main.cf (and others) as needed. To view Postfix configuration values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
 * Stopping Postfix Mail Transport Agent postfix [ ok ]
 * Starting Postfix Mail Transport Agent postfix postfix: fatal: /etc/postfix/postfix-script: No such file or directory
                                                                         [fail]
invoke-rc.d: initscript postfix, action "restart" failed.
dpkg: error processing postfix (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
vertigo (ogxela) wrote :

I can confirm this bug on Ubuntu 6.06 AMD64 with all the latest updates.

$ sudo apt-get install --reinstall postfix
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up postfix (2.2.10-1ubuntu0.1) ...

Postfix configuration was not changed. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
postalias: warning: /etc/aliases.db: duplicate entry: "news"
 * Stopping Postfix Mail Transport Agent postfix [ ok ]
 * Starting Postfix Mail Transport Agent postfix postfix: fatal: /etc/postfix/postfix-script: No such file or directory
                                                                         [fail]
invoke-rc.d: initscript postfix, action "restart" failed.
dpkg: error processing postfix (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Scott Kitterman (kitterman) wrote :

Installing with both Dapper Flight 7 and final on Intel 686 I did not see this error.

Revision history for this message
Donald Plummer (donald-netriver) wrote :

I'm getting the same error on dapper (Linux version 2.6.15-23-386 (buildd@rothera) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5))) on a Duron with the latest updates.

$ sudo apt-get install --reinstall postfix
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.
Need to get 0B/923kB of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
(Reading database ... 35403 files and directories currently installed.)
Preparing to replace postfix 2.2.10-1ubuntu0.1 (using .../postfix_2.2.10-1ubuntu0.1_i386.deb) ...
 * Stopping Postfix Mail Transport Agent postfix
   ...done.
Unpacking replacement postfix ...
Setting up postfix (2.2.10-1ubuntu0.1) ...

Postfix configuration was untouched. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

Running newaliases
 * Stopping Postfix Mail Transport Agent postfix
   ...done.
 * Starting Postfix Mail Transport Agent postfix
postfix: fatal: /etc/postfix/postfix-script: No such file or directory
   ...fail!
invoke-rc.d: initscript postfix, action "restart" failed.
dpkg: error processing postfix (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

------------------

I've tried removing postfix, deleting every reference i can find about it and reinstalling and it continues. I've tried on a VM install of dapper and do not have the same problem.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 42947] Re: postfix: fatal: /etc/postfix/postfix-script: No such file or directory

Did you try apt-get remove or dpkg remove? Apg-get remove the application,
but leaves the config files which are then not reinstalled. See man dpkg
for details.

What are the 2 not upgraded? Try apt-get reinstall with the verbose
option, see man apt-get.

Not at a computer at the moment so I cant't give you the exact commands.

I've put Postfix on 3 different 4apper boxes without issue, so I think that
package is fundamentally sound. We just need to troubleshoot your specific
problem.

Revision history for this message
mschneider (marco-2025) wrote :

I had exactly the same problem today. It was after a re-installation of postfix.
So I did :
> sudo dpkg --remove postfix
> sudo dpkg --purge postfix

I had the same problem, so I decided to reboot the computer and then I could install postfix again.
Very strange...

Revision history for this message
Scott Kitterman (kitterman) wrote :

The only time I've had a problem like this was when I (incorrectly) tried to clear out an old Postfix confix be deleting /etc/postfix rather than using dpkg.

I am inclined to think that there is a real problem here, but it is some kind of subtle dpkg issue rather than specific to the Postfix package. I don't think that rebooting should have made a difference.

Revision history for this message
Christopher R. Parr (crp-parrix) wrote :

Please tell me how to fix this bug! I'm trying to install postfix on an Ubuntu 5.04 Server!

Revision history for this message
Scott Kitterman (kitterman) wrote :

I think it likely has to do with a dependency issue. First, I've just done this on 6.06, but I think that if you remove Postfix entirely and then apt-get -V install it, you will see some packages 'not upgraded'. Figure out what those are and solve that problem and I suspect you will be OK.

sudo dpkg --remove postfix
sudo dpkg --purge postfix

Then reboot to be on the safe side (see a comment above), then

sudo apt-get -V install postfix

Pay particular attention to packages not installed or upgraded.

Revision history for this message
ustoopia (ustoopia) wrote :

This last comment did the trick for me on Ubuntu 6.06

Thank you, and thank you google for bringing me here.

Revision history for this message
Paul Dufresne (paulduf) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. However, because this is a normal issue on an old release (6.06), and looks like to be dependency issue not reported on current (7.04), I am rejecting this bug.

Changed in postfix:
status: New → Invalid
Revision history for this message
bapoumba (bapoumba) wrote :

:~ $ uname -a
Linux yeti 2.6.22-12-generic #1 SMP Sun Sep 23 18:11:30 GMT 2007 i686 GNU/Linux

Same issue running a regular upgrade on gutsy today. I have not seen this reported on the forums, so I assume it may be due to a corrupt package download on my side. Anyway, postfix could be reinstalled after remove/purge with dpkg, and the upgrade could be performed after that.

Revision history for this message
Islam Badrel-Dein (islambadreldein) wrote :

Hi

I get the same error message on Ubuntu Hardy with latest updates.

$sudo ifup eth0
postconf: fatal: open /etc/postfix/main.cf: No such file or directory

Is this a different bug ??

Revision history for this message
Scott Kitterman (kitterman) wrote :

Do you in fact have an /etc/postfix/main.cf?

Revision history for this message
Islam Badrel-Dein (islambadreldein) wrote :

No, there is no /etc/postfix/main.cf file! In fact, I don't know much about postfix. I also don't know why this error message appear with $sudo ifup eth0. Everything seems to be working fine and I see no effect for this error message.

Revision history for this message
nicolas (spammail-0x17-deactivatedaccount) wrote :

I encountered this problem on a fresh ubuntu 7.10 LTS server.
what I did (out of my head):
- aptitude install postfix
  -> setup asks some questions, i realize, that my hostname was mistyped, I finish the setup with the wrong hostname
- aptitude remove postifx
- fix /etc/hostname
- aptitude install postfix
  -> setup does not ask the questions because the configs were not removed by 'aptitude remove postifx'
- aptitude remove --purge postfix
   -> /etc/postfix was not removed IIRC (i'm not 100% sure if this is true)
- aptitude install postfix
  -> problem occurs (fatal: /etc/postfix/postfix-script: No such file or directory)

iirc 'aptitude remove --purge postfix' did not remove my configs however this fixed the situation:
- dpkg --remove postfix
- dpkg --purge postfix
- aptitude install postfix

hope this helps
kind regards nicolas

Revision history for this message
Daniel Hahler (blueyed) wrote :

If you have removed postfix (without purging), and then removed the /etc/postfix directory manually, this is expected to fail (=no installation of the config files again).
But the situation should get handled "friendlier" probably, e.g. by checking if /etc/postfix/postfix-script exists, before calling it in the postinst.

Islam, your bug is another.. it seems like there's an ifup script for Postfix although you haven't installed Postfix? Please provide the output of "dpkg -l | grep postfix" and consider filing a new bug - you can then just mention it here.

nicolas, "aptitude remove --purge" is the same as only "aptitude remove" - seems to be a bug (filed as bug 234184): "--purge" gets recognized, but ignored. So it's the same problem basically.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Some more information:
postfix-script gets called by "postfix", not the postinst, so there's no way to check there.

/etc/postfix/postfix-script gets called by the "postfix" program and therefore is not really (or at least not only) a configuration file.

I still think the bug is invalid though, _if_ you have removed /etc/postfix/postfix-script manually.

Changed in postfix:
status: Invalid → Triaged
status: Triaged → Invalid
Revision history for this message
nicolas (spammail-0x17-deactivatedaccount) wrote :

Daniel thanks very much for your work. I'm very pleased to see that someone is looking at this issue!

> If you have removed postfix (without purging), and then removed the /etc/postfix directory manually, this is expected to fail (=no installation of the config files again).

Full ACK!

> "aptitude remove --purge" is the same as only "aptitude remove" - seems to be a bug (filed as bug 234184): "--purge" gets recognized, but ignored.

ahhh this changes a lot. I totally agree with you, that the behavior is ok when I remove the /etc/postfix directory manually. I was just totally confused, because "aptitude remove --purge" didn't help. That was the only reason why I thought, that the package is buggy. But after reading bug 234184 I totally agree, that this bug is invalid.

Thanks to point me to bug 234184 this solves my concern.

Kind regards nicolas

Revision history for this message
Andre Lohan (payne-aldervista) wrote :

I update postfix today and i had that error:

Running newaliases
 * Stopping Postfix Mail Transport Agent postfix
postfix/postfix-script: fatal: usage: postfix start (or stop, reload, abort, flush, check, set-permissions, upgrade-configuration)
                                                                                                                                  [fail]
invoke-rc.d: initscript postfix, action "restart" failed.
dpkg: error processing postfix (--configure):

The problem was that the upgrade did not replace /etc/postfix/postfix-script.
After replacing it manually from the postfix .deb the update process worked.

Revision history for this message
Scott Kitterman (kitterman) wrote :

OK. I'm reopening the bug. what version of Ubuntu were you using?

Changed in postfix:
status: Invalid → Confirmed
Revision history for this message
Andre Lohan (payne-aldervista) wrote :

Hello Scott,

I opened a new one as "No such file..." is something different. The script is there, it's just an old incompatible one.

https://bugs.launchpad.net/bugs/265004

Using Ubuntu 8.04. But i don't know from which version the old postfix-script is from since the system got 2 release upgrades starting from 7.04 and the postfix-script probably never got replaced.

Revision history for this message
Mario Zigliotto (marioz) wrote :

Just ran into this on jaunty.

Fixed it with:
sudo apt-get remove postfix
sudo dpkg --purge postfix
sudo apt-get -V install postfix

no reboot needed

Revision history for this message
Io) (io-e-tic) wrote :

Ran aswell in with Jaunty

Much simplier solution, even with no connection at all

touch /etc/postfix/main.cf

Revision history for this message
David S. (uals32843) wrote :

Work for 9.10 server:

touch /etc/postfix/main.cf

Revision history for this message
Melroy van den Berg (webmaster-web-share) wrote :

Same problem with version 10.04 (Ubuntu Server)
I think touch also do the trick, but it's still not solved I guess.

Revision history for this message
mystified (mystified1234) wrote : Re: [Bug 42947] Re: postfix: fatal: /etc/postfix/postfix-script: No such file or directory

I installed ubuntu 9.10
then did an upgrade 10.04 works fine
love the os

I have a dual boot

about to try wifi slax

On Tue, Jul 13, 2010 at 6:39 PM, Melroy van den Berg <<email address hidden>
> wrote:

> Same problem with version 10.04 (Ubuntu Server)
> I think touch also do the trick, but it's still not solved I guess.
>
> --
> postfix: fatal: /etc/postfix/postfix-script: No such file or directory
> https://bugs.launchpad.net/bugs/42947
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>
> Status in “postfix” package in Ubuntu: Confirmed
>
> Bug description:
> Binary package hint: postfix
>
> On initial installation of postfix I receive an error when starting the
> process. Below is a capture of attempted installation thru errror:
>
> Reading package lists... Done
> Building dependency tree... Done
> postfix is already the newest version.
> 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
> 1 not fully installed or removed.
> Need to get 0B of archives.
> After unpacking 0B of additional disk space will be used.
> Setting up postfix (2.2.10-1) ...
> Creating /etc/postfix/dynamicmaps.cf
> Adding tcp map entry to /etc/postfix/dynamicmaps.cf
> setting myhostname: whitebox
> setting alias maps
> setting alias database
> setting myorigin
> setting destinations: $myhostname, $mydomain
> setting relayhost:
> setting mynetworks: 127.0.0.1/32 192.168.0.3/32
> setting mailbox_command
> setting mailbox_size_limit: 0
> setting recipient_delimiter: +
> setting inet_interfaces: all
>
> Postfix is now set up with a default configuration. If you need to make
> changes, edit /etc/postfix/main.cf (and others) as needed. To view
> Postfix configuration values, see postconf(1).
>
> After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.
>
> Running newaliases
> * Stopping Postfix Mail Transport Agent postfix [
> ok ]
> * Starting Postfix Mail Transport Agent postfix postfix: fatal:
> /etc/postfix/postfix-script: No such file or directory
>
> [fail]
> invoke-rc.d: initscript postfix, action "restart" failed.
> dpkg: error processing postfix (--configure):
> subprocess post-installation script returned error exit status 1
> Errors were encountered while processing:
> postfix
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/42947/+subscribe
>

Revision history for this message
Will (war59312) wrote :

Ubuntu 10.10 Server still has this problem.

After creating the missing config file via "sudo cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf", now this error is logged in mail.err log:

"postfix/local[17422]: fatal: open database /etc/aliases.db: No such file or directory"

So I ran: "sudo newaliases" then "sudo /etc/init.d/postfix restart", and problem solved.

Then to verify run "sudo /etc/init.d/postfix status" and you should get "postfix is running" and check mail.err via "sudo nano /var/log/mail.err" to make sure no more errors are being logged.

Can't believe this still is not fixed.

Revision history for this message
matze (matzex) wrote :

I think this bug still exists in 10.04 LTS!
I had the problem like https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/42947/comments/12 and the workaround from https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/42947/comments/27 worked for me.

Is there a reason that this bug isn't fixed?

Revision history for this message
Derek_ (derek-name) wrote :

I just ran into this on a fresh install of 11.04. I think it may be because in the installation of postfix I selected "No configuration" from the configuration menu. Previously, doing the identical installation and selecting "Local only" I didn't get the error. And after removing and reinstalling postfix (as shown above), but this time selecting "Local only", I no longer get the error. I think "No configuration" is just not a good choice, because then the lack of a configuration produces errors.

Revision history for this message
LaMont Jones (lamont) wrote :

I have tried to reproduce this on both Lucid and Precise, and in neither case does it reproduce for me.

Changed in postfix (Ubuntu):
status: Confirmed → Won't Fix
status: Won't Fix → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for postfix (Ubuntu) because there has been no activity for 60 days.]

Changed in postfix (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.