AttributeError: 'NoneType' object has no attribute 'model_properties' when using Ollama model with specific configuration in ReAct mode on Agent node #107

Closed
opened 2026-02-16 10:18:05 -05:00 by yindo · 10 comments
Owner

Originally created by @fwls on GitHub (Mar 21, 2025).

Originally assigned to: @Nov1c444 on GitHub.

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.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In the Dify model configuration, add the qwen2.5:32b model with the Ollama driver. Enable the "Support Function Call" option and set the maximum token number to 4096.
In the Chatflow, select the Agent node and choose the ReAct mode. Select the qwen2.5:32b model and configure the temperature to 0.4 and the maximum token number for prediction to 4096.
Click the "Preview" button to reproduce the issue.

✔️ Expected Behavior

how to fix this error

Actual Behavior

No response

Originally created by @fwls on GitHub (Mar 21, 2025). Originally assigned to: @Nov1c444 on GitHub. ### 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.0.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce In the Dify model configuration, add the qwen2.5:32b model with the Ollama driver. Enable the "Support Function Call" option and set the maximum token number to 4096. In the Chatflow, select the Agent node and choose the ReAct mode. Select the qwen2.5:32b model and configure the temperature to 0.4 and the maximum token number for prediction to 4096. Click the "Preview" button to reproduce the issue. ### ✔️ Expected Behavior how to fix this error ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:05 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 21, 2025):

@fwls Hello there! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing.

The AttributeError: 'NoneType' object has no attribute 'model_properties' typically occurs when the code attempts to access an attribute on a NoneType object. This can happen if a configuration or model property is expected but not properly initialized or returned as None.

Here are some steps you can take to troubleshoot and potentially resolve this issue:

  1. Check Model Configuration: Ensure that the model configuration for the qwen2.5:32b model with the Ollama driver is correctly set up. Verify that all required fields are filled and that the model is properly initialized.

  2. Review Function Call Support: Since the error occurs when the "Support Function Call" option is enabled, double-check the implementation and compatibility of this feature with the qwen2.5:32b model. There might be specific requirements or limitations.

  3. Inspect ReAct Mode Setup: Ensure that the ReAct mode in the Agent node is correctly configured. Verify that all dependencies, such as tools and instructions, are properly set up.

  4. Error Handling: Implement error handling to catch and log any NoneType issues before they cause an exception. This can help identify where the None value is originating from.

  5. Update to Latest Version: If the issue persists, consider updating to the latest version of Dify, as there might be bug fixes or improvements related to this problem.

If these steps do not resolve the issue, you may need to look into the specific implementation details of the model and driver in the Dify codebase to identify any potential mismatches or missing configurations.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 21, 2025): <!-- Greeting --> @fwls Hello there! I'm here to help you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing. <!-- Answer --> The `AttributeError: 'NoneType' object has no attribute 'model_properties'` typically occurs when the code attempts to access an attribute on a `NoneType` object. This can happen if a configuration or model property is expected but not properly initialized or returned as `None`. Here are some steps you can take to troubleshoot and potentially resolve this issue: 1. **Check Model Configuration:** Ensure that the model configuration for the qwen2.5:32b model with the Ollama driver is correctly set up. Verify that all required fields are filled and that the model is properly initialized. 2. **Review Function Call Support:** Since the error occurs when the "Support Function Call" option is enabled, double-check the implementation and compatibility of this feature with the qwen2.5:32b model. There might be specific requirements or limitations. 3. **Inspect ReAct Mode Setup:** Ensure that the ReAct mode in the Agent node is correctly configured. Verify that all dependencies, such as tools and instructions, are properly set up. 4. **Error Handling:** Implement error handling to catch and log any `NoneType` issues before they cause an exception. This can help identify where the `None` value is originating from. 5. **Update to Latest Version:** If the issue persists, consider updating to the latest version of Dify, as there might be bug fixes or improvements related to this problem. If these steps do not resolve the issue, you may need to look into the specific implementation details of the model and driver in the Dify codebase to identify any potential mismatches or missing configurations. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/f271c8bb-b93f-4735-8501-fa29627926d0?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f271c8bb-b93f-4735-8501-fa29627926d0?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f271c8bb-b93f-4735-8501-fa29627926d0?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f271c8bb-b93f-4735-8501-fa29627926d0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f271c8bb-b93f-4735-8501-fa29627926d0?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/f271c8bb-b93f-4735-8501-fa29627926d0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f271c8bb-b93f-4735-8501-fa29627926d0?feedback_type=other)</sup>
Author
Owner

