langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
51.39k stars 7.41k forks source link

Failed to invoke tool: 'NoneType' object has no attribute 'items' #8333

Closed ericksvasc closed 1 month ago

ericksvasc commented 2 months ago

Self Checks

Dify version

latest

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Captura de Tela 2024-09-12 às 18 40 53 Captura de Tela 2024-09-12 às 18 41 03 Captura de Tela 2024-09-12 às 18 41 27 Captura de Tela 2024-09-12 às 18 44 02

✔️ Expected Behavior

I expected it to run the flow smoothly

❌ Actual Behavior

it presents the error: Failed to invoke tool: 'NoneType' object has no attribute 'items'

dosubot[bot] commented 2 months ago

Hello, @ericksvasc! I'm here to help you with any bugs, questions, or contributions you may have. Let's work together to resolve this issue.

I found a similar issue that might help you resolve the error you're encountering. The issue titled An error occurred while using the tool, and the code is displayed was last updated on September 05, 2024. The suggested solutions include:

  1. Ensure that the tool parameters are correctly formatted as a dictionary and that the timezone provided is valid.
  2. Verify and update the environment variables and configurations in your Docker setup, then restart your Docker containers to apply the changes.
  3. Consider using a different or smarter model, as switching to a higher quality model resolved the issue for another user [1].

Additionally, the error message "Failed to invoke tool: 'NoneType' object has no attribute 'items'" suggests that there might be a None value where a dictionary is expected. This could be due to missing or incorrectly formatted tool parameters. Ensure that all required parameters are provided and correctly formatted.

If the issue persists, you might want to check the implementation of the retrieve method in the retrieval_service.py file, as the error log indicates a problem there. The retrieve method performs document retrieval based on the specified method and can involve keyword search, semantic search, and full-text search. Make sure that the inputs to this method are valid and correctly formatted [2][3].

By addressing these points, you should be able to resolve the error and run the flow smoothly.

To continue talking to Dosu, mention @dosu.

zolgear commented 2 months ago

Duplicated #8330