R
RunPod6mo ago
georg

Image is generated successfully, but cant not found for sending back

Hey everyone, i call my ComfyUI backend and recieve the message in the logs:
{"requestId": null, "message": "Images generated successfully for prompt: 5cf0fe28-0abd-4eb1-8d6d-f2bad258baa5", "level": "INFO"}
{"requestId": null, "message": "Images generated successfully for prompt: 5cf0fe28-0abd-4eb1-8d6d-f2bad258baa5", "level": "INFO"}
But as a overall response i get:
{"error_type": "<class 'FileNotFoundError'>", "error_message": "[Errno 2] No such file or directory: '/runpod-volume/ComfyUI/output/ComfyUI_temp_ugpqc_00001_.png'", "error_traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.10/dist-packages/runpod/serverless/modules/rp_job.py\", line 134, in run_job\n handler_return = handler(job)\n File \"/rp_handler.py\", line 219, in handler\n with open(image_path, 'rb') as image_file:\nFileNotFoundError: [Errno 2] No such file or directory: '/runpod-volume/ComfyUI/output/ComfyUI_temp_ugpqc_00001_.png'\n", "hostname": "4om962zlz99dn7-64410fdb", "worker_id": "4om962zlz99dn7", "runpod_version": "1.4.2"}
{"error_type": "<class 'FileNotFoundError'>", "error_message": "[Errno 2] No such file or directory: '/runpod-volume/ComfyUI/output/ComfyUI_temp_ugpqc_00001_.png'", "error_traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.10/dist-packages/runpod/serverless/modules/rp_job.py\", line 134, in run_job\n handler_return = handler(job)\n File \"/rp_handler.py\", line 219, in handler\n with open(image_path, 'rb') as image_file:\nFileNotFoundError: [Errno 2] No such file or directory: '/runpod-volume/ComfyUI/output/ComfyUI_temp_ugpqc_00001_.png'\n", "hostname": "4om962zlz99dn7-64410fdb", "worker_id": "4om962zlz99dn7", "runpod_version": "1.4.2"}
whats happend here? Is this a fault in my workflow? The workflow is working locally fine.
Solution:
I fixed it, there was a Preview Image in the Flow. I removed it and now it works.
Jump to solution
3 Replies
justin
justin6mo ago
Did u mount this runpod to a volume? that seems to be the issue? Probably need to inspect ur volume to see if the folder structure is valid something I like to do is I like to modify my dockerfile into two parts 1) With everything except calling the handler.py (my base image is usually a runpod image so this is possible) 2) a dockerfile that uses #1 as a base image and adds a handler.py + a cmd this way with #1 u can mount to a gpu pod and call the handler.py manually to make sure is working as expected also just as a faster sanity check can open up a small gpu pod and attach to ur network volume and confirm the folders are there in ur volume might be written somewhere else rather than in volume might be to like ur local docker directory
georg
georg6mo ago
Yes i mounted it to a runpod volume, but oddly, i can verify with the handler that everything works pretty well, just one worflow throws this error. My structure is like this to choose a workflow and 0,1,2,4 are working, but 3 not. Example.
if event["flow_id"] == 1:
logging.debug(f"Flow 1")
logger.info(f"Flow 1")
prompt = wrap_json('/workflows/group.json')

if event["flow_id"] == 2:
logging.debug(f"Flow 1")
logger.info(f"Flow 2")
prompt = wrap_json('/workflows/single.json')
if event["flow_id"] == 1:
logging.debug(f"Flow 1")
logger.info(f"Flow 1")
prompt = wrap_json('/workflows/group.json')

if event["flow_id"] == 2:
logging.debug(f"Flow 1")
logger.info(f"Flow 2")
prompt = wrap_json('/workflows/single.json')
Then it gets processed the normal way. All workflows except one are sending back the expected image.
Solution
georg
georg6mo ago
I fixed it, there was a Preview Image in the Flow. I removed it and now it works.