{"record":{"id":"6a3ec6055154b8d9","repo":"ATH-MaaS/Pixelle-Video","slug":"dashscope-image-edit-returned-no-image-urls-outpu","errorCode":null,"errorMessage":"DashScope image edit returned no image URLs. output={getattr(response, 'output', None)}","messagePattern":"DashScope image edit returned no image URLs\\. output=(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_services/image_dashscope.py","lineNumber":171,"sourceCode":"            }\n        ]\n\n        try:\n            # Use ImageGeneration.call with messages, same as generate_image\n            with self._proxy_env():\n                response = ImageGeneration.call(\n                    model=model,\n                    api_key=self.api_key,\n                    messages=messages,\n                    n=n,\n                    size=size,\n                    watermark=False,\n                )\n\n            if response.status_code == 200:\n                results = self._extract_image_urls(getattr(response, \"output\", None))\n                if not results:\n                    raise RuntimeError(f\"DashScope image edit returned no image URLs. output={getattr(response, 'output', None)}\")\n\n                # Check if we should download\n                if save_dir:\n                    os.makedirs(save_dir, exist_ok=True)\n                    local_files = []\n                    for i, url in enumerate(results):\n                        file_name = f\"ds_{session_id if session_id else 'nosess'}_{int(time.time())}_{i}_{uuid.uuid4().hex[:6]}.png\"\n                        file_path = os.path.join(save_dir, file_name)\n                        if self.image_processor.download_image(url, file_path):\n                            local_files.append(file_path)\n                    return local_files\n\n                return results\n            else:\n                raise RuntimeError(f\"Image edit failed: {response.code}, {response.message}, status={response.status_code}\")\n        except Exception as e:\n            logging.error(f\"Error in edit_image: {e}\")\n            raise","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_services/image_dashscope.py#L153-L189","documentation":"Mirrors error 46 for the edit path: DashScope returns status 200 but no image URLs can be extracted from response.output, so edit_image raises this RuntimeError.","triggerScenarios":"Calling edit_image where the provider acknowledges the request (200) but output contains no image URLs — e.g. async task not finished, schema mismatch, or zero successful edits.","commonSituations":"Polling an async edit task too early; DashScope SDK/API schema drift; images rejected silently; account limits yielding empty results.","solutions":["Inspect and log response.output for the actual payload","Retry with backoff to allow async task completion","Update the dashscope SDK and re-check _extract_image_urls parsing","Validate input image URLs are publicly reachable and supported formats"],"exampleFix":"// before\nres = gen.edit_image(prompt=p, image_urls=[local_path])\n// after\nres = gen.edit_image(prompt=p, image_urls=[\"https:// publicly-reachable/img.png\"])","handlingStrategy":"retry","validationCode":"for url in image_urls:\n    assert url.startswith((\"http://\", \"https://\")), f\"unreachable image url: {url}\"","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        return gen.edit_image(prompt=p, image_urls=urls)\n    except RuntimeError as e:\n        if \"returned no image URLs\" in str(e) and attempt < 2:\n            time.sleep(2 ** attempt)\n            continue\n        raise","preventionTips":["Poll async edit tasks until completion before reading output","Validate input image URLs are publicly reachable","Log response.output to catch schema drift early"],"tags":["api-error","empty-response","image-editing"],"backgroundTag":"empty-api-response","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}