HTTP_REQUEST_NODE_SSL_VERIFY=False in api and web, but still getting an SSL error when adding the model. The HTTP error is: UnboundLocalError: local variable 'content' referenced before assignment
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
HTTP_REQUEST_NODE_SSL_VERIFY=False in api and web, but still getting an SSL error when adding the model. The HTTP error is: UnboundLocalError: local variable 'content' referenced before assignment
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The error message "UnboundLocalError: local variable 'content' referenced before assignment" suggests that the variable content is being used before it has been assigned a value. This can occur if there is a conditional block where content is only assigned under certain conditions, and those conditions are not met.
To address this issue, you should:
-
Check the Code Logic: Look for the function or section of the code where
contentis defined and ensure that it is assigned a value in all possible execution paths. This might involve initializingcontentwith a default value before any conditional logic. -
Review SSL Configuration: Although you have set
HTTP_REQUEST_NODE_SSL_VERIFY=False, ensure that this configuration is correctly applied in the context where the error occurs. Double-check that the configuration is being read and applied as expected. -
Debugging: Add logging or print statements before the line where
contentis used to verify whether it has been assigned a value. This can help identify the specific conditions under which the error occurs.
Unfortunately, I couldn't find specific information about where the content variable is defined or used in the Dify codebase. You might need to search through the code to locate the relevant section. If the issue persists, consider reviewing recent changes or commits that might have affected this part of the code.
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
You have an issue with the Open AI Compable Model Provider:
And expect an ENV variable named HTTP_REQUEST_NODE_SSL_VERIFY to be the issue.
Here's the node that variable is meant for:
Hi, @peterliang5678. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- The issue involves an SSL error and an
UnboundLocalErrorrelated to the 'content' variable when adding a model in a self-hosted Dify environment. - You reported setting
HTTP_REQUEST_NODE_SSL_VERIFY=Falsebut still encountering the error. - I suggested checking the code logic for 'content' assignment and verifying SSL configuration.
- @DavideDelbianco mentioned a potential misunderstanding regarding the environment variable, suggesting it might relate to a specific node in the Open AI Compatible Model Provider setup.
Next Steps:
- Please confirm if this issue is still relevant to the latest version of the Dify repository. If it is, you can keep the discussion open by commenting on the issue.
- Otherwise, the issue will be automatically closed in 15 days.
Thank you for your understanding and contribution!