Closed briandealwis closed 4 years ago
Rebuilt and pushed fixed duct-tape images.
I just tested this out using the Cloud Code Go guestbook samples app (in GoLand - although issues do not appear to be IDE related): https://github.com/GoogleCloudPlatform/cloud-code-samples/tree/master/golang/go-guestbook
And am getting all sorts of errors:
Note: when running in normal mode (skaffold dev
) the app starts up fine. Everything below is for debug
mode.
1) Running the sample as is, the app fails to start up:
hitting the frontend endpoint:
querying backend failed: Get "http://go-guestbook-backend:8080/messages": dial tcp 10.24.9.13:8080: connect: connection refused
From the skaffold logs:
[go-guestbook-frontend-7b59bc45d4-nxhwt frontend] 2020-04-26T19:44:28Z warning layer=debugger reading debug_info: could not find abstract origin (0x1a9a9d) of inlined call at 0x173006
[go-guestbook-frontend-7b59bc45d4-nxhwt frontend] 2020-04-26T19:44:28Z debug layer=debugger continuing
[go-guestbook-frontend-7b59bc45d4-nxhwt frontend] 2020/04/26 19:44:28 frontend server listening on port 8080
[go-guestbook-frontend-7b59bc45d4-nxhwt frontend] 2020-04-26T19:44:29Z debug layer=debugger halting
[go-guestbook-frontend-7b59bc45d4-nxhwt frontend] 2020-04-26T19:44:29Z error layer=rpc writing response:write tcp 127.0.0.1:3000->127.0.0.1:55662: use of closed network connection
Ok maybe the app is misconfigured? The entrypoint is as follows:
ENTRYPOINT ["dlv", "exec", "/app/backend", "--continue", "--accept-multiclient", "--api-version=2", "--headless", "--listen=:3000", "--log"]
Instead, I try just ENTRYPOINT ["/app/backend"]
(same for the frontend) :
2) The app now starts up but no debug events.
I notice that the Dockerfile doesn't have an Go specific env vars that the debug heuristics can recognize, so I add the following to both frontend and backend Dockerfiles:
ENV GOTRACEBACK=single
3) Debuggers attach now, but I get the following errors in a loop. Port forwarding fails to stabilize:
Port forwarding pod/go-guestbook-frontend-66b75595cb-lnhkj in namespace default, remote port 8080 -> address 127.0.0.1 port 8081
Port forwarding pod/go-guestbook-frontend-66b75595cb-lnhkj in namespace default, remote port 3000 -> address 127.0.0.1 port 3000
Port forwarding pod/go-guestbook-frontend-66b75595cb-lnhkj in namespace default, remote port 56268 -> address 127.0.0.1 port 56268
failed to port forward pod-go-guestbook-frontend-66b75595cb-lnhkj-default-56268, port 56268 is taken, retrying...
failed to port forward pod-go-guestbook-frontend-66b75595cb-lnhkj-default-3000, port 3000 is taken, retrying...
failed to port forward pod-go-guestbook-frontend-66b75595cb-lnhkj-default-8080, port 8081 is taken, retrying...
[go-guestbook-frontend-66b75595cb-lnhkj frontend] API server listening at: 127.0.0.1:56268
[go-guestbook-frontend-66b75595cb-lnhkj frontend] Version of Delve is too old for this version of Go (maximum supported version 1.13, suppress this error with --check-go-version=false)
Summary:
Skaffold debug seems pretty broken right now fo the Go sample apps (the guestbook one at least).
I'm not sure if these issues are related to this dlv change. But I'm hoping you can help me work through these issues and try and reproduce.
I suspect its a combination of the Samples being poorly configured and Skaffold/container-debug-support issues.
Sorry I didn't see your update @etanshaul :-( This should now be fixed with #38.
33 upgraded Delve to v1.14. Delve 1.14 introduces a new behaviour to enforce that when listening for connections are from the same user (https://github.com/go-delve/delve/pull/1764). This behaviour is enabled by default and breaks current uses of
skaffold debug
as the connections proxied via kubectl are local but from a different user.Steps to reproduce:
Use
skaffold debug
on Skaffold's Getting Started example. The container will seem to start with no issue, but attempting to connect will fail:Log output:
When enabling Delve's logging on the server (in the container):
Additional Information:
We can work around this by having Delve listen on
0.0.0.0
rather than localhost, but as this breaks installations in the field, we need to revert to Delve 1.3.1 first.