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
49.14k stars 7.04k forks source link

Internal Server Error when custom disclaimer longer than 64 characters #9772

Open Copilotes opened 3 hours ago

Copilotes commented 3 hours ago

Self Checks

Dify version

0.10.1

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

When setting a custom disclaimer for an application, an error will be reported if the length exceeds 64 characters (chinese character, maybe 128 in english)

✔️ Expected Behavior

Either limit the input to 64 characters in length on the frontend, or lift the limit on the backend to allow for longer disclaimer entries

❌ Actual Behavior

Error raise: Internal Server Error

dosubot[bot] commented 3 hours ago

The character limit for custom disclaimers in the Dify backend is set to 255 characters, as defined in the migration script api/migrations/versions/5fda94355fce_custom_disclaimer.py [1]. If you're encountering an error when the disclaimer exceeds 64 characters, it might be due to a discrepancy between the frontend validation and the backend limit.

To resolve this, you could check if there's any frontend validation restricting the input to 64 characters and adjust it to match the backend limit of 255 characters. Alternatively, if the backend is incorrectly enforcing a 64-character limit, you might need to investigate further into the backend code to ensure it aligns with the defined 255-character limit.

To continue talking to Dosu, mention @dosu.