Any ideas what might cause this exception

I am not sure it’s a bug or something I have wrong in my environment, so I prefer to ask here before I submit github issue (if needed)

I try to connect to my Ray cluster and get this error. What might be causing it? Any ideas?

INFO worker.py:654 -- Connecting to existing Ray cluster at address: IP:PORT
----------------------- EXCEPTION !-----------------------  
Traceback (most recent call last):  
  File "/tmp/test.py", line 12, in test
    ray.init(address='IP:PORT', _redis_password='123')  
  File "/usr/local/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 47, in wrapper  
    return func(*args, **kwargs)  
  File "/usr/local/lib/python3.8/site-packages/ray/worker.py", line 761, in init  
    connect(  
  File "/usr/local/lib/python3.8/site-packages/ray/worker.py", line 1154, in connect  
    faulthandler.enable(all_threads=False)  
AttributeError: 'LogStream' object has no attribute 'fileno'

What version of ray are you using? I think this issue shouldn’t exist in Ray 1.2

I am using version ‘1.2.0’

Hmm interesting. Do you have a way to reproduce the issue?

A similar issue used to happen because we used to overwrite sys.stdout to our custom File-like object that didn’t have fileno method, but it shouldn’t be a problem at all because we fixed that issue. I suspect it is more of an env-related issue.

Thanks a lot for the response…will check if this our env issue.

So, more specifically, the issue here is when you enable the fault handler for ray, the sys.stdout is using a class called LogStream, which doesn’t have a method fileno which is needed for file-like objects that are used for things like sys.stdout

1 Like

Did you figure out the issue @Gil_Vernik ?

Yes…i did. You helped a lot. It was as you wrote…we had a class that overwrite sys.stdout and we didn’t included fileno()… So i just added that method and returned fileno() from the original sys.stdout and then all started to work. Thanks a lot!

1 Like