Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_binary-amd64_Packages - open (24: Too many open files)

Bug #1089070 reported by Alin Andrei
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apt (Debian)
Fix Released
Unknown
apt (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Apt fails if more than 40 keyrings are in use.

Old description:
"sudo apt-get build-dep" fails every single time with a big list of errors like the one below:

E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_binary-amd64_Packages - open (24: Too many open files)

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: apt 0.9.7.5ubuntu5.1
ProcVersionSignature: Ubuntu 3.5.0-20.31-generic 3.5.7.1
Uname: Linux 3.5.0-20-generic x86_64
ApportVersion: 2.6.1-0ubuntu9
Architecture: amd64
Date: Tue Dec 11 20:58:30 2012
InstallationDate: Installed on 2012-09-14 (88 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120914)
MarkForUpload: True
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Alin Andrei (nilarimogard) wrote :
Revision history for this message
Alin Andrei (nilarimogard) wrote :

Still occurs on trusty...

tags: added: trusty
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

If you can still reproduce this issue, could you please attach your /etc/apt/sources.list and /etc/apt/sources.list.d/* files?

Revision history for this message
Alin Andrei (nilarimogard) wrote :

I have removed all PPAs and third-party repository GPG keys, re-imported them and the issue is gone. So I can't reproduce it any more. I guess it occurs when a lot of GPG keys are imported on a system...

Michael Vogt (mvo)
Changed in apt (Ubuntu):
importance: Undecided → High
description: updated
Changed in apt (Debian):
status: Unknown → New
Changed in apt (Debian):
status: New → Fix Released
Revision history for this message
Julian Andres Klode (juliank) wrote :

We have not seen any other reports of this issue on more recent versions, so I assume it's fixed. If it happens again on xenial or newer, feel free to reopen the bug or open a new one.

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Seb Bonnard (sebma) wrote :

@juliank It's not fixed :
$ aptitude search -F '%p' "?origin(jonathonf-vim) ( ?architecture(amd64) | ?architecture(all) ) ?installed"
E: Could not open file /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-i386_Packages - open (24: Too many open files)
E: Could not open file /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_trusty_restricted_binary-i386_Packages - open (24: Too many open files)
E: Could not open file /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-i386_Packages - open (24: Too many open files)
E: Could not open file /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_trusty_multiverse_binary-amd64_Packages - open (24: Too many open files)
E: Could not open file /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-amd64_Packages - open (24: Too many open files)
E: Could not open file /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_trusty_restricted_binary-amd64_Packages - open (24: Too many open files)
E: Could not open file /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages - open (24: Too many open files)
$ echo $?
255

Can you please change the status back to "Confirmed" ?

Revision history for this message
Julian Andres Klode (juliank) wrote :

Check that you have less files in /var/lib/apt/lists than ulimit -n has a value. You probably have too many repositories or too low a ulimit. Otherwise, open a new bug with ubuntu-bug/apport.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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