An error occurred while setting the variable key #14939

Closed
opened 2026-02-21 19:19:26 -05:00 by yindo · 3 comments
Owner

Originally created by @HyaCiovo on GitHub (Jun 26, 2025).

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

Cloud or Self Hosted

Cloud

Steps to reproduce

When I have already set a variable as 'text', I cannot proceed to input 'text1' for the next variable. Additionally, if I paste 'text1' into the field, I am unable to modify the variable name by pressing the backspace key.

✔️ Expected Behavior

Could set variable normally

Actual Behavior

Image

Image

Originally created by @HyaCiovo on GitHub (Jun 26, 2025). ### 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.5.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce When I have already set a variable as 'text', I cannot proceed to input 'text1' for the next variable. Additionally, if I paste 'text1' into the field, I am unable to modify the variable name by pressing the backspace key. ### ✔️ Expected Behavior Could set variable normally ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/fa054390-e98a-49b2-b339-5cf01aa32670) ![Image](https://github.com/user-attachments/assets/07c42dc4-eb82-42ad-962f-2d4a6739ee18)
yindo added the 🐞 bugstaleperformance labels 2026-02-21 19:19:26 -05:00
yindo closed this issue 2026-02-21 19:19:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 26, 2025):

This issue is caused by the variable key validation logic in the Dify UI. When you try to set a variable name that already exists (like 'text' and then 'text1' if 'text1' is already present or conflicts), the system blocks the change and shows an error. Because the input field is a controlled React component, if validation fails, the field stays at its last valid value and can appear "stuck" or uneditable—especially after pasting or entering a duplicate name. This is a known side effect of how the input state is managed, not a problem with keyboard events like backspace or paste themselves. The same pattern applies to both group and non-group variable assigner nodes in the workflow UI.

A recent PR updated this validation logic and error handling, which is directly related to what you're seeing (details here). For now, you can try clearing the field completely or editing a different variable before returning, but the underlying UX issue is due to the current validation approach. Future improvements may address this, so it's worth keeping an eye on release notes for updates.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 26, 2025): <!-- Answer --> This issue is caused by the variable key validation logic in the Dify UI. When you try to set a variable name that already exists (like 'text' and then 'text1' if 'text1' is already present or conflicts), the system blocks the change and shows an error. Because the input field is a controlled React component, if validation fails, the field stays at its last valid value and can appear "stuck" or uneditable—especially after pasting or entering a duplicate name. This is a known side effect of how the input state is managed, not a problem with keyboard events like backspace or paste themselves. The same pattern applies to both group and non-group variable assigner nodes in the workflow UI. A recent PR updated this validation logic and error handling, which is directly related to what you're seeing ([details here](https://github.com/langgenius/dify/pull/21057)). For now, you can try clearing the field completely or editing a different variable before returning, but the underlying UX issue is due to the current validation approach. Future improvements may address this, so it's worth keeping an eye on release notes for updates. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/94facd41-6a31-485b-8143-4b77aee709c0?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/94facd41-6a31-485b-8143-4b77aee709c0?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/94facd41-6a31-485b-8143-4b77aee709c0?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/94facd41-6a31-485b-8143-4b77aee709c0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/94facd41-6a31-485b-8143-4b77aee709c0?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/94facd41-6a31-485b-8143-4b77aee709c0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/94facd41-6a31-485b-8143-4b77aee709c0?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/21597)
Author
Owner

@alterxyz commented on GitHub (Jun 27, 2025):

This is a bug that should be fixed.

Additionally😂:

Image

@alterxyz commented on GitHub (Jun 27, 2025): This is a bug that should be fixed. Additionally😂: ![Image](https://github.com/user-attachments/assets/ae0dc043-ffc6-4f8e-8c95-ff672b68d6ef)
Author
Owner

@dosubot[bot] commented on GitHub (Aug 28, 2025):

Hi, @HyaCiovo. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a bug in Dify 1.5.0 Cloud where the input field for a new variable "text1" becomes unresponsive after setting a variable "text."
  • The root cause was identified as the variable key validation logic in the React UI blocking duplicate or conflicting variable names.
  • A recent PR updated this validation logic to address the issue.
  • A workaround exists by clearing the field or editing another variable first.
  • Future UX improvements are planned to fully resolve this bug.

Next Steps:

  • Please let me know if this issue is still relevant in the latest version of Dify by commenting here.
  • If I don’t hear back within 15 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 28, 2025): Hi, @HyaCiovo. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a bug in Dify 1.5.0 Cloud where the input field for a new variable "text1" becomes unresponsive after setting a variable "text." - The root cause was identified as the variable key validation logic in the React UI blocking duplicate or conflicting variable names. - A recent PR updated this validation logic to address the issue. - A workaround exists by clearing the field or editing another variable first. - Future UX improvements are planned to fully resolve this bug. **Next Steps:** - Please let me know if this issue is still relevant in the latest version of Dify by commenting here. - If I don’t hear back within 15 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14939