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

x/tools/gopls: report better error messages for invalid flags #41942

Open
frankful opened this issue Oct 12, 2020 · 5 comments
Open

x/tools/gopls: report better error messages for invalid flags #41942

frankful opened this issue Oct 12, 2020 · 5 comments
Labels
gopls Issues related to the Go language server, gopls. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@frankful
Copy link

gopls version: v0.5.1
gopls flags: -remote=aut -logfile=auto -debug=:0 -rpc.trace

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Please attach the stack trace from the crash.
A window with the error message should have popped up in the lower half of your screen.
Please copy the stack trace and error messages from that window and paste it in this issue.

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

@stamblerre
Copy link
Contributor

stamblerre commented Oct 12, 2020

Edit: I'm sorry I misread the version here.
I'm closing this, as the issue is empty.

@frankful: Please reopen if you can share the stack trace of the gopls crash (found by navigating to View -> Output -> Tasks -> gopls (server)).

@hyangah
Copy link
Contributor

hyangah commented Oct 12, 2020

@frankful Please check the error message printed out in Output -> gopls (server) channel.
It looks like the value you pass for -remote flag is invalid.

@stamblerre Crash when the -remote flag value is invalid, is not very visible (just one line :-). Can we make it more visually standing out?

@stamblerre
Copy link
Contributor

@stamblerre Crash when the -remote flag value is invalid, is not very visible (just one line :-). Can we make it more visually standing out?

Sure, let me transfer this to the gopls issue tracker.

@stamblerre stamblerre transferred this issue from golang/vscode-go Oct 12, 2020
@stamblerre stamblerre changed the title gopls: automated issue report (crash) x/tools/gopls: report better error messages for invalid flags Oct 12, 2020
@stamblerre stamblerre added this to the gopls/v1.0.0 milestone Oct 12, 2020
@stamblerre stamblerre reopened this Oct 12, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Oct 12, 2020
@stamblerre
Copy link
Contributor

@hyangah: I guess the real issue is that the crash is not a panic, so it doesn't get picked up by your logic to extract stack traces. The current error message (gopls: forwarder: connecting to remote: dialing remote: dial tcp: address aut: missing port in address) seems pretty good to me, it's just that it doesn't get automatically attached to the issue.

/cc @findleyr

@stamblerre stamblerre added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Oct 12, 2020
@hyangah
Copy link
Contributor

hyangah commented Oct 12, 2020

@stamblerre I don't worry too much about the issue tracker contents (we already include the gopls flag values in the issue so the setting error was pretty obvious to me :-)

Ideally I want users to figure out this type of setting mistakes by themselves even before sending an issue report to us. I want to know if there is a better way to display this error message. Currently, the error message is buried in stderr and it's not immediately obvious this is significant enough to crash the server. Can it send 'Error' -level logs? Or prefix the message with 'FATAL', or something that sounds serious?

gopls: forwarder: connecting to remote: dialing remote: dial tcp 127.0.0.1:12345: connect: connection refused
[Info  - 6:12:39 PM] Connection to server got closed. Server will restart.
gopls: forwarder: connecting to remote: dialing remote: dial tcp 127.0.0.1:12345: connect: connection refused
[Info  - 6:12:43 PM] Connection to server got closed. Server will restart.
gopls: forwarder: connecting to remote: dialing remote: dial tcp 127.0.0.1:12345: connect: connection refused
[Info  - 6:12:47 PM] Connection to server got closed. Server will restart.
gopls: forwarder: connecting to remote: dialing remote: dial tcp 127.0.0.1:12345: connect: connection refused
[Info  - 6:12:51 PM] Connection to server got closed. Server will restart.
gopls: forwarder: connecting to remote: dialing remote: dial tcp 127.0.0.1:12345: connect: connection refused
[Error - 6:12:55 PM] Connection to server got closed. Server will not be restarted.

@stamblerre stamblerre added this to Needs Triage in vscode-go: gopls by default Nov 10, 2020
@stamblerre stamblerre moved this from Needs Triage to Non-critical in vscode-go: gopls by default Nov 10, 2020
@stamblerre stamblerre removed this from Non-critical in vscode-go: gopls by default Dec 16, 2020
@stamblerre stamblerre added this to To Do in gopls on-deck Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
No open projects
Development

No branches or pull requests

4 participants