Orion 上下文代理 - 错误输入 JSON 相当长的属性值出现解析错误
Orion context broker - Bad Input JSON Parse Error on quite long attribute value
属性值或元数据值的长度是否有任何已知限制?
在属性值处设置一个很长的字符串(>30-40k 个字符)时,我收到
WARNING@13:45:37 jsonRequest.cpp[225]: Bad Input (JSON Parse Error)
DEBUG@13:45:37 UpdateContextResponse.cpp[60]: destroyed
DEBUG@13:45:37 UpdateContextResponse.cpp[74]: destroyed
WARNING@13:45:37 jsonRequest.cpp[233]: Bad Input (JSON Parse Error: <unspecified file>(1): expected end of input)
DEBUG@13:45:37 RestService.cpp[126]: result: '{
"errorCode" : {
"code" : "400",
"reasonPhrase" : "Bad Request",
"details" : "JSON Parse Error"
}
}
版本 0.25.0(git 版本:a8cf800d4e9fdd7b4293a886490c40309a5bb58c)
使用此 post 命令:
curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @entity1.json -v
和实体json
entity1.json:http://pastebin.com/Esraq80S
观察到的行为:
在清理数据库(删除所有实体)并重新启动服务时,post 第一次成功,但在接下来的失败中失败。
非常感谢!!
根据用户报告(参见问题 post 的评论线程),升级到 Orion 1.1.0 可以解决问题。
0.25.0 中的问题原因仍然未知。可以仔细检查 https://github.com/telefonicaid/fiware-orion/releases 从 0.25.0 到 1.1.0 的变更日志以找到修复,但可能不值得花时间。
属性值或元数据值的长度是否有任何已知限制?
在属性值处设置一个很长的字符串(>30-40k 个字符)时,我收到
WARNING@13:45:37 jsonRequest.cpp[225]: Bad Input (JSON Parse Error)
DEBUG@13:45:37 UpdateContextResponse.cpp[60]: destroyed
DEBUG@13:45:37 UpdateContextResponse.cpp[74]: destroyed
WARNING@13:45:37 jsonRequest.cpp[233]: Bad Input (JSON Parse Error: <unspecified file>(1): expected end of input)
DEBUG@13:45:37 RestService.cpp[126]: result: '{
"errorCode" : {
"code" : "400",
"reasonPhrase" : "Bad Request",
"details" : "JSON Parse Error"
}
}
版本 0.25.0(git 版本:a8cf800d4e9fdd7b4293a886490c40309a5bb58c)
使用此 post 命令:
curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @entity1.json -v
和实体json entity1.json:http://pastebin.com/Esraq80S
观察到的行为: 在清理数据库(删除所有实体)并重新启动服务时,post 第一次成功,但在接下来的失败中失败。
非常感谢!!
根据用户报告(参见问题 post 的评论线程),升级到 Orion 1.1.0 可以解决问题。
0.25.0 中的问题原因仍然未知。可以仔细检查 https://github.com/telefonicaid/fiware-orion/releases 从 0.25.0 到 1.1.0 的变更日志以找到修复,但可能不值得花时间。