Repository navigation
AssignProcessToJobObject() failed in ray.init() #21994
Copy link
Copy link
Closed
Labels
bugSomething that is supposed to be working; but isn'tSomething that is supposed to be working; but isn'tneeds-repro-scriptIssue needs a runnable script to be reproducedIssue needs a runnable script to be reproducedtriageNeeds triage (eg: priority, bug/not-bug, and owning component)Needs triage (eg: priority, bug/not-bug, and owning component)
Description
Search before asking
- I searched the issues and found no similar issues.
Ray Component
Ray Core
What happened + What you expected to happen
When starting ray.init() from terminal - both in Run and Debug mode, the following exception is thrown:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\_private\client_mode_hook.py", line 105, in wrapper
return func(*args, **kwargs)
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\worker.py", line 908, in init
_global_node = ray.node.Node(
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\node.py", line 235, in __init__
self.start_ray_processes()
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\node.py", line 947, in start_ray_processes
self.start_raylet(plasma_directory, object_store_memory)
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\node.py", line 808, in start_raylet
process_info = ray._private.services.start_raylet(
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\_private\services.py", line 1642, in start_raylet
process_info = start_ray_process(
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\_private\services.py", line 665, in start_ray_process
ray._private.utils.set_kill_child_on_death_win32(process)
File "C:\Users\python_venvs\gem_dl\lib\site-packages\ray\_private\utils.py", line 796, in set_kill_child_on_death_win32
raise OSError(ctypes.get_last_error(),
OSError: [Errno 0] AssignProcessToJobObject() failed
Versions / Dependencies
ray==1.9.2
Python 3.8.10
Windows 10
Reproduction script
Reproduction (REQUIRED)
In a python terminal run this:
import ray
ray.init()
Anything else
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that is supposed to be working; but isn'tSomething that is supposed to be working; but isn'tneeds-repro-scriptIssue needs a runnable script to be reproducedIssue needs a runnable script to be reproducedtriageNeeds triage (eg: priority, bug/not-bug, and owning component)Needs triage (eg: priority, bug/not-bug, and owning component)
Activity
czgdp1807 commentedon Feb 8, 2022
I can take this up. Will try to reproduce this issue on my Windows machine and then will post the possible fixes here (if the issue exists on
master).czgdp1807 commentedon Feb 9, 2022
When I installed from source without setting any environment variables,
ray.init()works fine. @joel-thomas-wilson Could you please share the environment variables that you set before building ray from source?P.S. I am using Windows 10 on Azure VM.
gmjehovich commentedon May 8, 2022
Hi, were you ever able to fix this problem? I am getting this same issue
Natializd commentedon Jun 21, 2022
Hi, I am getting the same issue for :
Ray 1.13.0
Python 3.9
Windows 10
mattip commentedon Aug 5, 2022
I will close this as "could not reproduce". If you are still seeing this, please reopen with a more complete reproducer or open a new issue. Be sure to include a script that shows the problem, together with any non-standard environment varaibles (what is show when you type
setat a dos prompt).digits122 commentedon Aug 13, 2022
I meet this same error, this issue should not be closed.
mattip commentedon Aug 13, 2022
@digits122 could you provide a complete report of how to reproduce this? Preferably using
ray-2.0.0rc0.nileshsuri commentedon Aug 23, 2022
I have the same issue. It really should not be closed.
On a windows 11 pc.
I installed ray using pip install ray[rllib]
ray version: 2.0.0
python version: 3.9.13
in python this error can be easily reproduced by just the following two lines.
import ray
ray.init()
Calling ray.init() causes the OSError: [Errno 0] AssignProcessToJobObject() failed.
mattip commentedon Aug 23, 2022
Thanks for the info. Reopening.
5 remaining items
digits122 commentedon Aug 27, 2022
I have this error in another machine which is not at hand right now, I don't think it's a python version problem. I reproduce this error with this simple code
import ray
ray.init()
and the error information is exactly the same as described by joel-thomas-wilson
I installed ray with this code :
pip install ray[default]
and it tooks a lot of time for automaticlly determine version
aidanmclaughlin commentedon Oct 11, 2022
Any headway on this issue? Still facing this problem on Windows
mattip commentedon Oct 11, 2022
Do you see any crashes in the log files
%TEMP%/ray/session*/logs/*? We cannot make headway until we find a way to reproduce the problem consistently. Since we (ray contributors) have been unable to do so, we need someone who is experiencing this to adequately interact here to describe their system, how they installed python and ray and any other libraries, and what they see in the logsmattip commentedon Oct 20, 2022
I wonder if there is something about the python provided in the windows store that changes the way job creation happens.
KrystofS commentedon Nov 2, 2022
I have the same problem. Recently I've ran into other issues with completely different library, the issue is documented here. The reason I mention it is that possibly the cause could be the same - the python interpreter from MS store for some reason puts files into different directories than the standard version does.
mattip commentedon Dec 2, 2022
I once again tried to reproduce, but did not get the failure reported here. Someone is going to have to provide a step-by-step reproducer.
hora-anyscale commentedon Dec 14, 2022
Per Triage Sync: No response from reporter, closing
AchimA commentedon Aug 23, 2023
I've tested this on two different machines.
Ray works fine on my home pc, where I'm working with conda.
On my work machine I get the error as show in the issue by @joel-thomas-wilson.
The error occurs when running the following in my jupyter lab notebook:
On the machine with the issue, I've installed Python 3.11.4 through MS Store.
The logs in
%TEMP%/ray/session*/logs/*(as by suggestion by @mattip) are empty.mattip commentedon Aug 23, 2023
@AchimA thanks for the report. If the logs are empty, perhaps you are connecting to a remote machine?
AchimA commentedon Aug 24, 2023
I'm running on a local install.
I checked again on the logs. They are located in (with different logs for various datetimes, but they're all the same in content):
'C:\Users_________\AppData\Local\Temp\ray\session_2023-08-23_12-47-44_328823_34212\logs...'
All the log files are empty apart from gcs_server.out. Here's the content:
\AppData\Local\Temp\ray\session_2023-08-23_12-47-44_328823_34212\logs\gcs_server.out
I also ran the step-by-step you've provided;
The install ran without issues, but the last line returned the error OSError: [Errno 0] AssignProcessToJobObject() failed.
HomenShum commentedon Sep 20, 2023
Windows User Solution:
Stop installing the python from the windows app store
Start mentally preparing for refactoring codes for the newer and faster 3.11+ Python Version
import ray
import pandas as pd
import time
start_time = time.time()
Read CSV file into a DataFrame
icd_csv = ray.data.read_csv('datasets/ICD_code/DXCCSR_v2023-1.csv')
print(icd_csv.schema())
""" Result:
2023-09-19 17:40:28,250 INFO worker.py:1642 -- Started a local Ray instance.
2023-09-19 17:40:33,805 INFO read_api.py:406 -- To satisfy the requested parallelism of 64, each read task output is split into 64 smaller blocks.
Column Type
'ICD-10-CM CODE' string
'ICD-10-CM CODE DESCRIPTION' string
'Default CCSR CATEGORY IP' string
'Default CCSR CATEGORY DESCRIPTION IP' string
'Default CCSR CATEGORY OP' string
'Default CCSR CATEGORY DESCRIPTION OP' string
'CCSR CATEGORY 1' string
'CCSR CATEGORY 1 DESCRIPTION' string
'CCSR CATEGORY 2' string
'CCSR CATEGORY 2 DESCRIPTION' string
'CCSR CATEGORY 3' string
'CCSR CATEGORY 3 DESCRIPTION' string
'CCSR CATEGORY 4' string
'CCSR CATEGORY 4 DESCRIPTION' string
'CCSR CATEGORY 5' string
'CCSR CATEGORY 5 DESCRIPTION' string
'CCSR CATEGORY 6' string
'CCSR CATEGORY 6 DESCRIPTION' string
"""
thomasbbrunner commentedon Feb 19, 2024
I can also confirm that I faced the mentioned issue when using Python 3.10 from the Microsoft Store.
By downloading Python 3.10 from the official website, I was able to use Ray without any problem (so far).