{"record":{"id":"4bda99cd22e7f762","repo":"Comfy-Org/ComfyUI","slug":"kling-task-response-data-task-id-succeeded-but-n","errorCode":null,"errorMessage":"Kling task {response.data.task_id} succeeded but no video data found in response.","messagePattern":"Kling task (.+?) succeeded but no video data found in response\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_kling.py","lineNumber":307,"sourceCode":"            f\"Negative prompt is too long: {len(negative_prompt)} characters\"\n        )\n    return True\n\n\ndef validate_task_creation_response(response) -> None:\n    \"\"\"Validates that the Kling task creation request was successful.\"\"\"\n    if not is_valid_task_creation_response(response):\n        error_msg = f\"Kling initial request failed. Code: {response.code}, Message: {response.message}, Data: {response.data}\"\n        logging.error(error_msg)\n        raise Exception(error_msg)\n\n\ndef validate_video_result_response(response) -> None:\n    \"\"\"Validates that the Kling task result contains a video.\"\"\"\n    if not is_valid_video_response(response):\n        error_msg = f\"Kling task {response.data.task_id} succeeded but no video data found in response.\"\n        logging.error(\"Error: %s.\\nResponse: %s\", error_msg, response)\n        raise Exception(error_msg)\n\n\ndef validate_image_result_response(response) -> None:\n    \"\"\"Validates that the Kling task result contains an image.\"\"\"\n    if not is_valid_image_response(response):\n        error_msg = f\"Kling task {response.data.task_id} succeeded but no image data found in response.\"\n        logging.error(\"Error: %s.\\nResponse: %s\", error_msg, response)\n        raise Exception(error_msg)\n\n\ndef validate_input_image(image: torch.Tensor) -> None:\n    \"\"\"\n    Validates the input image adheres to the expectations of the Kling API:\n    - The image resolution should not be less than 300*300px\n    - The aspect ratio of the image should be between 1:2.5 ~ 2.5:1\n\n    See: https://app.klingai.com/global/dev/document-api/apiReference/model/imageToVideo\n    \"\"\"","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_kling.py#L289-L325","documentation":"Raised by validate_video_result_response after a Kling video task reported success but the response contains no playable video in task_result.videos. The task lifecycle completed (polled to a terminal state), yet the result payload is missing the video entry — an upstream data inconsistency, and the response.data.task_id is embedded in the message.","triggerScenarios":"Kling marks a video task as succeeded but returns task_result without videos (or videos empty) — server-side rendering pipeline failure, expired result storage, or a schema change in the result payload.","commonSituations":"Long video jobs whose artifacts expire before retrieval; Kling infra incidents; very rare and usually resolved by re-submitting the task.","solutions":["Re-run the Kling video node to create a fresh task","Record the task_id from the message and check it in the Kling developer console","If persistent across prompts, check Kling status pages or API changelog for result-schema changes","Reduce requested duration/resolution to shorten generation time and avoid artifact expiry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in range(2):\n    try:\n        out = await kling_video_node(...)\n        break\n    except Exception as e:\n        if attempt == 1 or \"no video data found\" not in str(e):\n            raise","preventionTips":["Re-submit the task on this inconsistency; it is usually not input-related","Keep the task_id from the message for console follow-up","Avoid extremely long generations that outlive result storage"],"tags":["kling","video-generation","task-result","upstream-inconsistency"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}