/etc/cron.daily/apt: FATAL -> Failed to fork

September 26, 2014 10.1k views

I am using ubuntu 14.04 64 bit.
I got the following messege through my email.

FATAL -> Failed to fork.
channel: could not find working mirror, channel failed
sa-update failed for unknown reasons

And then I cannot login to my virtualmin https://mydomain.com:10000 and got the following message :
"Server not found"

But I can login to https://mydomain.com:20000 to check my email.

When I try, login with SSH, everything is okay. Then I reboot and everything is work.
I encountered this problem many times and have to reboot to resolve this issue.

I am sure this problem is in my webmin virtualmin but I don't know how to fix this.

Please help me.

4 Answers
FATAL -> Failed to fork.

Generally, this message indicates that the apt process is running out of memory. That virtualmin is down as well is a good sign that the whole system is running low. Most likely the database has crashed. You can look for out of memory messages in /var/log/syslog in order to confirm this.

The first thing I would do (if you haven't done so already) is add a SWAP file to the server. Check out:

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
  • Thank you for helping. It woks better now.

  • Everything is okay, I can access my server through webmin well.
    But, I don't know why I just receive email like this.

    Can't open file /var/lib/apt/lists/mirrors.digitalocean.com_ubuntu_dists_trusty-backports_universe_binary-amd64_Packages: No such file or directory
    run-parts: /etc/cron.daily/apt-show-versions exited with return code 255
    channel: could not find working mirror, channel failed
    sa-update failed for unknown reasons

I've just received the same email from my server.
I run "sa-update --refreshmirrors" as root, and it updated mirrors in /etc/spamassassin/sa-update-keys
Now, when I run manually /etc/cron.daily/spamassassin, I have no error.

I don't know the other error from apt-show-versions.

I've been receiving these emails on the last few days, after I installed Postfix into my Droplet.
Even though I did not see OOM errors in the logs, I created a swap file following the steps from the mentioned tutorial. Let's see if the problem is gone :)

Thank you!

I solved this by removing the apt-xapian-index package. It's apparently a memory and CPU hog, and it's run as part of the daily cron. To remove, do the following:

sudo apt-get remove apt-xapian-index -y

Have another answer? Share your knowledge.