Repository navigation
Closed
Description
Running on 2.1.1 with a slicer toxic:
~/P/shopify (master|✚1…) $ /Users/kir/Downloads/toxiproxy-server-darwin-amd64
INFO[0000] API HTTP server starting host=localhost port=8474 version=2.1.1
INFO[0053] Started proxy name=dumb proxy=127.0.0.1:8182 upstream=localhost:8181
INFO[0177] Accepted client client=127.0.0.1:62635 name=dumb proxy=127.0.0.1:8182 upstream=localhost:8181
WARN[0177] Source terminated bytes=655582 err=read tcp 127.0.0.1:8182->127.0.0.1:62635: use of closed network connection name=dumb
INFO[0179] Accepted client client=127.0.0.1:62671 name=dumb proxy=127.0.0.1:8182 upstream=localhost:8181
WARN[0179] Source terminated bytes=655582 err=read tcp 127.0.0.1:8182->127.0.0.1:62671: use of closed network connection name=dumb
INFO[0184] Accepted client client=127.0.0.1:62739 name=dumb proxy=127.0.0.1:8182 upstream=localhost:8181
WARN[0184] Source terminated bytes=655582 err=read tcp 127.0.0.1:8182->127.0.0.1:62739: use of closed network connection name=dumb
INFO[0238] Accepted client client=127.0.0.1:63609 name=dumb proxy=127.0.0.1:8182 upstream=localhost:8181
WARN[0238] Source terminated bytes=655582 err=read tcp 127.0.0.1:8182->127.0.0.1:63609: use of closed network connection name=dumb
INFO[0271] Accepted client client=127.0.0.1:64135 name=dumb proxy=127.0.0.1:8182 upstream=localhost:8181
panic: invalid argument to Intn
goroutine 49 [running]:
panic(0x261fa0, 0xc420162050)
/usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1a1
math/rand.(*Rand).Intn(0xc42008a080, 0x0, 0x2)
/usr/local/Cellar/go/1.7.1/libexec/src/math/rand/rand.go:116 +0xd0
math/rand.Intn(0x0, 0x0)
/usr/local/Cellar/go/1.7.1/libexec/src/math/rand/rand.go:247 +0x37
github.com/Shopify/toxiproxy/toxics.(*SlicerToxic).chunk(0xc4200eeb40, 0x0, 0x97, 0x1, 0x0, 0x0)
/Users/jpittis/Code/go/src/github.com/Shopify/toxiproxy/toxics/slicer.go:42 +0xcc
github.com/Shopify/toxiproxy/toxics.(*SlicerToxic).Pipe(0xc4200eeb40, 0xc420180640)
/Users/jpittis/Code/go/src/github.com/Shopify/toxiproxy/toxics/slicer.go:60 +0x139
github.com/Shopify/toxiproxy/toxics.(*ToxicStub).Run(0xc420180640, 0xc420074360)
/Users/jpittis/Code/go/src/github.com/Shopify/toxiproxy/toxics/toxic.go:82 +0xb5
created by github.com/Shopify/toxiproxy.(*ToxicLink).Start
/Users/jpittis/Code/go/src/github.com/Shopify/toxiproxy/link.go:73 +0x143
cc @jpittis
Reacted by Robbie Clarken, Damir Murat and m7onov
Metadata
Metadata
Assignees
Labels
No labels
Activity
xthexder commentedon May 17, 2017
It looks like this is due to
size_variationnot being set, and defaulting to 0.A variation of 0 should definitely be supported, so that will need to be fixed. A workaround for now would be to set the variation to >= 1.
kirs commentedon May 18, 2017
Thanks for looking into it. I didn't set
size_variationwhen I added the toxic because I assumed it would use a default value. The help didn't mention that value forsize_variationis required.adambair commentedon Dec 12, 2019
Still an issue, ran into this today on the latest version published to dockerhub.
areveny commentedon Jan 19, 2022
Looking at this.