gops icon indicating copy to clipboard operation
gops copied to clipboard

couldn't get port by PID

Open weichangdong opened this issue 7 years ago • 5 comments

gops memstats 27281 couldn't get port by PID: dial tcp 127.0.0.1:0: connect: can't assign requested address when i use addr,long time no response. i use go version go1.10 darwin/amd64. i remember it works before,perhaps i updated the go version.

weichangdong avatar Mar 21 '18 06:03 weichangdong

I got the same issue.

couldn't get port by PID: dial tcp 127.0.0.1:0: connect: connection refused

ghost avatar Mar 31 '18 01:03 ghost

Me too $ gops pprof-cpu 6433 Profiling CPU now, will take 30 secs... couldn't get port by PID: dial tcp 127.0.0.1:0: connect: can't assign requested address

ashishchandra2017 avatar Apr 09 '18 10:04 ashishchandra2017

me too!!!

But no one seems to care!!!

19920716 avatar Jul 07 '18 05:07 19920716

me too!!!

But no one seems to care!!!

1、golang version 2、quote "github.com/google/gops/agent" in your code; 3、add code in you main func, such as: if err := agent.Listen(agent.Options{}); err != nil { log.Fatal(err) } 4、go build your code 5、run your binary program 6、gops option according to gops doc

Crazy-Kitty avatar Oct 26 '18 08:10 Crazy-Kitty

to use gops, you MUST set env of GOPS_CONFIG_DIR, otherwise, it use $HOME/.config for linux system, in case the dir does not exist, gops will mkdir, but for which you might have no permission to mkdir

func PIDFile(pid int) (string, error) { gopsdir, err := ConfigDir() if err != nil { return "", err } return fmt.Sprintf("%s/%d", gopsdir, pid), nil }

westwin avatar Nov 27 '19 09:11 westwin