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

Comments

@frankful
Copy link

@frankful frankful commented Oct 12, 2020

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 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)).

@stamblerre stamblerre closed this Oct 12, 2020
@hyangah
Copy link
Contributor

@hyangah 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 stamblerre commented Oct 12, 2020

@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
@stamblerre stamblerre added this to Bugs in gopls/v1.0.0 Oct 12, 2020
@stamblerre stamblerre moved this from Bugs to Needs Decision in gopls/v1.0.0 Oct 12, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Oct 12, 2020

@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

@hyangah
Copy link
Contributor

@hyangah 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
gopls/v1.0.0
Needs Decision
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.