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

Unable to use pygls over websockets #268

Closed
alcarney opened this issue Sep 22, 2022 · 1 comment
Closed

Unable to use pygls over websockets #268

alcarney opened this issue Sep 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@alcarney
Copy link
Collaborator

Trying to start a websocket based server I get the following error

>>> from pygls.server import LanguageServer

>>> s = LanguageServer()
>>> s.start_ws('localhost', 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/home/alex/Projects/pygls/pygls/server.py", line 310, in start_ws
    self.loop.run_until_complete(start_server)
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/usr/lib64/python3.10/asyncio/tasks.py", line 650, in _wrap_awaitable
    return (yield from awaitable.__await__())
  File "/var/home/alex/Projects/esbonio/.env/lib64/python3.10/site-packages/websockets/legacy/server.py", line 1088, in __await_impl__
    server = await self._create_server()
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 1471, in create_server
    infos = await tasks.gather(*fs)
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 1408, in _create_server_getaddrinfo
    infos = await self._ensure_resolved((host, port), family=family,
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 1404, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
  File "/usr/lib64/python3.10/asyncio/base_events.py", line 860, in getaddrinfo
    return await self.run_in_executor(
RuntimeError: Task <Task pending name='Task-2' coro=<BaseEventLoop._create_server_getaddrinfo() running at /usr/lib64/python3.10/asyncio/base_events.py:1408> cb=[gather.<locals>._done_callback() at /usr/lib64/python3.10/asyncio/tasks.py:720]> got Future <Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/lib64/python3.10/asyncio/futures.py:385]> attached to a different loop
@tombh
Copy link
Collaborator

tombh commented Sep 26, 2022

Just saw your "LSP Inspector" app! really nice 🤓

@tombh tombh mentioned this issue Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants