ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: "Request failed: NoneType: None" after long processing duration on /v1/canvas/completion

Open LingYi-Z01 opened this issue 3 weeks ago • 7 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (Language Policy).
  • [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • [x] Please do not modify this template :) and fill in all the required fields.

Describe your problem

I encountered an error while using the chat feature with the GeminiCV model. The system processes for approximately 5 minutes and then throws a NoneType: None error.

Description

I encountered an error while using the chat feature with the GeminiCV model. The system processes for approximately 5 minutes and then throws a NoneType: None error.

I suspect this might be related to the data volume or context size, although I am only processing a single PDF file.

Steps to Reproduce

  1. Initialize the system with model=gemini-2.5-flash.
  2. Upload a specific PDF file: 20221021_Allgemeine_Vergabeunterlage (1).pdf.
  3. Initiate a chat/completion request.
  4. Wait for the response.

Actual Behavior

The system hangs for about 5 minutes (from 21:50:22 to 21:55:04). After the "chat completed" log appears, the following error occurs immediately:

ERROR 17 Request failed:
NoneType: None

This happens specifically during the POST request to /v1/canvas/completion and /v1/canvas/set.

Expected Behavior

The system should return a valid completion response or handle the timeout/token limit gracefully with a descriptive error message, rather than crashing with NoneType.

Logs

2025-12-10 21:50:22,611 INFO    17 [GeminiCV] chat called: history_len=1 images_len=0 gen_conf={}
...
(Heartbeat logs for ~5 minutes)
...
2025-12-10 21:55:04,362 INFO    17 [GeminiCV] chat completed
[2025-12-10 21:55:04 +0800] [17] [INFO] 127.0.0.1:37644 GET /v1/user/info 1.1 - 2346
[2025-12-10 21:55:04 +0800] [17] [INFO] 127.0.0.1:37632 POST /v1/canvas/completion 1.1 - 286461752
2025-12-10 21:55:04,425 ERROR   17 Request failed:
NoneType: None

Environment

  • Model: gemini-2.5-flash
  • Nightly version
Image

Thanks for checking

LingYi-Z01 avatar Dec 10 '25 14:12 LingYi-Z01

The "Request failed: NoneType: None" error after a long processing time on /v1/canvas/completion with GeminiCV is caused by an unhandled None or empty exception propagating up from the model or canvas runner. When GeminiCV or the canvas runner encounters an error (often due to timeouts, large context, or data volume), it may return None or an error string, but if this isn't handled properly, the Quart teardown handler logs it as "NoneType: None" instead of a descriptive message. This is especially likely after long-running LLM calls or when the input (like a large PDF) stresses the system's limits. The current implementation does not trim oversized context or implement explicit timeout handling in the GeminiCV logic, so these errors can surface as generic failures rather than clear error responses. The backend is configured for long timeouts (10 minutes) and large uploads (up to 1GB), but if the LLM call fails or returns None, the error handling does not always provide a user-friendly message. Improving error propagation and adding explicit checks for None in the GeminiCV and canvas runner logic would help return more informative errors and prevent these crashes. For now, reducing input size or monitoring logs for "ERROR:" messages from GeminiCV may help diagnose specific failures.
See code details | GeminiCV error handling

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Dec 10 '25 14:12 dosubot[bot]

So when my front page gets stuck, where can I check the final result of my agent workflow, and how can I find the final output of the entire workflow, the web console can't use because it's already stuck, other ways. step by step, and I don't know if it store in mysql or only in Redis. @dosu.

LingYi-Z01 avatar Dec 10 '25 21:12 LingYi-Z01

If your web console is stuck, you can still check the final result of your agent workflow directly from the backend. The final outputs and workflow state are stored in MySQL for durability, while Redis is used for logs and traces. Here’s how you can retrieve your results step by step:

  1. Get your canvas (workflow) ID: If you don’t know it, you can list canvases via the API (GET /v1/canvas/list).

  2. Fetch the final workflow output from MySQL:
    Use the API endpoint GET /v1/canvas/get/<canvas_id> to retrieve the latest saved workflow state and output.
    Example:

    curl -H "Authorization: Bearer <your_token>" \
         "<your_server>/v1/canvas/get/<canvas_id>"
    

    This returns the full DSL and output as stored in MySQL.
    API details

  3. Check workflow logs and traces from Redis:
    Use GET /v1/canvas/trace?canvas_id=<canvas_id>&message_id=<message_id> to fetch logs for a specific run.
    Example:

    curl -H "Authorization: Bearer <your_token>" \
         "<your_server>/v1/canvas/trace?canvas_id=<canvas_id>&message_id=<message_id>"
    

    These logs are ephemeral and stored in Redis, useful for debugging or tracking progress.
    Trace endpoint

  4. (Optional) Retrieve session history and versions:

    • GET /v1/canvas/<canvas_id>/sessions for session logs/history.
    • GET /v1/canvas/getlistversion/<canvas_id> for historical versions of your workflow output.

Summary:

  • Durable results and workflow state are in MySQL (use /v1/canvas/get/<canvas_id>).
  • Logs and traces are in Redis (use /v1/canvas/trace).
  • All API calls require authentication.

If the API endpoints don’t return expected results, check backend logs or verify your authentication. For advanced troubleshooting, you can query the MySQL tables (user_canvas, api_4_conversation, pipeline_operation_log) directly, but the recommended way is via the HTTP API.
More details and step-by-step guide

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Dec 10 '25 21:12 dosubot[bot]

I have tested the Canvas version, but there is no saved output. In DSL, only the workflow's JSON information is present, and the value of output is empty. So, how can I specifically retrieve the workflow's output from Redis trace?@dosu.

LingYi-Z01 avatar Dec 10 '25 22:12 LingYi-Z01

The Redis trace (retrieved via /v1/canvas/trace?canvas_id=...&message_id=...) only contains step-by-step logs for each workflow component—like tool calls, arguments, results, and timings—not the final workflow output. The actual output is published in the workflow_finished event and saved to MySQL. If the DSL output is empty and you can't find the result in MySQL, it means the workflow didn't finish successfully or the output wasn't persisted due to an error. You can still review the Redis trace for error messages or partial results to help debug where the workflow failed, but you won't find the final output there. For more details on the trace structure, see this code reference and how logs are written.

If you need help interpreting specific trace entries or want to debug a particular failure, feel free to share the trace JSON.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Dec 10 '25 22:12 dosubot[bot]

which version ? check by git log or git branch -vv

Magicbook1108 avatar Dec 11 '25 01:12 Magicbook1108

which version ? check by git log or git branch -vv

v0.22.1-20-g065917bf Thanks for your time, but I have to mention that this issue among v0.22.0, v0.22.1 and v0.22.1 nightly till -20-g065917bf. Do you need more log for this? Please tell me if u need any further information. @Magicbook1108 Thanks!

LingYi-Z01 avatar Dec 11 '25 08:12 LingYi-Z01

Again, if it's a volume data, the workflow broke

Image

LingYi-Z01 avatar Dec 13 '25 14:12 LingYi-Z01

Can you share the ingestion pipeline/ agent workflow with me?

Magicbook1108 avatar Dec 15 '25 03:12 Magicbook1108