dify - ✅(Solved) Fix ToolEntity data validation failed during workflow synchronization [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35694Fetched 2026-04-30 06:45:32
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Timeline (top)
labeled ×2closed ×1commented ×1cross-referenced ×1

Error Message

api-1 | 2026-04-29 16:17:20.435 ERROR [Dummy-482] [delete_tool_parameters_cache_when_sync_draft_workflow.py:41] 30ed488ad5f554c1a2c0ccd4ece7a98d - Failed to delete tool parameters cache for workflow aa8d4ea7-ab70-4438-8f29-0121dcd2dada node 1770287492505 api-1 | Traceback (most recent call last): api-1 | File "/app/api/events/event_handlers/delete_tool_parameters_cache_when_sync_draft_workflow.py", line 22, in handle api-1 | tool_entity = ToolEntity.model_validate(node_data["data"]) api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 716, in model_validate api-1 | return cls.pydantic_validator.validate_python( api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 | pydantic_core._pydantic_core.ValidationError: 1 validation error for ToolEntity api-1 | tool_configurations api-1 | Value error, ensure_ascii must be one of: str, int, float, bool [type=value_error, input_value={'ensure_ascii': {'type':...nstant', 'value': True}}, input_type=dict] api-1 | For further information visit https://errors.pydantic.dev/2.12/v/value_error

Fix Action

Fixed

PR fix notes

PR #35696: fix: ToolEntity data validation failed during workflow synchronization

Description (problem / solution / changelog)

[!IMPORTANT]

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix issue https://github.com/langgenius/dify/issues/35694

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> <!-- If this PR was created by an automated agent, add `From <Tool Name>` as the final line of the description. Example: `From Codex`. -->

Screenshots

BeforeAfter
......

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Changed files

  • api/events/event_handlers/delete_tool_parameters_cache_when_sync_draft_workflow.py (modified, +3/-1)

Code Example

api-1               | 2026-04-29 16:17:20.435 ERROR [Dummy-482] [delete_tool_parameters_cache_when_sync_draft_workflow.py:41] 30ed488ad5f554c1a2c0ccd4ece7a98d - Failed to delete tool parameters cache for workflow aa8d4ea7-ab70-4438-8f29-0121dcd2dada node 1770287492505
api-1               | Traceback (most recent call last):
api-1               |   File "/app/api/events/event_handlers/delete_tool_parameters_cache_when_sync_draft_workflow.py", line 22, in handle
api-1               |     tool_entity = ToolEntity.model_validate(node_data["data"])
api-1               |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1               |   File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 716, in model_validate
api-1               |     return cls.__pydantic_validator__.validate_python(
api-1               |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1               | pydantic_core._pydantic_core.ValidationError: 1 validation error for ToolEntity
api-1               | tool_configurations
api-1               |   Value error, ensure_ascii must be one of: str, int, float, bool [type=value_error, input_value={'ensure_ascii': {'type':...nstant', 'value': True}}, input_type=dict]
api-1               |     For further information visit https://errors.pydantic.dev/2.12/v/value_error
RAW_BUFFERClick to expand / collapse

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

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

update to 1.14.0 When using langgenius/json_process, the following error occurs The data model passed from the frontend is: "tool_configurations": { "ensure_ascii": { "type": "constant", "value": false } }

✔️ Expected Behavior

Data model validation passed.

❌ Actual Behavior

api-1               | 2026-04-29 16:17:20.435 ERROR [Dummy-482] [delete_tool_parameters_cache_when_sync_draft_workflow.py:41] 30ed488ad5f554c1a2c0ccd4ece7a98d - Failed to delete tool parameters cache for workflow aa8d4ea7-ab70-4438-8f29-0121dcd2dada node 1770287492505
api-1               | Traceback (most recent call last):
api-1               |   File "/app/api/events/event_handlers/delete_tool_parameters_cache_when_sync_draft_workflow.py", line 22, in handle
api-1               |     tool_entity = ToolEntity.model_validate(node_data["data"])
api-1               |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1               |   File "/app/api/.venv/lib/python3.12/site-packages/pydantic/main.py", line 716, in model_validate
api-1               |     return cls.__pydantic_validator__.validate_python(
api-1               |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1               | pydantic_core._pydantic_core.ValidationError: 1 validation error for ToolEntity
api-1               | tool_configurations
api-1               |   Value error, ensure_ascii must be one of: str, int, float, bool [type=value_error, input_value={'ensure_ascii': {'type':...nstant', 'value': True}}, input_type=dict]
api-1               |     For further information visit https://errors.pydantic.dev/2.12/v/value_error

extent analysis

TL;DR

The issue is likely due to a validation error in the tool_configurations data model, where the ensure_ascii value is expected to be a primitive type (str, int, float, bool) but is instead an object with type and value keys.

Guidance

  • The error message indicates a validation error in the ToolEntity model, specifically with the ensure_ascii field in the tool_configurations dictionary.
  • The ensure_ascii value is being passed as an object {"type": "constant", "value": false} instead of a primitive boolean value false.
  • To fix this, the frontend should pass the ensure_ascii value as a boolean primitive, e.g., "ensure_ascii": false.
  • Verify that the tool_configurations data model is correctly defined in the ToolEntity model to accept the expected data types.

Example

# Expected data model
tool_configurations = {
    "ensure_ascii": False
}

# Incorrect data model
tool_configurations = {
    "ensure_ascii": {
        "type": "constant",
        "value": False
    }
}

Notes

The issue seems to be related to a change in the tool_configurations data model or the validation rules in the ToolEntity model. Without more information about the model definitions, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: Update the frontend to pass the ensure_ascii value as a boolean primitive, and verify that the tool_configurations data model is correctly defined in the ToolEntity model.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

dify - ✅(Solved) Fix ToolEntity data validation failed during workflow synchronization [1 pull requests, 1 comments, 2 participants]