Errors
Every error of the package derives from NornirRayError, and its message names what failed.
from nornir_ray import NornirRayError
try:
result = nr.run(task=my_task)
except NornirRayError as error:
print(error)
Errors that stop the whole run before any host starts
| Error | Raised when | Attributes |
|---|---|---|
RunnerSettingsError (also a ValueError) | An option is unknown, invalid or missing, or the role and the address do not match. Raised when the runner is created, or at the first run | field, value, source |
RayClusterUnreachableError | The roles server and worker cannot connect to the cluster within connect_timeout, or the machine is not a node of the cluster | address, reason |
NoWorkerNodeError | No live node can run workers for the role | role, address |
TaskNotSerializableError | The task function or its arguments cannot be sent to the workers | task_name, reason |
For an Operation that builds a different input for each host, TaskNotSerializableError fails
only the host whose input cannot be sent.
Errors in one host's result
These errors are in the exception attribute of the host's result. The other hosts are not
affected.
| Error | Recorded when | Attributes |
|---|---|---|
WorkerDiedError | The worker that ran the host stopped during the call | host, node, worker_id, reason |
RemoteTaskError | The exception that the task raised on the worker cannot be rebuilt on the driver | type_name, message, host |
OperationTaskNotOnWorkerError | The worker has no entry-point registration for the Operation task selected for the host | operation, platform, connection, host |
Errors from Nornir
Deadline and cancellation errors are Nornir's own, as with the built-in runners:
| Error | Recorded when |
|---|---|
TaskTimeoutError | A host passed per_host_timeout, or the run passed timeout |
TaskCancelledError | The run was cancelled |
What the runner does after an error
- A task that fails on one host does not change the result of the other hosts.
- The runner does not run a failed host again.
- The runner starts a new worker in the place of a stopped one at the start of the next run, not during the run.
For causes and corrections, see Troubleshooting.