Skip to content

Bug: Validation error and "Tool already exists" conflict when publishing tool with Array[File] default value #30030

@MrLittleB

Description

@MrLittleB

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create a new Workflow or Chatflow.
  2. In the "Start" node, add a variable of type Array[File].
  3. Set a default value for this variable (e.g., upload a file).
  4. Click "Publish" and "Publish as Tool".
  5. Click "Publish" again
  6. Observe the first error: Pydantic validation error (expecting int/str/float/bool but got a dict/base64Url).
  7. Attempt to click "Publish" again.
  8. Observe the second error: "Tool with name [name] or app_id [id] already exists".

✔️ Expected Behavior

The system should correctly

❌ Actual Behavior

  1. Pydantic throws a validation error because it fails to parse the file object (dict with base64Url/id) as a basic data type.
  2. After the initial failure, the tool name/ID becomes "locked" in the database.
  3. Any further attempts to publish result in an "already exists" error, making the tool name unusable.

Screenshots:

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions