Skip to main content

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​

ErrorRaised whenAttributes
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 runfield, value, source
RayClusterUnreachableErrorThe roles server and worker cannot connect to the cluster within connect_timeout, or the machine is not a node of the clusteraddress, reason
NoWorkerNodeErrorNo live node can run workers for the rolerole, address
TaskNotSerializableErrorThe task function or its arguments cannot be sent to the workerstask_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.

ErrorRecorded whenAttributes
WorkerDiedErrorThe worker that ran the host stopped during the callhost, node, worker_id, reason
RemoteTaskErrorThe exception that the task raised on the worker cannot be rebuilt on the drivertype_name, message, host
OperationTaskNotOnWorkerErrorThe worker has no entry-point registration for the Operation task selected for the hostoperation, platform, connection, host

Errors from Nornir​

Deadline and cancellation errors are Nornir's own, as with the built-in runners:

ErrorRecorded when
TaskTimeoutErrorA host passed per_host_timeout, or the run passed timeout
TaskCancelledErrorThe 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.