You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Different messages based on whether this is initial auth or re-auth
72
-
consttitle="Token Authentication Required";
73
-
constmessage=hasExistingToken
74
-
? "The authentication token is invalid or has expired. Please provide a valid authentication token."
75
-
: "Token authentication is enabled for this cluster. Please provide a valid authentication token.";
71
+
// Different messages based on whether this is initial auth or re-auth.
72
+
consttitle="Authentication Token Required";
73
+
constmessage=
74
+
(hasExistingToken
75
+
? "The existing authentication token is invalid."
76
+
: "Token authentication is enabled.")+
77
+
" Provide the matching authentication token for this cluster.\n- Local clusters: use `ray get-auth-token` to retrieve it.\n- Remote clusters: you must retrieve the token that was used when creating the cluster.\n\nSee: https://docs.ray.io/en/latest/ray-security/auth.html";
Copy file name to clipboardExpand all lines: python/ray/exceptions.py
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -477,6 +477,30 @@ def __str__(self):
477
477
returnerror_msg
478
478
479
479
480
+
@PublicAPI
481
+
classAuthenticationError(RayError):
482
+
"""Indicates that an authentication error occurred.
483
+
484
+
Most commonly, this is caused by a missing or mismatching token set on the client
485
+
(e.g., a Ray CLI command interacting with a remote cluster).
486
+
487
+
Only applicable when `RAY_AUTH_MODE` is not set to `disabled`.
488
+
"""
489
+
490
+
def__init__(self, message: str):
491
+
self.message=message
492
+
493
+
# Always hide traceback for cleaner output
494
+
self.__suppress_context__=True
495
+
super().__init__(message)
496
+
497
+
def__str__(self) ->str:
498
+
returnself.message+ (
499
+
". Ensure that you have `RAY_AUTH_MODE=token` set and the token for the cluster is available as the `RAY_AUTH_TOKEN` environment variable or a local file. "
500
+
"For more information, see: https://docs.ray.io/en/latest/ray-security/auth.html"
501
+
)
502
+
503
+
480
504
@DeveloperAPI
481
505
classUserCodeException(RayError):
482
506
"""Indicates that an exception occurred while executing user code.
0 commit comments