dify icon indicating copy to clipboard operation
dify copied to clipboard

1.0.0 workflow Agent node run error:1 validation error for LogMessage

Open wl102 opened this issue 10 months 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

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

log

[AgentLogEvent]

[NodeRunFailedEvent] Node ID: 1737517673139 Node Title: Agent-情报分析 Type: agent Error: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for LogMessage\nmetadata.start_at.[key]\n Input should be 'started_at', 'finished_at', 'elapsed_time', 'total_price', 'total_tokens', 'provider' or 'currency' [type=enum, input_value='start_at', input_type=str]\n For further information visit https://errors.pydantic.dev/2.8/v/enum"} Inputs: {'instruction': '你是一位中文网络安全分析专家,负责查询安全情报信息,你可以使用工具获取外部知识,保证答案的真实、准确性。\n\n\n## 指令\n1. 根据给定的相关信息,查询安全情报信息,如果文本存在多个相关信息,则多次调用工具。如果不存在相关信息跳过此步骤。\n2. 如果查询结果为空,则返回 "没有查询到相关信息"。\n3. 结果使用中文回答,不要输出任何无关的信息。', 'maximum_iterations': '2', 'model': {'completion_params': {'temperature': 0.3}, 'mode': 'chat', 'model': 'SAI3-72B', 'model_type': 'llm', 'provider': 'wangzhen/xiaosai/xiaosai', 'type': 'model-selector'}, 'query': '查询[]、[]、[]、[]的情报信息。', 'tools': [{'enabled': True, 'extra': {'description': ''}, 'parameters': {'ip': ''}, 'provider_name': 'wangzhen/virustotal/virustotal', 'tool_name': 'get_ip_report', 'settings': {}}, {'enabled': True, 'extra': {'description': ''}, 'parameters': {'domain': ''}, 'provider_name': 'wangzhen/virustotal/virustotal', 'tool_name': 'get_domain_report', 'settings': {}}, {'enabled': True, 'extra': {'description': ''}, 'parameters': {'hash': ''}, 'provider_name': 'wangzhen/virustotal/virustotal', 'tool_name': 'get_filehash_report', 'settings': {}}, {'enabled': True, 'extra': {'description': ''}, 'parameters': {'url': ''}, 'provider_name': 'wangzhen/virustotal/virustotal', 'tool_name': 'get_url_report', 'settings': {}}]} Process Data: Outputs:

[GraphRunFailedEvent] reason: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for LogMessage\nmetadata.start_at.[key]\n Input should be 'started_at', 'finished_at', 'elapsed_time', 'total_price', 'total_tokens', 'provider' or 'currency' [type=enum, input_value='start_at', input_type=str]\n For further information visit https://errors.pydantic.dev/2.8/v/enum"}

screenshots

Image

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

wl102 avatar Mar 04 '25 09:03 wl102

The error you're encountering is related to a ValidationError in the LogMessage metadata. Specifically, the field start_at is not recognized as a valid key. The valid keys for LogMessage metadata are started_at, finished_at, elapsed_time, total_price, total_tokens, provider, or currency [1].

To resolve this issue, you should update the metadata field from start_at to started_at in your code. This should align with the expected fields and resolve the validation error.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

dosubot[bot] avatar Mar 04 '25 09:03 dosubot[bot]

I found that it works well with agent: v.0.0.9

Image

wl102 avatar Mar 18 '25 01:03 wl102