Troubleshooting
How errors surface
The provider does not hide errors: anything that goes wrong fails the Airflow
task, with the exception in the task log, and Airflow retries the task
according to its retries setting (except for YellowDogStateError,
below). The exceptions come from the provider itself and from the YellowDog
SDK.
YellowDogExceptionThe base class for errors raised by the provider itself: for example a connection with no key ID or secret, an attempt to shut down a worker pool that is not a provisioned pool, or a callable that was never rendered.
YellowDogArgumentErrorA subclass of both
YellowDogExceptionand Python’sValueError, raised when an operator or sensor argument is missing, malformed or inconsistent: neither an ID nor a complete name given, an emptytarget_stateslist,target_statesorfailure_statesholding values of the wrong type or overlapping, an ID that rendered to"None", or a work requirement with preset task groups passed toAddPopulatedWorkRequirement. When raised while the DAG file is parsed (missing arguments, badtarget_statesorfailure_states), it appears as a DAG import error in the Airflow UI instead of a task failure.YellowDogStateErrorA subclass of
YellowDogException, raised by a sensor whose resource has reached one of itsfailure_states(by default, a final state that is not a target, such asFAILEDorCANCELLEDwhen waiting forCOMPLETED). The message names the resource, its current state and the target states. It is also Airflow’sAirflowFailException, so the sensor fails without being retried, even withsilent_fail=True; see failure states.WaitTimeoutErrorA subclass of
YellowDogException, raised when an operator’s own wait (RunWorkRequirement,ProvisionWorkerPoolwithwait_until_ready,ShutdownProvisionedWorkerPoolwithwait) times out. The message names the resource kind, ID, last status and the timeout (Timed out after 3600 seconds waiting for worker pool ID '...'; last status was 'PENDING'); the same values are attributes (kind,resource_id,last_state,timeout). Before raising it,RunWorkRequirementcancels its work requirement andProvisionWorkerPoolshuts down its pool, so unlikeYellowDogStateErrorit is retried according to the task’sretriessetting, and the retry starts afresh. Sensors time out with Airflow’sAirflowSensorTimeoutinstead.- Errors from the YellowDog SDK
Errors returned by the YellowDog Platform are raised by the YellowDog SDK and propagate unchanged. Most are
requests.exceptions.HTTPError, whose message includes the HTTP status, the URL and the response body (verified for 401 and 404). Validation errors, such as a duplicate task-group name, are raised asyellowdog_client.model.exceptions.InvalidRequestException(SDK exception types subclassBaseCustomException, notHTTPError), so catch both if you handle SDK errors. The provider catches SDK errors only in these cases: an “invalid transition” response to a cancellation (the work requirement has already finished), a pool shutdown (already shut down) or a compute requirement termination (already terminating or terminated) is treated as success; while an operator or a deferred sensor waits, up to three consecutive transient errors are retried; and clean-up after a failure (cancelling or terminating) is best-effort, so its own errors are logged and the original error is raised.
To handle provider errors yourself, for example in a subclass or in your own
task using the hook, catch YellowDogException, and SDK errors
separately.
Common problems
Symptom |
Likely cause |
What to do |
|---|---|---|
A |
Wrong Application key ID or secret, the wrong Platform API URL, or an Application without permission for the namespace. |
Check the connection’s fields (see Connections) and the Application’s groups in the YellowDog Portal. Use the connection test. |
|
The connection exists but a credential field is empty. |
Fill in the Application Key ID and Application Key Secret. |
Airflow reports that the connection ID is not defined |
No connection with that ID, for example |
Create the connection, or check the |
|
No resource with that namespace and name, often because the name was built differently from the task that created it, or the resource has not been created yet. |
Compare the names in the task logs ( |
|
A field such as |
Look at the upstream task first. For teardown tasks, see When an ID renders to "None". |
|
Neither the ID nor all the name arguments were given, or they rendered to empty strings. |
Supply the ID, or every name argument. |
Duplicate-name error from YellowDog when a task is retried or a DAG is re-run |
|
Build compute requirement names from the run, for example from
|
A work requirement is named |
A retry or a clear submitted a fresh copy, or a work requirement of another task or run already had the name. See Safe retries and the run stamp. |
Nothing to fix. Downstream tasks should use the ID from XCom rather than the name. |
|
The |
Remove the tag, or record the information elsewhere (for example in the work requirement’s name or the tasks’ environment). |
A deferred task never finishes, then fails with a deferral timeout |
No triggerer is running, so nothing polls the resource. Airflow fails
the task when its own deferral timeout (the operator’s |
Run |
|
A connection problem, timeout, HTTP 429 or 5xx response while waiting. Up to three in a row are retried. |
Nothing, unless the wait then fails; check connectivity to the Platform API URL. |
Work requirements cancelled by the teardown ( |
|
Expected if the work was still running when the teardown started,
for example after a failure elsewhere. To keep it, pass
|
Teardown warns |
|
Make it a teardown of the pool’s setup
( |
Work left running after a worker crash, by a task outside every setup/teardown scope |
Under |
Put the task in a teardown’s scope, or use
|
Work of another Airflow environment cancelled, resumed or treated as already completed |
Two Airflow environments use the same YellowDog account without
distinct |
Set a different |
Worker pools left running after a failed or killed DAG run |
A |
Give pools an idle shutdown ( |
Teardown task succeeds although the pool was already shut down |
The pool shut itself down (idle shutdown) or an earlier try shut it down; the teardown treats this as success. |
Nothing to fix. |
Sensor fails with |
Neither a target state nor a failure state was reached within
|
Check the resource in the YellowDog Portal. Check the run
specification’s |
Sensor fails with |
The resource reached a failure state, for example a work requirement
|
Investigate the resource in the YellowDog Portal (for work, the failed
tasks’ output). If the outcome is acceptable, add it to
|
Sensor fails on its first poke instead of waiting |
An exception during a poke (for example a |
Run the sensor after the task that creates the resource, or set
|
|
A callable whose parameters are not named exactly |
Rename the parameters. Annotate callables with |
|
|
Call |
|
|
Manage configured pools outside this operator. |
Work requirement created with a name like |
Jinja was placed inside an SDK object, where it is not rendered. |
Build the object in a callable; see Templating and callables. |
Testing the connection
The quickest check of credentials and URL is Airflow’s connection test, which
makes one authenticated request to YellowDog. It must be enabled first
(AIRFLOW__CORE__TEST_CONNECTION=Enabled); then use the Test button in
the UI, or:
$ airflow connections test yellowdog_default
See Connections for details.
Logging
Operators and sensors log what they do to the Airflow task log at INFO
level, including:
the resource being looked up, by ID or by
namespace/name, and the ID or name it resolved to;each action taken and the resulting ID (
Added work requirement ID '...',Provisioned worker pool ID '...');for the submitting operators, what was found from earlier attempts and what was done (
Work requirement '<namespace>/<name>' (ID '...'): submitted,resumedoralready completed);for waits, the current status on every check (
Current status is 'RUNNING' ... waiting for 60 seconds) andReached status '...';for sensors, the target states and the current status on every poke;
warnings for clean-up (
Cancelling work requirement ID '...', aborting running tasks (...),Shutting down worker pool ID '...' and terminating its compute requirement (...));the Platform API URL, when it is not the default;
warnings, for example when both an ID and a name were supplied, or when a cancellation was ignored because the work requirement had already finished.
Open the task instance’s log in the Airflow UI to see them. To find the same resources in the YellowDog Portal, use the IDs or names from the log.