asciimoo / wuzz

Interactive cli tool for HTTP inspection
GNU Affero General Public License v3.0
10.57k stars 412 forks source link

panic: invalid arguments #88

Open hackeryarn opened 7 years ago

hackeryarn commented 7 years ago

I am getting the below error when trying to run wuzz with no arguments. I am using ubuntu bash on windows to run this.

2017/03/12 21:15:06 invalid argument
panic: invalid argument

goroutine 1 [running]:
panic(0x6fed00, 0xc42000d3e0)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
log.Panicln(0xc420051e60, 0x1, 0x1)
        /usr/local/go/src/log/log.go:334 +0xc9
main.main()
        /home/achernyak/go/src/github.com/asciimoo/wuzz/wuzz.go:1594 +0xf8c
Benaiah commented 7 years ago

@achernyak what's your Go version?

hackeryarn commented 7 years ago

I was originally on 1.7.4 then I tried upgrading to 1.8.0 and still the same exact error.

asciimoo commented 7 years ago

@achernyak what is your operating system/terminal? Seems gocui cannot start in 256 color mode.

hackeryarn commented 7 years ago

@asciimoo I am on windows 10 running Bash on Ubuntu on Windows. It seems that they do have 256 color support and my terminal is identified as xterm-256color by default. I do believe this is a platform specific issue since it works everywhere else. So might be worth just putting in a note about support.

asciimoo commented 7 years ago

@achernyak could you confirm that fa4c1e8 solves the problem?

hackeryarn commented 7 years ago

Thanks for the really quick work around on this. However, it looks like there is still an error further down the code. The error moved now.

panic: invalid argument

goroutine 1 [running]:
log.Panicln(0xc420055ec0, 0x1, 0x1)
        /usr/local/go/src/log/log.go:336 +0xc0
main.main()
        /home/achernyak/go/src/github.com/asciimoo/wuzz/wuzz.go:1624 +0xe13
asciimoo commented 7 years ago

So the problem isn't the 256 color mode.. strange..

hackeryarn commented 7 years ago

@asciimoo It is still getting thrown in the same expression actually. OutputNormal seems to be throwing too. I was trying to set it to OutputGrayscale which seems to be supported by termbox which is used by gocui but gocui doesn't export it as an options.

asciimoo commented 7 years ago

@achernyak does OutputGrayscale work in your terminal?

hackeryarn commented 7 years ago

@asciimoo no still no luck with it. I was not able to get it to set to OutputGrayscale looks like gocui only supports OutputNormal and Output256.

asciimoo commented 7 years ago

@achernyak you can cast it to the correct type:

g, err = gocui.NewGui(gocui.OutputMode(termbox.OutputGrayscale))
asciimoo commented 7 years ago

@achernyak could you test e6f5674 ?

hackeryarn commented 7 years ago

@asciimoo unfortunates it looks like I am still getting a panic there...

2017/03/14 06:49:12 invalid argument
panic: invalid argument

goroutine 1 [running]:
log.Panicln(0xc420055ec0, 0x1, 0x1)
        /usr/local/go/src/log/log.go:336 +0xc0
main.main()
        /home/achernyak/go/src/github.com/asciimoo/wuzz/wuzz.go:1630 +0x811
asciimoo commented 7 years ago

Hmm, then, the problem isn't the color mode..

dimakogan commented 7 years ago

I ran into a similar issue while working with gocui on WSL Bash on Windows. I think the root cause might be: https://github.com/Microsoft/BashOnWindows/issues/601