Closed yanxiyue closed 1 month ago
@yanxiyue Hello! I'm here to assist you with any bugs, questions, or contributions you may have for Dify. Let's work together to solve the issue you're facing.
Variables starting with "sys" are not being referenced correctly in Dify v0.8.2 when self-hosted because system variables are pre-set system-level parameters that need to be globally read by other nodes. If they are not being referenced correctly, it could be due to a misconfiguration or a missing feature that needs to be enabled.
For example, the sys.files
variable requires the image upload function to be enabled in the 'Features' section in the upper right corner of the application orchestration page. Ensure that all necessary features are enabled and correctly configured.
Additionally, ensure that the environment variables are correctly set up in your self-hosted environment. The create_flask_app_with_configs
function in api/app.py
populates configurations into system environment variables. If these configurations are not correctly loaded, it could lead to issues with referencing system variables.
def create_flask_app_with_configs() -> Flask:
"""
create a raw flask app
with configs loaded from .env file
"""
dify_app = DifyApp(__name__)
dify_app.config.from_mapping(dify_config.model_dump())
# populate configs into system environment variables
for key, value in dify_app.config.items():
if isinstance(value, str):
os.environ[key] = value
elif isinstance(value, int | float | bool):
os.environ[key] = str(value)
elif value is None:
os.environ[key] = ""
return dify_app
Ensure that the system variables are correctly set up and that any required features are enabled [1][2].
To continue talking to Dosu, mention @dosu.
pr #8422
Self Checks
Dify version
v0.8.2
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
✔️ Expected Behavior
output correctly value
❌ Actual Behavior
output null