Shopify / toxiproxy

:alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing
https://github.com/shopify/toxiproxy
MIT License
10.85k stars 452 forks source link

Unable to update toxic using prebuilt windows server #553

Open mikeucfl opened 10 months ago

mikeucfl commented 10 months ago

I'm fairly new to Toxiproxy and was going through some examples to understand how to utilize it. I downloaded the prebuilt binaries for 2.7.0 and ran into an issue when trying to update a toxic.

$ toxiproxy-cli-windows-amd64.exe -v toxiproxy-cli version 2.7.0

$ toxiproxy-cli-windows-amd64.exe create --listen 127.0.0.1:9100 --upstream 127.0.0.1:9000 myProxy Created new proxy myProxy

$ toxiproxy-cli-windows-amd64.exe toxic add -t latency -n myToxic -a latency=100 -a jitter=50 myProxy Added downstream latency toxic 'myToxic' on proxy 'myProxy'

$ toxiproxy-cli-windows-amd64.exe toxic update -n myToxic -a jitter=25 myProxy Failed to update toxic: failed to update toxic 'myToxic' of proxy 'myProxy': json: cannot unmarshal number into Go value of type toxiproxy.ApiError

I went to grab the source and debug what was going on, and it seems like the issue originates with the server. If I run the server from source I'm able to update the value with no issues (using commit 7abcb6f9cf95d2fb27244435e22b16bda14ab5c3)

$ go run cli.go create --listen 127.0.0.1:9100 --upstream 127.0.0.1:9000 myProxy Created new proxy myProxy

$ go run cli.go toxic add -t latency -n myToxic -a latency=100 -a jitter=50 myProxy Added downstream latency toxic 'myToxic' on proxy 'myProxy'

$ go run cli.go toxic update -n myToxic -a jitter=25 myProxy Updated toxic 'myToxic' on proxy 'myProxy'

I took a look at wireshark to compare the responses (left is prebuilt server using prebuilt cli, and right is running server from source with prebuilt cli) image

Is there something I'm doing wrong with the prebuilt version, or is this some sort of bug? Thanks!