Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行后测试响应失败 #438

Open
myj2369 opened this issue Jan 3, 2025 · 3 comments
Open

运行后测试响应失败 #438

myj2369 opened this issue Jan 3, 2025 · 3 comments

Comments

@myj2369
Copy link

myj2369 commented Jan 3, 2025

(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/snare# curl -X POST -H "Content-Type: application/json" -d '{"method": "GET", "path": "/test", "headers": {}, "body": ""}' http://63.141.255.250:8090/event
500 Internal Server Error

Server got itself in trouble(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/snare# curl http://63.141.255.250:8090/version
{"version": "0.6.0"}(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/snare# curl -X POST -H "Content-Type: application/json" -d '{"method": "GET", "path": "/test", "headers": {}, "body": ""}' http://63.141.255.250:8090/event
500 Internal Server Error

Server got itself in trouble(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/snare# 我通过docker compose执行的tanner容器,是否是我的测试示例存在问题?

@myj2369
Copy link
Author

myj2369 commented Jan 3, 2025

我检查了radis运行也是正常的,当json格式不正确时tanner也能返回错误信息。(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/test# curl -X POST -H "Content-Type: application/json" -d @payload.json http://63.141.255.250:8090/event
{"version": "0.6.0", "response": {"message": "JSONDecodeError"}}(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/test#但当json格式正确时返回就是500网络服务错误,但是在容器中也没有产生任何输出

@myj2369
Copy link
Author

myj2369 commented Jan 3, 2025

Server got itself in trouble(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/test# curl http://63.141.255.250:8090/version
{"version": "0.6.0"}(base) root@iZbp1gdjkjajbojm7l9ehyZ:/home/myj/test#
我留意到当前已更新到0.7版本,但是更新中只是增加了响应的机制。所以我认为并不是我0.6版本的问题

@myj2369
Copy link
Author

myj2369 commented Jan 3, 2025

检查发现,是由于我的json信息没有存储uid 查看日志发现为Tanner 在尝试将数据写入 Redis 时,遇到了 aioredis.exceptions.DataError: Invalid input of type: 'NoneType'。

这表明 Tanner 在处理请求时,某些字段(例如 uuid)为空或无效 我修改了payload.json内容为====
{
"method": "GET",
"path": "/test",
"headers": {},
"body": "",
"uuid": "5555"
}
使用其他主机在json文件目录下执行curl -X POST -H "Content-Type: application/json" -d @payload.json http://63.141.255.250:8090/event成功得到了响应

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant