Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The maximum number of open files on this system has been reached. Use ulimit -n to increase this limit. #2215

Closed
Kakcalu13 opened this issue Oct 21, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@Kakcalu13
Copy link

Environment

  • OS Version: Mac M2 Ventura

  • Source or binary build?
    Harmonic
    - On Mac OS, open a terminal and type system_profiler SPDisplaysDataType. Copy the output here.
    bwuk@KOs-Mac-mini ~ % system_profiler SPDisplaysDataType
    Graphics/Displays:

    Apple M2 Pro:

    Chipset Model: Apple M2 Pro
    Type: GPU
    Bus: Built-In
    Total Number of Cores: 16
    Vendor: Apple (0x106b)
    Metal Support: Metal 3
    Displays:
      VN279:
        Resolution: 1920 x 1080 (1080p FHD - Full High Definition)
        UI Looks like: 1920 x 1080 @ 50.00Hz
        Main Display: Yes
        Mirror: Off
        Online: Yes
        Rotation: Supported
      Beyond TV:
        Resolution: 3840 x 2160 (2160p/4K UHD 1 - Ultra High Definition)
        UI Looks like: 1920 x 1080 @ 60.00Hz
        Mirror: Off
        Online: Yes
        Rotation: Supported
        Television: Yes
    

bwuk@KOs-Mac-mini ~ %

Here is what I did step by step

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew tap osrf/simulation
brew install gz-harmonic

It looks like promising until I get error:

Error: The maximum number of open files on this system has been reached. Use `ulimit -n` to increase this limit.

I just want to install gazebo in m2, thats all I want. I literally bought m2 for gazebo lol I never had any good luck with mac in past. I really hope this is simplest fix

@Kakcalu13 Kakcalu13 added the bug Something isn't working label Oct 21, 2023
@Kakcalu13
Copy link
Author

I ran this command without any prior experience or knowledge:
ulimit -n 1000000

and error shows the same thing

@azeey
Copy link
Contributor

azeey commented Oct 23, 2023

@scpeters I've also ran into this in the past, but wasn't sure it was just on my machine. Do you know what might be going on?

@scpeters
Copy link
Member

yes I ran into this same thing, and opened Homebrew/brew#14879 to try to improve the error message. On my mac machines ulimit -n returns 256, but if I increase it to 1024, it seems to work. I'm not sure why the default is so low

@Kakcalu13
Copy link
Author

On my mac machines ulimit -n returns 256, but if I increase it to 1024, it seems to work.

How did it work for you when I get error after increased to 1024? See here:

==> Fetching osrf/simulation/gz-harmonic
==> Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f950
Already downloaded: /Users/bwuk/Library/Caches/Homebrew/downloads/5e8fd956f9e881b791ed69ea43da80fd61a81bfb2cfefd2f777fbddcc2ec53a0--PyYAML-5.3.1.tar.gz
==> Downloading https://osrf-distributions.s3.amazonaws.com/gz-harmonic/releases
Already downloaded: /Users/bwuk/Library/Caches/Homebrew/downloads/f8eabb3491767929352f21e1ad1bbf1adf5d757e1ba72daf052a8e63913362d1--gz-harmonic-1.0.0.tar.bz2
==> Installing gz-harmonic from osrf/simulation
Error: The maximum number of open files on this system has been reached. Use `ulimit -n` to increase this limit.
bwuk@KOs-Mac-mini ~ % ulimit -n               
1024
bwuk@KOs-Mac-mini ~ % 

I checked the lock_rb.file to see if I need to adjust manually on github and it uses the system.

@Kakcalu13
Copy link
Author

At this point, it's not gazebo issue. It's the M2 issue with brew. I will do some research after work.

So the problem is that ulimit doesn't affect homebrew at all. There are supposed to be few files where you can edit the file such as /proc/$$/limits which is not available in m2. M2 doesn't have /proc/

I will close the issue with a solution once I found the fix

@Kakcalu13
Copy link
Author

Sounds like this is Gazebo's end. @azeey @scpeters according to the issue I opened in brew

Steve, what kind of mac do you have?

@scpeters
Copy link
Member

scpeters commented Nov 4, 2023

my main development machine has an Intel cpu and its default ulimit -n is 256. I often have to increase it to 1024 to install gz-sim

CPU: dodeca-core 64-bit kabylake
macOS: 13.5.2-x86_64

I also have access to an m1 machine that I don't use for development very often, though I have used it to debug issues with gazebo on m1. It also has a default ulimit -n of 256

CPU: octa-core 64-bit arm_firestorm_icestorm
macOS: 12.7-arm64

@Kakcalu13
Copy link
Author

what's even happening?!?! NO WAY! GAZEBO IS FINALLY ON M2!!!! MY VERY FIRST GAZEBO ON MY M2!!! OMG

image

Thank you so much!!!

As for this issue, I just did ulimit -n unlimited and it worked. Not sure why..I wonder if you need to restart your pc after apply the command. This solved my problem! I hope it helps people with m2 too!

@github-project-automation github-project-automation bot moved this from Inbox to Done in Core development Nov 5, 2023
@scpeters
Copy link
Member

scpeters commented Nov 6, 2023

I didn't have a chance to post the logs, but I ran brew install gz-sim8 --verbose --debug after getting the "maximunum number of open files" error, and I believe the stack trace came from some code in bullet trying to write a lock file. Perhaps, you had a lock file that wasn't deleted which was blocking all install attempts but was removed after your restart?

Anyway glad it's working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants