zigtools / zls-vscode

Deprecated, please use https://github.com/ziglang/vscode-zig
https://github.com/ziglang/vscode-zig
MIT License
85 stars 15 forks source link

Command 'Zig Language Server: Start Server' resulted in an error (Request failed with status code 403) #54

Closed elgs closed 1 year ago

elgs commented 1 year ago

Got the following error when starting

Command 'Zig Language Server: Start Server' resulted in an error (Request failed with status code 403)

vscode config:

"zls.path": "/Users/qianchen/Library/Application Support/Code/User/globalStorage/augusterame.zls-vscode/zls_install/zls",
~/code/zig/hello$ zig version
0.10.0

~/code/zig/hello$ which zig
/opt/homebrew/bin/zig
Zig Language Server (zls) for VSCode
v1.1.4
Screenshot 2022-11-01 at 9 28 28 PM
SuperAuguste commented 1 year ago

403 seems to indicate an issue with the autoupdater fetching the zls binary; manually replicating this doesn't lead to an issue... Are there any errors logged in the VSCode Inspect Elements console related to this? (like a fetch or XHR failure of some sort?) :)

elgs commented 1 year ago

Thanks for the quick reply! I got this in the dev console.

image
SuperAuguste commented 1 year ago

Could you try to hunt down the URL being requested, maybe looking for request failures in the Network tab?

elgs commented 1 year ago

The 403 error only happened when I reinstall the zls extension. Also there is no 403 response from the network tab. When I manually restart the zls server, neither the dev console nor the network tab has any output.

https://goweb.az.ht/tmp/zls_error.gif

Sorry the error pop up was not recorded by my screen recorder software.

SuperAuguste commented 1 year ago

I tried replicating this issue locally but I couldn't achieve it; unfortunately your GIF doesn't really give me enough information to go off of. Would you mind joining the zls Discord (see README) so we could debug this live?

elgs commented 1 year ago

I couldn't figure out how to do the Discord, as I didn't find it from the README. I opened a Google Meet here in case you could join.

https://meet.google.com/fyo-rpgn-hvt

SuperAuguste commented 1 year ago

Could you please update the extension to the latest version, remove the check_for_update line in your settings and try this again? Just pushed and published a definitive fix (hopefully) :)

elgs commented 1 year ago

Updated to v1.1.5, and removed check_for_update. I still got the 403 dialog.

elgs commented 1 year ago

When I restart the zls server, I got this message:

image

This happens when I add the line zls. check_for_update: false back.

SuperAuguste commented 1 year ago

That's totally normal :)

So along with the 403, are there multiple "Installing zls..." windows like before?

elgs commented 1 year ago

The multiple "Installing zls..." windows is not showing up any more. :)

SuperAuguste commented 1 year ago

Okay; I think you might just be rate limited because the bug I just fixed caused your client to send too many requests to the zig.pm server

Could you try again tomorrow and see what happens? (Just confirmed that this is a rate limit thing on my machine, should work fine once the rate limit expires :))

elgs commented 1 year ago

I disconnected from the vpn, and it works!! Thank you so much! it looks like the update server is not happy with the vpn server ip I was using. :)

One thing I observed which doesn't affect the functionality is upon each start of vscode, I saw the "Installing zls ..." message once, and followed by the "ZLS has been build(t) with a newer version than ..." message.

SuperAuguste commented 1 year ago

Yep, that's intended functionality, albeit a little annoying.

Thank you so much for bearing with me and helping me hunt this down!