question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ray.init() fails on macOS Big Sur

See original GitHub issue

What is the problem?

Ray version and other system information (Python version, TensorFlow version, OS): OS version: macOS Big Sur Ray version: should impact all versions.

Issue: ray.init() fails when starting redis, with the following error stack.

Traceback (most recent call last):
  File "debugging.py", line 2, in <module>
    ray.init()
  File "/Users/haochen/code/ant_ray/python/ray/worker.py", line 740, in init
    ray_params=ray_params)
  File "/Users/haochen/code/ant_ray/python/ray/node.py", line 200, in __init__
    self.start_head_processes()
  File "/Users/haochen/code/ant_ray/python/ray/node.py", line 801, in start_head_processes
    self.start_redis()
  File "/Users/haochen/code/ant_ray/python/ray/node.py", line 580, in start_redis
    fate_share=self.kernel_fate_share)
  File "/Users/haochen/code/ant_ray/python/ray/_private/services.py", line 720, in start_redis
    fate_share=fate_share)
  File "/Users/haochen/code/ant_ray/python/ray/_private/services.py", line 902, in _start_redis_instance
    ulimit_n - redis_client_buffer)
  File "/Users/haochen/.pyenv/versions/3.7.6/lib/python3.7/site-packages/redis/client.py", line 1243, in config_set
    return self.execute_command('CONFIG SET', name, value)
  File "/Users/haochen/.pyenv/versions/3.7.6/lib/python3.7/site-packages/redis/client.py", line 901, in execute_command
    return self.parse_response(conn, command_name, **options)
  File "/Users/haochen/.pyenv/versions/3.7.6/lib/python3.7/site-packages/redis/client.py", line 915, in parse_response
    response = connection.read_response()
  File "/Users/haochen/.pyenv/versions/3.7.6/lib/python3.7/site-packages/redis/connection.py", line 747, in read_response
    raise response
redis.exceptions.ResponseError: The operating system is not able to handle the specified number of clients, try with -33

Digging into this issue, I found it’s because resource.getrlimit(resource.RLIMIT_NOFILE)[0] (see here) now returns 9223372036854775807 on Big Sur, while it returns 256 on previous macOS versions.

Removing this line can fix this issue. @ericl @edoakes @rkooo567 Do you know what is the purpose of this code? Is it still needed?

Reproduction (REQUIRED)

Just ray.init().

  • I have verified my script runs in a clean environment and reproduces the issue.
  • I have verified the issue also occurs with the latest wheels.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
robertnishiharacommented, Nov 17, 2020

In the cluster setting, you could have many hundreds of thousands of workers, so maxclients needs to be at least that large.

1reaction
rkooo567commented, Nov 17, 2020

Oh interesting. We set it before because 256 limits are usually not enough to handle all connections to Redis.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception: ray.init() called, but ray client is already connected
This error occurs when trying to deploy a ray-serve deployment to a ray cluster using ( ray.init( address='ray://127.0.0.1:10001',
Read more >
Repair a storage device in Disk Utility on Mac - Apple Support
Next, select Disk Utility in the macOS Recovery window, then click Continue. If you check your startup volume (Macintosh HD), make sure you...
Read more >
Failed to Write on Mac OS Big Sur - balena Forums
Trying to flash Ubuntu on and external drive formatted MS-FAT with GUID Partition Map. Reformatted twice and tried to refills numerous times. 13 ......
Read more >
The Definitive Classic Mac Pro (2006-2012) Upgrade Guide
The open-source project, Retroactive, allows users to run Final Cut Pro 7 up to macOS 10.14 and Aperture on macOS 11, Big Sur....
Read more >
BoxDrive error on start - Box Support
I get error on app start: "Box Drive failed to initialize with macOS. ... MacBook Pro 2019 Big Sur ver. 11.6.4, i9.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found