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

go trace does not work with HTTPS #42767

Closed
doyyan opened this issue Nov 22, 2020 · 2 comments
Closed

go trace does not work with HTTPS #42767

doyyan opened this issue Nov 22, 2020 · 2 comments

Comments

@doyyan
Copy link

doyyan commented Nov 22, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15.2 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\sivarrk\AppData\Local\go-build
set GOENV=C:\Users\sivarrk\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\sivarrk\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\sivarrk\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\sivarrk\AppData\Local\Temp\go-build311372794=/tmp/go-build -gno-record-gcc-switches

What did you do?

I am trying out 'go trace' for the first time on a server endpoint after setting up my own Mux and the endpoints

mux.HandleFunc("/debug/pprof/", http.HandlerFunc(pprof.Index))
mux.HandleFunc("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
mux.HandleFunc("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
mux.HandleFunc("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
mux.HandleFunc("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))

Then I startup Debugging in VSCode and then I start a process hitting the server in JMeter and finally do

curl -i -k -v https://localhost:443/debug/pprof/trace?seconds=10 > trace.out

Now, when I try

$ go tool trace trace.out 2020/11/21 09:06:56 Parsing trace... failed to parse trace: not a trace file

Why, an anyone suggest how to do the trace or is it only available with the DefaultServerMux?

go tool pprof is perfectly fine and it produces all the outputs though...

What did you expect to see?

The trace file to be opened by go and read and Chrome browser opened for viewing with the trace

What did you see instead?

Error as seen in the trace

@seankhliao
Copy link
Member

have you looked at the trace.out you produced? you've used curl -i which includes extra output not expected by the tooling

@doyyan
Copy link
Author

doyyan commented Nov 22, 2020

have you looked at the trace.out you produced? you've used curl -i which includes extra output not expected by the tooling

Fantastic, that was it, thanks for spotting this and letting me know, it works now!!

@doyyan doyyan closed this as completed Nov 22, 2020
@golang golang locked and limited conversation to collaborators Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants