dify icon indicating copy to clipboard operation
dify copied to clipboard

Internal Server Error when custom disclaimer longer than 64 characters

Open Copilotes opened this issue 1 year ago • 1 comments

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

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

Copilotes avatar Oct 24 '24 07:10 Copilotes

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.

dosubot[bot] avatar Oct 24 '24 07:10 dosubot[bot]

We extended this limitation to 512 characters in #10287

laipz8200 avatar Nov 05 '24 06:11 laipz8200