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

OSError: AF_UNIX path too long if environment $TMPDIR is too long #57

Open
janoppelt opened this issue Jan 21, 2025 · 1 comment
Open

Comments

@janoppelt
Copy link

Dear @dawnmy ,

Thank you for such an incredible tool! I have experienced some issues that I could circumvent but might deserve a fix in the future.

I like to set the environment $TMPDIR variable to a local directory. However, RiboDetector (version 0.3.1) does not seem to like it and fails with OSError: AF_UNIX path too long (see the log below). I can run the tool if I change $TMPDIR to the system default tmp director (for example, /tmp/ribodetector). The local $TMPDIR was 89 characters long. I tried python 3.8 and python 3.9 and the error was the same.

I believe the error is related to this python/cpython#93852 (or psf/black#2105). Their fixes are mentioned in python/cpython#93852 (comment) (or psf/black#2105 (comment)). Their solution is not to use environment $TMPDIR if it's too long and to create a new, shorter one.

The length of the input or output files doesn't matter and doesn't trigger the error.

Process SyncManager-1:                                                                                                                                                                                              
Traceback (most recent call last):                                                                                                                                                                                  
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap                                                     
    self.run()                                                                                                                                                                                                      
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/process.py", line 108, in run                                                            
    self._target(*self._args, **self._kwargs)                                                                                                                                                                       
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/managers.py", line 583, in _run_server                                                   
    server = cls._Server(registry, address, authkey, serializer)                                                                                                                                                    
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/managers.py", line 156, in __init__                                                      
    self.listener = Listener(address=address, backlog=16)                                                                                                                                                           
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/connection.py", line 448, in __init__                                                    
    self._listener = SocketListener(address, family, backlog)                                                                                                                                                       
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/connection.py", line 591, in __init__                                                    
    self._socket.bind(address)                                                                                                                                                                                      
OSError: AF_UNIX path too long                                                                                                                                                                                      
Traceback (most recent call last):                                                                                                                                                                                  
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/bin/ribodetector_cpu", line 10, in <module>                                                                            
    sys.exit(main())                                                                                                                                                                                                
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/site-packages/ribodetector/detect_cpu.py", line 825, in main                                             
    seq_pred.detect()                                                                                                                                                                                               
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/site-packages/ribodetector/detect_cpu.py", line 602, in detect                                           
    self.run_with_chunks()                                                                                                                                                                                          
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/site-packages/ribodetector/detect_cpu.py", line 392, in run_with_chunks                                  
    manager = mp.Manager()                                                                                                                                                                                          
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/context.py", line 57, in Manager                                                         
    m.start()                                                                                                                                                                                                       
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/managers.py", line 558, in start                                                         
    self._address = reader.recv()                                                                                                                                                                                   
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/connection.py", line 250, in recv                                                        
    buf = self._recv_bytes()                                                                                                                                                                                        
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/connection.py", line 414, in _recv_bytes                                                 
    buf = self._recv(4)                                                                                                                                                                                             
  File "/tools/miniforge3-24.3.0-0/envs/ribodetector/lib/python3.9/multiprocessing/connection.py", line 383, in _recv                                                       
    raise EOFError                                                                                                                                                                                                  
EOFError
@dawnmy
Copy link
Member

dawnmy commented Jan 21, 2025

Great catch! Thank you for brining this issue to our attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants