mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Reranker model Qwen3-Reranker-8B add failed with hint 'NoneType' object is not iterable #353
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @elvizlai on GitHub (Jun 9, 2025).
Self Checks
Dify version
1.4.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Using OpenAI OpenAI-API-compatible to add Reranked model served by vLLM
The screencap of dify:
Returns error: 'NoneType' object is not iterable
Here is vLLM running log:
And here is log from
docker-api-1:✔️ Expected Behavior
Rerank model added
❌ Actual Behavior
'NoneType' object is not iterable
@dosubot[bot] commented on GitHub (Jun 9, 2025):
The error "'NoneType' object is not iterable" likely happens because the rerank model instance or its response is None at some point in the pipeline. This can occur if the reranker model configuration is missing required details (like provider name or credentials), or if the model provider/plugin is not properly registered or initialized in Dify. The code expects a list of reranked documents, but if the model instance or its response is None, this error will be raised when the code tries to iterate over it (source, source).
Double-check that:
If any of these are missing or misconfigured, Dify will not be able to instantiate the reranker model, resulting in the observed error. There is no hardcoded support for Qwen3-Reranker-8B or vLLM in the reranker pipeline; everything is routed through the provider/plugin abstraction, so proper registration and configuration are essential.
If you have already checked these and the issue persists, please share the exact reranker model configuration (with sensitive info redacted) for further troubleshooting.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@elvizlai commented on GitHub (Jun 9, 2025):
maybe same as https://github.com/langgenius/dify/issues/14140, looks it still not solved. @dosu
@dosubot[bot] commented on GitHub (Jun 9, 2025):
Yes, your issue does appear closely related to langgenius/dify#14140. Both involve rerank models served by vLLM and errors triggered when the top_n parameter is None. In the code, if top_n is not set, it can propagate as None and cause failures when the rerank model or its response is missing or malformed, leading to the 'NoneType' object is not iterable error (source). The workaround in langgenius/dify#14140—setting a default value for top_n—addresses the symptom but not the root cause, and there’s no permanent fix merged yet.
To avoid this error, make sure your rerank model config always provides a valid top_n value and that all required fields (provider name, model name, credentials) are set. If you’re using vLLM’s rerank API, you may need to patch your deployment to ensure top_n is never None in requests, or adjust your config/UI to always set it explicitly. The underlying issue is still open and not fully resolved upstream.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@Taimin commented on GitHub (Jul 22, 2025):
I have similar issue. But instead of the error mentioned above, the error I have is:
@harrygleb commented on GitHub (Jul 29, 2025):
A similar problem
@dosubot[bot] commented on GitHub (Aug 21, 2025):
Hi, @elvizlai. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!
@elvizlai commented on GitHub (Aug 21, 2025):
I solved this by changing vllm version and using --task score.
@dosubot[bot] commented on GitHub (Aug 21, 2025):
Thank you for closing the issue, elvizlai! We appreciate your help.