Can't open apps due to Too many open files

Bug #1771329 reported by Joe Littlejohn
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
dbus (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Occasionally I find that I can't launch a new terminal, or can't achieve some other desktop task. Checking journalctl I see error messages like this:

May 15 12:12:15 jl-XPS-13-9360 terminator.desktop[11840]: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.LimitsExceeded: Failed to determine seats of user "1000": Too many open files

or this:

May 15 12:12:47 jl-XPS-13-9360 google-chrome.desktop[28308]: [28308:28343:0515/121247.966786:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to determine seats of user "1000": Too many open files

At the time this happen's I'm usually running Slack, Chrome, Emacs, and a few Java apps.

I'm using Ubuntu Bionic (18.04), 4.15.0-20-generic x86_64, vanilla gnome-shell.

Revision history for this message
dino99 (9d9) wrote :
Revision history for this message
Joe Littlejohn (joelittlejohn) wrote :

Thanks @dino99. I've seen a lot of different suggestions for tackling this error, so it would be good to understand exactly which config change is the critical one.

I think this is a major bug on a newly installed system. As an Ubuntu Desktop user I shouldn't be experiencing an issue where the OS stops me from launching any new app once I have a few apps open. I shouldn't need to go hunting through logs to and start googling for a solution, then modify open file limits, just to run a handful of desktop applications.

Revision history for this message
dino99 (9d9) wrote :

Maybe some days Dbus will grab some builtin IA to increase/decrease ulimit on the fly !!!
But yes special user's case also need custom user settings. Not a real bug per se, but more of a wish !!!!

Revision history for this message
Joe Littlejohn (joelittlejohn) wrote :

I think there's a strong argument that the default max open files for Ubuntu Desktop should be higher than it is now. Modern apps use a lot of file handles.

Revision history for this message
Joe Littlejohn (joelittlejohn) wrote :

I tried the following:

echo '* hard nofile 65535' | sudo tee -a /etc/security/limits.conf
echo '* soft nofile 65535' | sudo tee -a /etc/security/limits.conf
echo 'session required pam_limits.so' | sudo tee -a /etc/pam.d/common-session

then restarted.

This did not fix the issue. So that's one 'increase limits' strategy we can rule out - it doesn't work for this particular problem.

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

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

Changed in dbus (Ubuntu):
status: New → Confirmed
Revision history for this message
Joe Littlejohn (joelittlejohn) wrote :

Not sure which part of this fixes the problem, but I don't have any issues after I run the following:

echo '* hard nofile 2097152' | sudo tee -a /etc/security/limits.conf
echo '* soft nofile 2097152' | sudo tee -a /etc/security/limits.conf
echo 'root hard nofile 2097152' | sudo tee -a /etc/security/limits.conf
echo 'root soft nofile 2097152' | sudo tee -a /etc/security/limits.conf
echo 'session required pam_limits.so' | sudo tee -a /etc/pam.d/common-session
echo 'DefaultLimitNOFILE=2097152' | sudo tee -a /etc/systemd/user.conf
echo 'DefaultLimitNOFILE=2097152' | sudo tee -a /etc/systemd/system.conf

Maybe it's all needed. Maybe only the last two lines are needed.

¯\_(ツ)_/¯

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.