-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
When using --wait flag on async operations, if a task enters processing-error state, the CLI continues to spin indefinitely instead of recognizing it as a terminal error state and displaying the error details.
Steps to Reproduce
# Try to create a database on a subscription that's at capacity
redisctl cloud database create \
--subscription 2969240 \
--data '{
"name": "demo-db",
"memoryLimitInGb": 1,
"protocol": "redis"
}' \
--waitExpected Behavior
The command should:
- Recognize
processing-erroras a terminal state - Stop spinning/waiting
- Display the error details from the task response
- Exit with non-zero status code
Example output should show:
Task 0944fbaa-fa16-4493-9955-b9f5a5bf4e4c: ✗ processing-error
Task Details:
-------------
Status: processing-error
Description: Task request failed during processing. See error information for failure details.
Error: Subscription was not found (404 NOT_FOUND)
Actual Behavior
Command spins indefinitely:
⠁ Task 0944fbaa-fa16-4493-9955-b9f5a5bf4e4c: processing-error [00:00:10]
The spinner continues until timeout (default 300 seconds).
Investigation
Root Cause 1: is_terminal_state() in crates/redisctl/src/commands/cloud/async_utils.rs:224 does not recognize processing-error as a terminal state.
Current code:
fn is_terminal_state(state: &str) -> bool {
matches!(
state.to_lowercase().as_str(),
"completed" | "complete" | "succeeded" | "success" | "failed" | "error" | "cancelled"
)
}Should include: "processing-error"
Root Cause 2: print_task_details() doesn't properly extract nested error information from response.error field.
Task response structure:
{
"status": "processing-error",
"response": {
"error": {
"type": "SUBSCRIPTION_NOT_FOUND",
"status": "404 NOT_FOUND",
"description": "Subscription was not found"
}
}
}Proposed Fix
- Update
is_terminal_state()to includeprocessing-error - Update
print_task_details()to extract and displayresponse.errorfields - Update
wait_for_task()error condition to check forprocessing-error
Related Code
crates/redisctl/src/commands/cloud/async_utils.rs:224-is_terminal_state()crates/redisctl/src/commands/cloud/async_utils.rs:160-wait_for_task()crates/redisctl/src/commands/cloud/async_utils.rs:260-print_task_details()
Verification
# Manual check of task status
redisctl api cloud get /tasks/0944fbaa-fa16-4493-9955-b9f5a5bf4e4cShows the task correctly has processing-error status with detailed error in response.error.