@fwls commented on GitHub (Mar 21, 2025):

@dosu However, the system runs normally when the temperature and maximum tokens are not configured.

@fwls commented on GitHub (Mar 21, 2025): @dosu However, the system runs normally when the temperature and maximum tokens are not configured.
Author
Owner

@dosubot[bot] commented on GitHub (Mar 21, 2025):

The issue you're experiencing might be related to how the temperature and maximum token settings interact with the model configuration. Since the system runs normally without these configurations, it suggests that there might be constraints or specific requirements for these parameters with the qwen2.5:32b model or the Ollama driver.

  1. Temperature Range: Ensure that the temperature setting is within the acceptable range for the model. Some models have specific limits, and setting a value outside this range can cause errors.

  2. Maximum Tokens: Check if the maximum token setting exceeds the model's limit. If the model has a lower token limit than what you're configuring, it could lead to issues. Try reducing the maximum token number to see if it resolves the problem.

  3. Model-Specific Constraints: Review any documentation or notes regarding the qwen2.5:32b model and the Ollama driver to ensure there are no specific constraints or incompatibilities with these settings.

Adjusting these configurations to align with the model's requirements might help resolve the error.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 21, 2025): <!-- Answer --> The issue you're experiencing might be related to how the temperature and maximum token settings interact with the model configuration. Since the system runs normally without these configurations, it suggests that there might be constraints or specific requirements for these parameters with the qwen2.5:32b model or the Ollama driver. 1. **Temperature Range:** Ensure that the temperature setting is within the acceptable range for the model. Some models have specific limits, and setting a value outside this range can cause errors. 2. **Maximum Tokens:** Check if the maximum token setting exceeds the model's limit. If the model has a lower token limit than what you're configuring, it could lead to issues. Try reducing the maximum token number to see if it resolves the problem. 3. **Model-Specific Constraints:** Review any documentation or notes regarding the qwen2.5:32b model and the Ollama driver to ensure there are no specific constraints or incompatibilities with these settings. Adjusting these configurations to align with the model's requirements might help resolve the error. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/7470b750-9492-4c40-9175-5c9303a951ff?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7470b750-9492-4c40-9175-5c9303a951ff?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7470b750-9492-4c40-9175-5c9303a951ff?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7470b750-9492-4c40-9175-5c9303a951ff?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7470b750-9492-4c40-9175-5c9303a951ff?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7470b750-9492-4c40-9175-5c9303a951ff?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7470b750-9492-4c40-9175-5c9303a951ff?feedback_type=other)</sup>
Author
Owner

@fwls commented on GitHub (Mar 21, 2025):

@dosu
These parameters will trigger the error regardless of the values set, even when the values are set to be very small.

@fwls commented on GitHub (Mar 21, 2025): @dosu These parameters will trigger the error regardless of the values set, even when the values are set to be very small.
Author
Owner

@dosubot[bot] commented on GitHub (Mar 21, 2025):

The persistent error you're encountering, regardless of the parameter values, suggests a deeper issue with how the temperature and maximum token settings are being handled in the configuration. Here are a few steps to consider:

  1. Configuration Validation: Double-check the YAML configuration for the qwen2.5:32b model to ensure that the parameters are correctly defined and that there are no syntax errors. The parameters should match the expected types and ranges specified in the configuration file.

  2. Driver Compatibility: Verify that the Ollama driver is fully compatible with the qwen2.5:32b model and supports the configuration parameters you're trying to set. There might be a mismatch or missing implementation detail causing the error.

  3. Debugging: Add logging or debugging statements in the code where the model is initialized and configured. This can help identify if and where the parameters are being set to None or if there's an issue with the model properties.

  4. Review Known Issues: Check if there are any known issues or updates related to the Ollama driver or the qwen2.5:32b model in the Dify repository that might address this problem.

