Sporadic error:  http: proxy error: dial tcp 127.0.0.1:3001: connection refused

I am getting this error sometimes. I have to quit and restart gin (sometimes multiple times). Any idea on how to debug this? I guess in some condition gin thinks there is a backend process running but it isn't?