Validation error in HttpRequestNodeData in production
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
last
Cloud or Self Hosted
Cloud
Steps to reproduce
- Create a workflow that uses the HttpRequestNodeData module.
- Configure the HTTP request body with data in string format.
- Run the workflow in the test environment (it works normally).
- Run the same workflow in the production environment.
- Observe the error generated.
{
"nome": "{{#17246...2038442.guests#}}"
}
✔️ Expected Behavior
The workflow should work correctly in production, just as it does in the test environment, without generating validation errors.
❌ Actual Behavior
In production, the workflow generates the following validation error:
1 validation error for HttpRequestNodeData
body.data 'str' instances are not allowed as a Sequence value [type=sequence_str, input_value='{\n "nome": "{{#17246...2038442.guests#}}"\n }', input_type=str]
Hello @nfaganelly! I'm here to help you with any bugs, questions, or contributions you may have. Let's tackle this issue together!
The validation error you're encountering in the production environment is due to the body.data field being expected as a Sequence[BodyData], but it seems to be receiving a string instead. In the Dify platform, the body.data field should be structured according to the type of HTTP request body you are using.
Here's how you can structure the body.data field correctly:
-
For
BodyType.formDataandBodyType.xWwwFormUrlencoded:body.datashould be an array of objects, each withid,type,key, andvaluefields.
-
For
BodyType.rawTextandBodyType.json:body.datashould be an array with at least one object, where the first object hasid,type,key(empty), andvalue(the raw text or JSON string).
-
For
BodyType.binary:body.datashould be an array with at least one object, where the first object hasid,type, andfilefields.
Ensure that the body.data field in your production environment is structured as a sequence of objects rather than a single string. This should resolve the validation error you're experiencing [1].
To continue talking to Dosu, mention @dosu.
No requests have been changed, I have been using it normally for 2 weeks, after the v0.10.0 update it started generating this error and only in production, in testing it runs normally.
I'm going through this same problem. I deleted it and redid it, I think it was a cache problem.
After the update, the error appeared, in the other tools I deleted it and did it again and kept updating until I got it right, see the last one the problem continues so I must delete the tool and do it again while updating... that's why I think it could be a chache something like that
See, I deleted the json provided and saved the tool. I went back and inserted the json and the error in the chatbot disappeared and the flow returned normally.
Sorry, we encountered a small issue with historical data migration.
- For users who are using Docker for self-deployment, you can wait for the next version or delete and rebuild the node.
- For users who are using source code deployment, you can pull the latest code from the main branch, which should work.
- For Cloud users. Please try again.
If the above responses solve your issue, please let me know (along with the deployment method you are using).
A workflow that was working stopped working for me too.
Now I'm getting this error when passing a number parameter in the body of the JSON request:
A workflow that was working stopped working for me too.
Now I'm getting this error when passing a number parameter in the body of the JSON request:
I opened a new issue about this problem here:
https://github.com/langgenius/dify/issues/9590
Hi @IvanHenrique I'm facing the same issue as you are.
"tool invoke error: 1 validation error for HttpRequestNodeData\nbody.data\n 'str' instances are not allowed as a Sequence value [type=sequence_str, input_value='', input_type=str]"}
Did find any solution for that?
Thank you
I have a same issue. I deployed them in kubernetes, and version is 0.10.0.
Could you share a solution?
Here, I duplicated and deleted the old one, then it worked again.
