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

network port occupation using the service mode failed #200

Open
wangjiajun-sz opened this issue Aug 11, 2022 · 3 comments
Open

network port occupation using the service mode failed #200

wangjiajun-sz opened this issue Aug 11, 2022 · 3 comments

Comments

@wangjiajun-sz
Copy link

chaosd version:
Chaosd Version: version.Info{GitVersion:"v1.2.0", GitCommit:"38e871fbcc62ab74dda45f65e13b35aa3b6ee8a8", BuildDate:"2022-04-28T06:18:30Z", GoVersion:"go1.16.2", Compiler:"gc", Platform:"linux/amd64"}

curl -X POST 172.16.112.130:31767/api/attack/network -H "Content-Type:application/json" -d '{"action":"port", "port": 8080}'

{"error":true,"message":"error.api.internal_server_error: json: cannot unmarshal number into Go struct field NetworkCommand.port of type string","code":"error.api.internal_server_error","full_text":"error.api.internal_server_error: json: cannot unmarshal number into Go struct field NetworkCommand.port of type string\n at github.com/chaos-mesh/chaosd/pkg/server/httpserver.(*httpServer).createNetworkAttack()\n\t/__w/chaosd/chaosd/pkg/server/httpserver/server.go:159\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161\n at github.com/chaos-mesh/chaosd/pkg/server/utils.MWHandleErrors.func1()\n\t/__w/chaosd/chaosd/pkg/server/utils/error.go:47\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161\n at github.com/gin-gonic/gin.RecoveryWithWriter.func1()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:83\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161\n at github.com/gin-gonic/gin.LoggerWithConfig.func1()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241\n at github.com/gin-gonic/gin.(*Context).Next()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161\n at github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:409\n at github.com/gin-gonic/gin.(*Engine).ServeHTTP()\n\t/github/home/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:367\n at net/http.serverHandler.ServeHTTP()\n\t/__t/go/1.16.2/x64/src/net/http/server.go:2887\n at net/http.(*conn).serve()\n\t/__t/go/1.16.2/x64/src/net/http/server.go:1952\n at runtime.goexit()\n\t/__t/go/1.16.2/x64/src/runtime/asm_amd64.s:1371"}

@Andrewmatilde
Copy link
Member

Try use string.

@wangjiajun-sz
Copy link
Author

curl -X POST 10.165.32.26:31767/api/attack/network -H "Content-Type:application/json" -d '{"action":"occupied", "port": "8080"}'
这个命令可以,和官网的描述有出入。
image

@Andrewmatilde
Copy link
Member

Thanks for your feadback. That is a doc problem. I will fix it.

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

2 participants