If these steps don't resolve the issue, it might be necessary to delve into the specific implementation details of the model and driver to identify any potential mismatches or missing configurations.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 21, 2025): <!-- Answer --> The persistent error you're encountering, regardless of the parameter values, suggests a deeper issue with how the temperature and maximum token settings are being handled in the configuration. Here are a few steps to consider: 1. **Configuration Validation:** Double-check the YAML configuration for the qwen2.5:32b model to ensure that the parameters are correctly defined and that there are no syntax errors. The parameters should match the expected types and ranges specified in the configuration file. 2. **Driver Compatibility:** Verify that the Ollama driver is fully compatible with the qwen2.5:32b model and supports the configuration parameters you're trying to set. There might be a mismatch or missing implementation detail causing the error. 3. **Debugging:** Add logging or debugging statements in the code where the model is initialized and configured. This can help identify if and where the parameters are being set to `None` or if there's an issue with the model properties. 4. **Review Known Issues:** Check if there are any known issues or updates related to the Ollama driver or the qwen2.5:32b model in the Dify repository that might address this problem. If these steps don't resolve the issue, it might be necessary to delve into the specific implementation details of the model and driver to identify any potential mismatches or missing configurations. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/d307467b-6ee0-4b9a-bc20-fcf7d44d0368?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/d307467b-6ee0-4b9a-bc20-fcf7d44d0368?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/d307467b-6ee0-4b9a-bc20-fcf7d44d0368?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/d307467b-6ee0-4b9a-bc20-fcf7d44d0368?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d307467b-6ee0-4b9a-bc20-fcf7d44d0368?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/d307467b-6ee0-4b9a-bc20-fcf7d44d0368?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d307467b-6ee0-4b9a-bc20-fcf7d44d0368?feedback_type=other)</sup>
Author
Owner
@lordk911 commented on GitHub (Mar 23, 2025): The same error occur when use Xinference: ref to : https://github.com/langgenius/dify-plugin-sdks/pull/45 it make AgentModelConfig.entity could be none. But It will still be use : https://github.com/langgenius/dify-official-plugins/blob/5436a6a06c92c28b02d90a585c65a0c112e9150b/agent-strategies/cot_agent/strategies/function_calling.py#L123C1-L126C18 https://github.com/langgenius/dify-official-plugins/blob/5436a6a06c92c28b02d90a585c65a0c112e9150b/agent-strategies/cot_agent/strategies/ReAct.py#L150C1-L153C18 https://github.com/langgenius/dify-plugin-sdks/blob/064985386745c6f4553f180d07e459778a78a61b/python/dify_plugin/interfaces/agent/__init__.py#L156C1-L161C96 @crazywoola @Yeuoly
Author
Owner

@crazywoola commented on GitHub (Mar 25, 2025):

@Nov1c444 Please take a look at this.

@crazywoola commented on GitHub (Mar 25, 2025): @Nov1c444 Please take a look at this.
Author
Owner

@Nov1c444 commented on GitHub (Mar 27, 2025):

Please update the plugin version to 0.0.12 and try it. If there are no problems, I will close the issue.

@Nov1c444 commented on GitHub (Mar 27, 2025): Please update the plugin version to 0.0.12 and try it. If there are no problems, I will close the issue.
Author
Owner

@fwls commented on GitHub (Mar 27, 2025):

Please update the plugin version to 0.0.12 and try it. If there are no problems, I will close the issue.

Please tell me how to upgrade the plugin to version 0.0.12. My Dify version is 1.0.1.
Thanks.

@fwls commented on GitHub (Mar 27, 2025): > Please update the plugin version to 0.0.12 and try it. If there are no problems, I will close the issue. Please tell me how to upgrade the plugin to version 0.0.12. My Dify version is 1.0.1. Thanks.
Author
Owner

@fwls commented on GitHub (Mar 27, 2025):

@Nov1c444 The problem has been resolved. Thank you.

@fwls commented on GitHub (Mar 27, 2025): @Nov1c444 The problem has been resolved. Thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#107