tool invoke error: cannot access local variable 'retrieval_resource_list' where it is not associated with a value" #14399

Closed
opened 2026-02-21 19:17:04 -05:00 by yindo · 2 comments
Owner

Originally created by @wisty on GitHub (Jun 3, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @wisty on GitHub (Jun 3, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/a1903991-d051-437c-a2d8-54b90e6a99c9) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:17:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 3, 2025):

The error "cannot access local variable 'retrieval_resource_list' where it is not associated with a value" typically means that the variable is being used before it has been assigned. In the Dify codebase, retrieval_resource_list is always initialized as an empty list before use in the relevant modules, such as KnowledgeRetrievalNode, DatasetRetrieverTool, and DatasetRetrieval classes. It is then populated programmatically according to the retrieval workflow and only accessed after assignment, which suggests the code itself is robust in this regard cite.

Given this, the error is likely caused by a misconfiguration or an integration issue in your self-hosted Docker setup, or possibly by a workflow or tool invocation path that bypasses the normal initialization logic. There are no recent changes or known issues in version 1.1.3 related to this variable cite.

To troubleshoot, review any custom workflow steps, tool configurations, or API calls that might invoke retrieval logic in an unexpected way. Adding debug logging before and after the assignment of retrieval_resource_list in your deployment may help pinpoint where the variable is accessed prematurely. If you have made any custom modifications or are using third-party extensions, ensure they do not interfere with the standard retrieval workflow.

To reply, just mention my name @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 3, 2025): <!-- Answer --> The error "cannot access local variable 'retrieval_resource_list' where it is not associated with a value" typically means that the variable is being used before it has been assigned. In the Dify codebase, `retrieval_resource_list` is always initialized as an empty list before use in the relevant modules, such as `KnowledgeRetrievalNode`, `DatasetRetrieverTool`, and `DatasetRetrieval` classes. It is then populated programmatically according to the retrieval workflow and only accessed after assignment, which suggests the code itself is robust in this regard [cite](https://github.com/langgenius/dify/blob/275e86a26c6b86409c391432a010fe0b1096b88e/api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py). Given this, the error is likely caused by a misconfiguration or an integration issue in your self-hosted Docker setup, or possibly by a workflow or tool invocation path that bypasses the normal initialization logic. There are no recent changes or known issues in version 1.1.3 related to this variable [cite](https://github.com/langgenius/dify/blob/275e86a26c6b86409c391432a010fe0b1096b88e/api/core/tools/utils/dataset_retriever/dataset_retriever_tool.py). To troubleshoot, review any custom workflow steps, tool configurations, or API calls that might invoke retrieval logic in an unexpected way. Adding debug logging before and after the assignment of `retrieval_resource_list` in your deployment may help pinpoint where the variable is accessed prematurely. If you have made any custom modifications or are using third-party extensions, ensure they do not interfere with the standard retrieval workflow. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/d42cdd1d-db51-4f60-90fd-100778970d99?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d42cdd1d-db51-4f60-90fd-100778970d99?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d42cdd1d-db51-4f60-90fd-100778970d99?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d42cdd1d-db51-4f60-90fd-100778970d99?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d42cdd1d-db51-4f60-90fd-100778970d99?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d42cdd1d-db51-4f60-90fd-100778970d99?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d42cdd1d-db51-4f60-90fd-100778970d99?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20619)
Author
Owner

@crazywoola commented on GitHub (Jun 4, 2025):

This has been fixed in later version.

@crazywoola commented on GitHub (Jun 4, 2025): This has been fixed in later version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14399