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

KeyError on on_payload #7

Open
giampaolo opened this issue Dec 20, 2023 · 9 comments
Open

KeyError on on_payload #7

giampaolo opened this issue Dec 20, 2023 · 9 comments

Comments

@giampaolo
Copy link

I cannot tell how to reproduce this reliably, but sometimes I get:

LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
Traceback (most recent call last):
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '45'
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
Traceback (most recent call last):
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '45'
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
Traceback (most recent call last):
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '45'
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
Traceback (most recent call last):
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '45'
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
LSP-file-watcher-chokidar: ERROR: on_payload(): Handler already deleted
Traceback (most recent call last):
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/giampaolo/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '45'

For me this typically happens on save, and I have some other plugins which may edit the view's text, so that is probable related.

@rchl
Copy link
Member

rchl commented Dec 20, 2023

Which LSP packages are you using?

Also if you can catch this when this happens then it would also be useful to provide output from LSP: Log Panel.

@giampaolo
Copy link
Author

My LSP packages are:

		"LSP",
		"LSP-bash",
		"LSP-file-watcher-chokidar",
		"LSP-json",
		"LSP-pyright",

Unfortunately I cannot reproduce it right now. :(

@photex
Copy link

photex commented Feb 12, 2024

I've just started working on an LSP-OmniSharp update and I'm seeing this a lot:

reloading settings Packages/LSP-OmniSharp/LSP-OmniSharp.sublime-settings
Traceback (most recent call last):
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '38'
Traceback (most recent call last):
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '38'
Traceback (most recent call last):
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '38'
Traceback (most recent call last):
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 155, in invoke
  File "/home/chipc/.config/sublime-text/Installed Packages/LSP-file-watcher-chokidar.sublime-package/watcher.py", line 233, in on_payload
KeyError: '38'

@rchl
Copy link
Member

rchl commented Feb 13, 2024

Does it happen after you edit the plugin file?

If so then it sounds like the code that is supposed to unregister the controller doesn't run. Not sure if it's a side effect of plugin reloading that happens on saving it, some bug or maybe even expected. Hard to say without reproduction steps.

@photex
Copy link

photex commented Feb 13, 2024

Ah yes, I’m seeing it during editing. I don’t see it during startup.

@giampaolo
Copy link
Author

I've just started working on an LSP-OmniSharp update and I'm seeing this a lot:

Yep it also happens to me a lot. I ended up uninstalling LSP-file-watcher-chokidar because it caused too much noise in the output menu. :(

The error doesn't emit a full traceback, so it's not clear exactly where the exception is raised from, but the fix per se should be easy (check that key exists first).

@rchl
Copy link
Member

rchl commented Feb 13, 2024

I've just started working on an LSP-OmniSharp update and I'm seeing this a lot:

Yep it also happens to me a lot. I ended up uninstalling LSP-file-watcher-chokidar because it caused too much noise in the output menu. :(

The error doesn't emit a full traceback, so it's not clear exactly where the exception is raised from, but the fix per se should be easy (check that key exists first).

Are you also working on LSP packages? I need a way to reproduce to understand the issue and potentially fix it. Adding random checks is not necessarily a correct solution because in that case the watcher would still be live and keep using resources.

@giampaolo
Copy link
Author

Are you also working on LSP packages?

No.

@kapitanluffy
Copy link

@giampaolo @photex in any case, are you guys using one of these packages?
https://packagecontrol.io/browse/authors/kapitanluffy

It is happening to me too and I am trying to figure it out too on my end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants