jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.81k stars 148 forks source link

Unstable behaviour of Jupyter-LSP - Losing connection #364

Open qTipTip opened 4 years ago

qTipTip commented 4 years ago

Hi!

First of all, thanks for an incredibly nice plugin. I am having some issues with the stability of the plugin, and was hoping you could help me debug it further. I'll try to describe my issues as detailed as possible.

Current Behaviour

Opening a new notebook

When initially opening a new notebook, with a new kernel, everything seems to initiialize properly. I observe the following messages in the developer console:

LSP: waiting for Untitled1.ipynb to fully load
notebook.js:79 LSP: Untitled1.ipynb ready for connection
adapter.js:307 LSP: will connect using language: python
connection_manager.js:159 LSP: connection requested {virtual_document: F, language: "python", document_path: "Untitled1.ipynb"}
connection_manager.js:94 LSP: Connection Socket {virtual_document: F, language: "python", document_path: "Untitled1.ipynb"}
connection_manager.js:171 LSP: Untitled1.ipynb python connected.
adapter.js:352 LSP: Adapter for Untitled1.ipynb is ready.
adapter.js:187 LSP: virtual document(s) for Untitled1.ipynb have been initialized
editor_adapter.js:24 No change obtained from CodeMirror editor within the expected time of 0.66s

At this point in time, the autocomplete seems to be functioning properly, and any modifications to the cell yields things along these lines:

[LSP][Completer] Fetching and Transforming
completion_handler.js:132 [LSP][Completer] Token: {offset: 12, value: ".", type: undefined} {ch: 2, line: 1} {ch: 3, line: 1}
completion_handler.js:206 [LSP][Completer] Transforming kernel reply: {start: 13, end: 13, matches: Array(358), metadata: {…}}
completion_handler.js:232 [LSP][Completer] Merging completions: {start: 13, end: 13, items: Array(376)} {start: 13, end: 13, items: Array(358)}
completion_handler.js:268 [LSP][Completer] Merged:  {start: 13, end: 13, items: Array(376)}
console.js:34 LSP:  Signature will be requested for {ch: 8, line: 1}
console.js:34 LSP:  Signature received {signatures: Array(0)}
console.js:34 LSP:  Signature will be requested for {ch: 8, line: 1}
console.js:34 LSP:  Signature received {signatures: Array(1), activeSignature: 0, activeParameter: 0}
console.js:34 LSP:  Signature will be shown ipython {kind: "markdown", value: "```ipython↵walk(top: Union[AnyStr, PathLike[AnyStr….remove('CVS')  # don't visit CVS directories↵```"} {line: 1, ch: 8, sticky: "after"}
console.js:34 LSP:  Signature will be requested for {ch: 9, line: 1}
console.js:34 LSP:  Signature received {signatures: Array(1), activeSignature: 0, activeParameter: 0}
console.js:34 LSP:  Signature will be shown ipython {kind: "markdown", value: "```ipython↵walk(top: Union[AnyStr, PathLike[AnyStr….remove('CVS')  # don't visit CVS directories↵```"} {line: 1, ch: 9, sticky: "after"}

Losing Connection

Without forewarning, the LSP-plugin loses connection, with the following messages:

Connection lost, reconnecting in 0 seconds.
) [Error: Reader received error. Reason: Error during socket reconnect: code = 1006, reason = 
    at …, undefined, undefined]
connection_manager.js:32 LSP: Connection closed by the server 
(anonymous) @ connection_manager.js:32
a.emit @ index.js:10
(anonymous) @ index.js:10
invoke @ index.js:10
fire @ index.js:10
(anonymous) @ index.js:10
invoke @ index.js:10
fire @ index.js:10
fireError @ index.js:10
fireError @ index.js:10
(anonymous) @ index.js:10
e.onclose @ index.js:10
connection_manager.js:48 LSP: Connection unexpectedly disconnected

Failing to reconnect

Finally, the plugin gets stuck in this loop of the two following states:

default.js:1178 Connection lost, reconnecting in 0 seconds.
_reconnect @ default.js:1178
_onWSClose @ default.js:108
3adapter.js:259 LSP: Skipping document update signal: connection not ready

Expected behavior

I expect the LSP-plugin to reconnect, and resume working.

Context

Required: installed server extensions
    jupyter_lsp  enabled 
    - Validating...
      jupyter_lsp 0.9.2 OK
    jupyter_server_proxy  enabled 
    - Validating...
      jupyter_server_proxy  OK
    jupyterlab  enabled 
    - Validating...
      jupyterlab 2.2.5 OK
    jupyterlab_templates  enabled 
    - Validating...
      jupyterlab_templates 0.2.5 OK
    nbgitpuller  enabled 
    - Validating...
      nbgitpuller 0.9.0 OK
    nbresuse  enabled 
    - Validating...
      nbresuse  OK
Required: installed lab extensions
        @bokeh/jupyter_bokeh v2.0.3  enabled  OK
        @jupyter-widgets/jupyterlab-manager v2.0.0  enabled  OK
        @jupyterlab/server-proxy v2.1.1  enabled  OK
        @krassowski/jupyterlab-lsp v2.0.5  enabled  OK
        jupyter-leaflet v0.13.2  enabled  OK
        jupyter-matplotlib v0.7.4  enabled  OK
        jupyterlab-dash v0.3.0  enabled  OK
        jupyterlab-plotly v4.10.0  enabled  OK
        jupyterlab-python-file v0.4.0  enabled  OK
        jupyterlab-spreadsheet v0.3.2  enabled  OK
        jupyterlab-system-monitor v0.6.0  enabled  OK
        jupyterlab-topbar-extension v0.5.0  enabled  OK
        jupyterlab_templates v0.2.5  enabled  OK
Troubleshoot Output
jupyter troubleshoot
$PATH:
        /opt/conda/bin
        /usr/local/sbin
        /usr/local/bin
        /usr/sbin
        /usr/bin
        /sbin
        /bin

sys.path:
        /opt/conda/bin
        /opt/conda/lib/python38.zip
        /opt/conda/lib/python3.8
        /opt/conda/lib/python3.8/lib-dynload
        /opt/conda/lib/python3.8/site-packages

sys.executable:
        /opt/conda/bin/python

sys.version:
        3.8.5 | packaged by conda-forge | (default, Aug 21 2020, 18:21:27) 
        [GCC 7.5.0]

platform.platform():
        Linux-4.19.112+-x86_64-with-glibc2.10

which -a jupyter:
        /opt/conda/bin/jupyter

pip list:
        Package                       Version
        ----------------------------- -------------------
        absl-py                       0.10.0
        aiohttp                       3.6.2
        alembic                       1.4.2
        ansi2html                     1.5.2
        argon2-cffi                   20.1.0
        astroid                       2.4.2
        astunparse                    1.6.3
        async-generator               1.10
        async-timeout                 3.0.1
        attrs                         20.2.0
        autopep8                      1.5.4
        backcall                      0.2.0
        backports.functools-lru-cache 1.6.1
        beautifulsoup4                4.9.1
        bleach                        3.1.5
        blinker                       1.4
        bokeh                         2.1.1
        Bottleneck                    1.3.2
        branca                        0.4.1
        Brotli                        1.0.9
        brotlipy                      0.7.0
        bruges                        0.3.4
        cachetools                    4.1.1
        certifi                       2020.6.20
        certipy                       0.1.3
        cffi                          1.14.2
        chardet                       3.0.4
        click                         7.1.2
        click-plugins                 1.1.1
        cligj                         0.5.0
        cloudpickle                   1.5.0
        colorcet                      2.0.2
        conda                         4.8.3
        conda-package-handling        1.6.1
        cryptography                  3.0
        cycler                        0.10.0
        Cython                        0.29.21
        cytoolz                       0.10.1
        dash                          1.16.0
        dash-core-components          1.12.0
        dash-html-components          1.1.1
        dash-renderer                 1.8.0
        dash-table                    4.10.1
        dask                          2.20.0
        datashader                    0.11.1
        datashape                     0.5.2
        decorator                     4.4.2
        defusedxml                    0.6.0
        deprecation                   2.1.0
        dill                          0.3.2
        distributed                   2.24.0
        dlisio                        0.2.4
        entrypoints                   0.3
        environs                      8.0.0
        fastcache                     1.1.0
        Fiona                         1.8.17
        flake8                        3.8.3
        Flask                         1.1.2
        Flask-Compress                1.5.0
        fsspec                        0.8.0
        future                        0.18.2
        gast                          0.3.3
        geojson                       2.5.0
        geopandas                     0.8.1
        gmpy2                         2.1.0b1
        google-api-core               1.22.2
        google-api-python-client      1.11.0
        google-auth                   1.21.1
        google-auth-httplib2          0.0.4
        google-auth-oauthlib          0.4.1
        google-cloud                  0.34.0
        google-cloud-core             1.4.1
        google-cloud-pubsub           1.7.0
        google-cloud-storage          1.31.0
        google-crc32c                 1.0.0
        google-pasta                  0.2.0
        google-resumable-media        1.0.0
        googleapis-common-protos      1.52.0
        grpc-google-iam-v1            0.12.3
        grpcio                        1.29.0
        grpcio-tools                  1.29.0
        h5py                          2.10.0
        HeapDict                      1.0.1
        holoviews                     1.13.3
        httplib2                      0.18.1
        idna                          2.10
        imagecodecs                   2020.5.30
        imageio                       2.9.0
        importlib-metadata            1.7.0
        ipykernel                     5.3.4
        ipyleaflet                    0.13.3
        ipympl                        0.5.7
        ipython                       7.17.0
        ipython-genutils              0.2.0
        ipywidgets                    7.5.1
        isort                         5.5.2
        itsdangerous                  1.1.0
        jedi                          0.17.2
        Jinja2                        2.11.2
        joblib                        0.16.0
        json5                         0.9.4
        jsonref                       0.2
        jsonschema                    3.2.0
        jupyter-client                6.1.6
        jupyter-core                  4.6.3
        jupyter-dash                  0.3.1
        jupyter-lsp                   0.9.2
        jupyter-server-proxy          1.5.0
        jupyter-telemetry             0.0.5
        jupyterhub                    1.1.0
        jupyterlab                    2.2.5
        jupyterlab-server             1.2.0
        jupyterlab-templates          0.2.5
        Keras                         2.4.3
        Keras-Preprocessing           1.1.2
        kiwisolver                    1.2.0
        lasio                         0.28
        lazy-object-proxy             1.4.3
        llvmlite                      0.31.0
        locket                        0.2.0
        Mako                          1.1.3
        Markdown                      3.2.2
        MarkupSafe                    1.1.1
        marshmallow                   3.7.1
        matplotlib                    3.2.2
        mccabe                        0.6.1
        mistune                       0.8.4
        mixpanel                      4.7.0
        mock                          4.0.2
        mpmath                        1.1.0
        msgpack                       1.0.0
        multidict                     4.7.6
        multipledispatch              0.6.0
        munch                         2.5.0
        nbconvert                     5.6.1
        nbformat                      5.0.7
        nbgitpuller                   0.9.0
        nbresuse                      0.3.3
        networkx                      2.5
        notebook                      6.1.3
        numba                         0.48.0
        numexpr                       2.7.1
        numpy                         1.19.1
        oauthlib                      3.1.0
        olefile                       0.46
        opt-einsum                    3.3.0
        packaging                     20.4
        pamela                        1.0.0
        pandas                        1.1.1
        pandocfilters                 1.4.2
        panel                         0.9.7
        param                         1.9.3
        parso                         0.7.1
        partd                         1.1.0
        patsy                         0.5.1
        pexpect                       4.8.0
        pickleshare                   0.7.5
        Pillow                        7.2.0
        pip                           20.2.2
        plotly                        4.10.0
        pluggy                        0.13.1
        prometheus-client             0.8.0
        prompt-toolkit                3.0.6
        protobuf                      3.13.0
        psutil                        5.7.2
        ptyprocess                    0.6.0
        pwlf                          2.0.4
        pyarrow                       1.0.1
        pyasn1                        0.4.8
        pyasn1-modules                0.2.8
        pycodestyle                   2.6.0
        pycosat                       0.6.3
        pycparser                     2.20
        pyct                          0.4.6
        pycurl                        7.43.0.5
        pydocstyle                    5.1.1
        pyDOE                         0.3.8
        pyflakes                      2.2.0
        Pygments                      2.6.1
        PyJWT                         1.7.1
        pylint                        2.6.0
        pyOpenSSL                     19.1.0
        pyparsing                     2.4.7
        pyproj                        2.6.1.post1
        pyrsistent                    0.16.0
        PySocks                       1.7.1
        python-dateutil               2.8.1
        python-dotenv                 0.14.0
        python-editor                 1.0.4
        python-json-logger            0.1.11
        python-jsonrpc-server         0.4.0
        python-language-server        0.35.0
        pytz                          2020.1
        pyviz-comms                   0.7.6
        PyWavelets                    1.1.1
        PyYAML                        5.3.1
        pyzmq                         19.0.2
        requests                      2.24.0
        requests-oauthlib             1.3.0
        responses                     0.10.16
        retrying                      1.3.3
        rope                          0.17.0
        rsa                           4.6
        ruamel-yaml                   0.15.80
        ruamel.yaml                   0.16.10
        ruamel.yaml.clib              0.2.0
        scikit-image                  0.17.2
        scikit-learn                  0.22.2.post1
        scipy                         1.4.1
        seaborn                       0.10.1
        segyio                        1.9.1
        Send2Trash                    1.5.0
        setuptools                    49.6.0.post20200814
        Shapely                       1.7.1
        simpervisor                   0.3
        six                           1.15.0
        snowballstemmer               2.0.0
        sortedcontainers              2.2.2
        soupsieve                     2.0.1
        SQLAlchemy                    1.3.19
        statsmodels                   0.11.1
        swap-python-sdk               0.1.9
        sympy                         1.6.2
        tables                        3.6.1
        tblib                         1.6.0
        tensorboard                   2.2.2
        tensorboard-plugin-wit        1.7.0
        tensorflow                    2.2.0
        tensorflow-estimator          2.2.0
        termcolor                     1.1.0
        terminado                     0.8.3
        testpath                      0.4.4
        threadpoolctl                 2.1.0
        tifffile                      2020.8.13
        toml                          0.10.1
        toolz                         0.10.0
        torch                         1.5.1+cpu
        torchvision                   0.6.1+cpu
        tornado                       6.0.4
        tqdm                          4.48.2
        traitlets                     4.3.3
        traittypes                    0.2.1
        typing-extensions             3.7.4.2
        ujson                         3.2.0
        uritemplate                   3.0.1
        urllib3                       1.25.10
        utm                           0.6.0
        vincent                       0.4.4
        wcwidth                       0.2.5
        webencodings                  0.5.1
        Werkzeug                      1.0.1
        wheel                         0.35.1
        widgetsnbextension            3.5.1
        wrapt                         1.12.1
        xarray                        0.16.0
        xlrd                          1.2.0
        yapf                          0.30.0
        yarl                          1.5.1
        zict                          2.0.0
        zipp                          3.1.0

conda list:
        # packages in environment at /opt/conda:
        #
        # Name                    Version                   Build  Channel
        _libgcc_mutex             0.1                 conda_forge    conda-forge
        _openmp_mutex             4.5                       1_gnu    conda-forge
        absl-py                   0.10.0                   pypi_0    pypi
        aiohttp                   3.6.2                    pypi_0    pypi
        alembic                   1.4.2              pyh9f0ad1d_0    conda-forge
        ansi2html                 1.5.2                    pypi_0    pypi
        argon2-cffi               20.1.0           py38h1e0a361_1    conda-forge
        astroid                   2.4.2                    pypi_0    pypi
        astunparse                1.6.3                    pypi_0    pypi
        async-timeout             3.0.1                    pypi_0    pypi
        async_generator           1.10                       py_0    conda-forge
        attrs                     20.2.0                   pypi_0    pypi
        autopep8                  1.5.4                    pypi_0    pypi
        backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
        backports                 1.0                        py_2    conda-forge
        backports.functools_lru_cache 1.6.1                      py_0    conda-forge
        beautifulsoup4            4.9.1                      py_1    conda-forge
        blas                      2.14                   openblas    conda-forge
        bleach                    3.1.5              pyh9f0ad1d_0    conda-forge
        blinker                   1.4                        py_1    conda-forge
        blosc                     1.20.0               he1b5a44_0    conda-forge
        bokeh                     2.1.1            py38h32f6830_0    conda-forge
        bottleneck                1.3.2            py38h8790de6_1    conda-forge
        branca                    0.4.1                    pypi_0    pypi
        brotli                    1.0.9                    pypi_0    pypi
        brotlipy                  0.7.0           py38h1e0a361_1000    conda-forge
        bruges                    0.3.4                    pypi_0    pypi
        brunsli                   0.1                  he1b5a44_0    conda-forge
        bzip2                     1.0.8                h516909a_3    conda-forge
        c-ares                    1.16.1               h516909a_3    conda-forge
        ca-certificates           2020.6.20            hecda079_0    conda-forge
        cachetools                4.1.1                    pypi_0    pypi
        certifi                   2020.6.20        py38h32f6830_0    conda-forge
        certipy                   0.1.3                      py_0    conda-forge
        cffi                      1.14.2                   pypi_0    pypi
        chardet                   3.0.4           py38h32f6830_1006    conda-forge
        charls                    2.1.0                he1b5a44_2    conda-forge
        click                     7.1.2              pyh9f0ad1d_0    conda-forge
        click-plugins             1.1.1                    pypi_0    pypi
        cligj                     0.5.0                    pypi_0    pypi
        cloudpickle               1.5.0                      py_0    conda-forge
        colorcet                  2.0.2                    pypi_0    pypi
        conda                     4.8.3            py38h32f6830_2    conda-forge
        conda-package-handling    1.7.0            py38h1e0a361_4    conda-forge
        configurable-http-proxy   4.2.1           node13_he01fd0c_0    conda-forge
        cryptography              3.0              py38h766eaa4_0    conda-forge
        cycler                    0.10.0                     py_2    conda-forge
        cython                    0.29.21          py38h950e882_0    conda-forge
        cytoolz                   0.10.1           py38h516909a_0    conda-forge
        dash                      1.16.0                   pypi_0    pypi
        dash-core-components      1.12.0                   pypi_0    pypi
        dash-html-components      1.1.1                    pypi_0    pypi
        dash-renderer             1.8.0                    pypi_0    pypi
        dash-table                4.10.1                   pypi_0    pypi
        dask                      2.20.0                     py_0    conda-forge
        dask-core                 2.20.0                     py_0    conda-forge
        datashader                0.11.1                   pypi_0    pypi
        datashape                 0.5.2                    pypi_0    pypi
        decorator                 4.4.2                      py_0    conda-forge
        defusedxml                0.6.0                      py_0    conda-forge
        deprecation               2.1.0                    pypi_0    pypi
        dill                      0.3.2              pyh9f0ad1d_0    conda-forge
        distributed               2.24.0           py38h32f6830_0    conda-forge
        dlisio                    0.2.4                    pypi_0    pypi
        entrypoints               0.3             py38h32f6830_1001    conda-forge
        environs                  8.0.0                    pypi_0    pypi
        fastcache                 1.1.0            py38h1e0a361_1    conda-forge
        fiona                     1.8.17                   pypi_0    pypi
        flake8                    3.8.3                    pypi_0    pypi
        flask                     1.1.2                    pypi_0    pypi
        flask-compress            1.5.0                    pypi_0    pypi
        freetype                  2.10.2               he06d7ca_0    conda-forge
        fsspec                    0.8.0                      py_0    conda-forge
        future                    0.18.2                   pypi_0    pypi
        gast                      0.3.3                    pypi_0    pypi
        geojson                   2.5.0                    pypi_0    pypi
        geopandas                 0.8.1                    pypi_0    pypi
        giflib                    5.2.1                h516909a_2    conda-forge
        gmp                       6.2.0                he1b5a44_2    conda-forge
        gmpy2                     2.1.0b1          py38h04dde30_0    conda-forge
        google-api-core           1.22.2                   pypi_0    pypi
        google-api-python-client  1.11.0                   pypi_0    pypi
        google-auth               1.21.1                   pypi_0    pypi
        google-auth-httplib2      0.0.4                    pypi_0    pypi
        google-auth-oauthlib      0.4.1                    pypi_0    pypi
        google-cloud              0.34.0                   pypi_0    pypi
        google-cloud-core         1.4.1                    pypi_0    pypi
        google-cloud-pubsub       1.7.0                    pypi_0    pypi
        google-cloud-storage      1.31.0                   pypi_0    pypi
        google-crc32c             1.0.0                    pypi_0    pypi
        google-pasta              0.2.0                    pypi_0    pypi
        google-resumable-media    1.0.0                    pypi_0    pypi
        googleapis-common-protos  1.52.0                   pypi_0    pypi
        grpc-google-iam-v1        0.12.3                   pypi_0    pypi
        grpcio                    1.29.0                   pypi_0    pypi
        grpcio-tools              1.29.0                   pypi_0    pypi
        h5py                      2.10.0          nompi_py38hfb01d0b_104    conda-forge
        hdf5                      1.10.6          nompi_h3c11f04_101    conda-forge
        heapdict                  1.0.1                      py_0    conda-forge
        holoviews                 1.13.3                   pypi_0    pypi
        httplib2                  0.18.1                   pypi_0    pypi
        icu                       64.2                 he1b5a44_1    conda-forge
        idna                      2.10               pyh9f0ad1d_0    conda-forge
        imagecodecs               2020.5.30        py38h36e1e94_2    conda-forge
        imageio                   2.9.0                      py_0    conda-forge
        importlib-metadata        1.7.0            py38h32f6830_0    conda-forge
        importlib_metadata        1.7.0                         0    conda-forge
        ipykernel                 5.3.4            py38h23f93f0_0    conda-forge
        ipyleaflet                0.13.3                   pypi_0    pypi
        ipympl                    0.5.7              pyh9f0ad1d_1    conda-forge
        ipython                   7.17.0           py38h1cdfbd6_0    conda-forge
        ipython_genutils          0.2.0                      py_1    conda-forge
        ipywidgets                7.5.1                      py_0    conda-forge
        isort                     5.5.2                    pypi_0    pypi
        itsdangerous              1.1.0                    pypi_0    pypi
        jedi                      0.17.2           py38h32f6830_0    conda-forge
        jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
        joblib                    0.16.0                     py_0    conda-forge
        jpeg                      9d                   h516909a_0    conda-forge
        json5                     0.9.4              pyh9f0ad1d_0    conda-forge
        jsonref                   0.2                      pypi_0    pypi
        jsonschema                3.2.0            py38h32f6830_1    conda-forge
        jupyter-dash              0.3.1                    pypi_0    pypi
        jupyter-lsp               0.9.2                    pypi_0    pypi
        jupyter-server-proxy      1.5.0                    pypi_0    pypi
        jupyter_client            6.1.6                      py_0    conda-forge
        jupyter_core              4.6.3            py38h32f6830_1    conda-forge
        jupyter_telemetry         0.0.5                      py_0    conda-forge
        jupyterhub                1.1.0            py38h32f6830_4    conda-forge
        jupyterhub-base           1.1.0            py38h32f6830_4    conda-forge
        jupyterlab                2.2.5                      py_0    conda-forge
        jupyterlab-templates      0.2.5                    pypi_0    pypi
        jupyterlab_server         1.2.0                      py_0    conda-forge
        jxrlib                    1.1                  h516909a_2    conda-forge
        keras                     2.4.3                    pypi_0    pypi
        keras-preprocessing       1.1.2                    pypi_0    pypi
        kiwisolver                1.2.0            py38hbf85e49_0    conda-forge
        krb5                      1.17.1               hfafb76e_2    conda-forge
        lasio                     0.28                     pypi_0    pypi
        lazy-object-proxy         1.4.3                    pypi_0    pypi
        lcms2                     2.11                 hbd6801e_0    conda-forge
        ld_impl_linux-64          2.34                 hc38a660_9    conda-forge
        lerc                      2.2                  he1b5a44_0    conda-forge
        libaec                    1.0.4                he1b5a44_1    conda-forge
        libblas                   3.8.0               14_openblas    conda-forge
        libcblas                  3.8.0               14_openblas    conda-forge
        libcurl                   7.71.1               hcdd3856_5    conda-forge
        libedit                   3.1.20191231         he28a2e2_2    conda-forge
        libev                     4.33                 h516909a_0    conda-forge
        libffi                    3.2.1             he1b5a44_1007    conda-forge
        libgcc-ng                 9.3.0               h24d8f2e_16    conda-forge
        libgfortran-ng            7.5.0               hdf63c60_16    conda-forge
        libgomp                   9.3.0               h24d8f2e_16    conda-forge
        liblapack                 3.8.0               14_openblas    conda-forge
        liblapacke                3.8.0               14_openblas    conda-forge
        libllvm8                  8.0.1                hc9558a2_0    conda-forge
        libnghttp2                1.41.0               h8cfc5f6_2    conda-forge
        libopenblas               0.3.7                h5ec1e0e_6    conda-forge
        libpng                    1.6.37               hed695b0_2    conda-forge
        libprotobuf               3.12.4               h8b12597_0    conda-forge
        libsodium                 1.0.18               h516909a_0    conda-forge
        libssh2                   1.9.0                hab1572f_5    conda-forge
        libstdcxx-ng              9.3.0               hdf63c60_16    conda-forge
        libtiff                   4.1.0                hc7e4089_6    conda-forge
        libuv                     1.34.0               h516909a_0    conda-forge
        libwebp-base              1.1.0                h516909a_3    conda-forge
        libzopfli                 1.0.3                he1b5a44_0    conda-forge
        llvmlite                  0.31.0           py38h4f45e52_1    conda-forge
        locket                    0.2.0                      py_2    conda-forge
        lz4-c                     1.9.2                he1b5a44_3    conda-forge
        lzo                       2.10              h516909a_1000    conda-forge
        mako                      1.1.3              pyh9f0ad1d_0    conda-forge
        markdown                  3.2.2                    pypi_0    pypi
        markupsafe                1.1.1            py38h1e0a361_1    conda-forge
        marshmallow               3.7.1                    pypi_0    pypi
        matplotlib-base           3.2.2            py38h2af1d28_0    conda-forge
        mccabe                    0.6.1                    pypi_0    pypi
        mistune                   0.8.4           py38h1e0a361_1001    conda-forge
        mixpanel                  4.7.0                    pypi_0    pypi
        mock                      4.0.2            py38h32f6830_0    conda-forge
        mpc                       1.1.0             h04dde30_1009    conda-forge
        mpfr                      4.0.2                he80fd80_1    conda-forge
        mpmath                    1.1.0                      py_0    conda-forge
        msgpack-python            1.0.0            py38hbf85e49_1    conda-forge
        multidict                 4.7.6                    pypi_0    pypi
        multipledispatch          0.6.0                    pypi_0    pypi
        munch                     2.5.0                    pypi_0    pypi
        nbconvert                 5.6.1            py38h32f6830_1    conda-forge
        nbformat                  5.0.7                      py_0    conda-forge
        nbgitpuller               0.9.0                    pypi_0    pypi
        nbresuse                  0.3.3                    pypi_0    pypi
        ncurses                   6.2                  he1b5a44_1    conda-forge
        networkx                  2.5                        py_0    conda-forge
        nodejs                    13.13.0              hf5d1a2b_0    conda-forge
        notebook                  6.1.3            py38h32f6830_0    conda-forge
        numba                     0.48.0           py38hb3f55d8_0    conda-forge
        numexpr                   2.7.1            py38hcb8c335_1    conda-forge
        numpy                     1.19.1           py38hbc27379_2    conda-forge
        oauthlib                  3.1.0                    pypi_0    pypi
        olefile                   0.46                       py_0    conda-forge
        openjpeg                  2.3.1                h981e76c_3    conda-forge
        openssl                   1.1.1g               h516909a_1    conda-forge
        opt-einsum                3.3.0                    pypi_0    pypi
        packaging                 20.4               pyh9f0ad1d_0    conda-forge
        pamela                    1.0.0                      py_0    conda-forge
        pandas                    1.1.1            py38h950e882_0    conda-forge
        pandoc                    2.10.1               h516909a_0    conda-forge
        pandocfilters             1.4.2                      py_1    conda-forge
        panel                     0.9.7                    pypi_0    pypi
        param                     1.9.3                    pypi_0    pypi
        parso                     0.7.1              pyh9f0ad1d_0    conda-forge
        partd                     1.1.0                      py_0    conda-forge
        patsy                     0.5.1                      py_0    conda-forge
        pexpect                   4.8.0            py38h32f6830_1    conda-forge
        pickleshare               0.7.5           py38h32f6830_1001    conda-forge
        pillow                    7.2.0            py38h9776b28_1    conda-forge
        pip                       20.2.2                     py_0    conda-forge
        plotly                    4.10.0                   pypi_0    pypi
        pluggy                    0.13.1                   pypi_0    pypi
        prometheus_client         0.8.0              pyh9f0ad1d_0    conda-forge
        prompt-toolkit            3.0.6                      py_0    conda-forge
        protobuf                  3.13.0                   pypi_0    pypi
        psutil                    5.7.2            py38h1e0a361_0    conda-forge
        ptyprocess                0.6.0                   py_1001    conda-forge
        pwlf                      2.0.4                    pypi_0    pypi
        pyarrow                   1.0.1                    pypi_0    pypi
        pyasn1                    0.4.8                    pypi_0    pypi
        pyasn1-modules            0.2.8                    pypi_0    pypi
        pycodestyle               2.6.0                    pypi_0    pypi
        pycosat                   0.6.3           py38h1e0a361_1004    conda-forge
        pycparser                 2.20               pyh9f0ad1d_2    conda-forge
        pyct                      0.4.6                    pypi_0    pypi
        pycurl                    7.43.0.5         py38h4400d41_2    conda-forge
        pydocstyle                5.1.1                    pypi_0    pypi
        pydoe                     0.3.8                    pypi_0    pypi
        pyflakes                  2.2.0                    pypi_0    pypi
        pygments                  2.6.1                      py_0    conda-forge
        pyjwt                     1.7.1                      py_0    conda-forge
        pylint                    2.6.0                    pypi_0    pypi
        pyopenssl                 19.1.0                     py_1    conda-forge
        pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
        pyproj                    2.6.1.post1              pypi_0    pypi
        pyrsistent                0.16.0           py38h1e0a361_0    conda-forge
        pysocks                   1.7.1            py38h32f6830_1    conda-forge
        pytables                  3.6.1            py38h1b207d3_2    conda-forge
        python                    3.8.5           h1103e12_5_cpython    conda-forge
        python-dateutil           2.8.1                      py_0    conda-forge
        python-dotenv             0.14.0                   pypi_0    pypi
        python-editor             1.0.4                      py_0    conda-forge
        python-json-logger        0.1.11                     py_0    conda-forge
        python-jsonrpc-server     0.4.0                    pypi_0    pypi
        python-language-server    0.35.0                   pypi_0    pypi
        python_abi                3.8                      1_cp38    conda-forge
        pytz                      2020.1             pyh9f0ad1d_0    conda-forge
        pyviz-comms               0.7.6                    pypi_0    pypi
        pywavelets                1.1.1            py38h8790de6_1    conda-forge
        pyyaml                    5.3.1            py38h1e0a361_0    conda-forge
        pyzmq                     19.0.2           py38ha71036d_0    conda-forge
        readline                  8.0                  he28a2e2_2    conda-forge
        requests                  2.24.0             pyh9f0ad1d_0    conda-forge
        requests-oauthlib         1.3.0                    pypi_0    pypi
        responses                 0.10.16                  pypi_0    pypi
        retrying                  1.3.3                    pypi_0    pypi
        rope                      0.17.0                   pypi_0    pypi
        rsa                       4.6                      pypi_0    pypi
        ruamel.yaml               0.16.10          py38h1e0a361_0    conda-forge
        ruamel.yaml.clib          0.2.0            py38h1e0a361_1    conda-forge
        ruamel_yaml               0.15.80         py38h1e0a361_1001    conda-forge
        scikit-image              0.17.2           py38hcb8c335_1    conda-forge
        scikit-learn              0.22.2.post1             pypi_0    pypi
        scipy                     1.4.1                    pypi_0    pypi
        seaborn                   0.10.1                        1    conda-forge
        seaborn-base              0.10.1                     py_1    conda-forge
        segyio                    1.9.1                    pypi_0    pypi
        send2trash                1.5.0                      py_0    conda-forge
        setuptools                49.6.0           py38h32f6830_0    conda-forge
        shapely                   1.7.1                    pypi_0    pypi
        simpervisor               0.3                      pypi_0    pypi
        six                       1.15.0             pyh9f0ad1d_0    conda-forge
        snappy                    1.1.8                he1b5a44_3    conda-forge
        snowballstemmer           2.0.0                    pypi_0    pypi
        sortedcontainers          2.2.2              pyh9f0ad1d_0    conda-forge
        soupsieve                 2.0.1                      py_1    conda-forge
        sqlalchemy                1.3.19           py38h1e0a361_0    conda-forge
        sqlite                    3.33.0               h4cf870e_0    conda-forge
        statsmodels               0.11.1           py38h1e0a361_2    conda-forge
        swap-python-sdk           0.1.9                    pypi_0    pypi
        sympy                     1.6.2            py38h32f6830_0    conda-forge
        tblib                     1.6.0                      py_0    conda-forge
        tensorboard               2.2.2                    pypi_0    pypi
        tensorboard-plugin-wit    1.7.0                    pypi_0    pypi
        tensorflow                2.2.0                    pypi_0    pypi
        tensorflow-estimator      2.2.0                    pypi_0    pypi
        termcolor                 1.1.0                    pypi_0    pypi
        terminado                 0.8.3            py38h32f6830_1    conda-forge
        testpath                  0.4.4                      py_0    conda-forge
        threadpoolctl             2.1.0              pyh5ca1d4c_0    conda-forge
        tifffile                  2020.8.13                  py_0    conda-forge
        tini                      0.18.0            h14c3975_1001    conda-forge
        tk                        8.6.10               hed695b0_0    conda-forge
        toml                      0.10.1                   pypi_0    pypi
        toolz                     0.10.0                     py_0    conda-forge
        torch                     1.5.1+cpu                pypi_0    pypi
        torchvision               0.6.1+cpu                pypi_0    pypi
        tornado                   6.0.4            py38h1e0a361_1    conda-forge
        tqdm                      4.48.2             pyh9f0ad1d_0    conda-forge
        traitlets                 4.3.3            py38h32f6830_1    conda-forge
        traittypes                0.2.1                    pypi_0    pypi
        typing_extensions         3.7.4.2                    py_0    conda-forge
        ujson                     3.2.0                    pypi_0    pypi
        uritemplate               3.0.1                    pypi_0    pypi
        urllib3                   1.25.10                    py_0    conda-forge
        utm                       0.6.0                    pypi_0    pypi
        vincent                   0.4.4                      py_1    conda-forge
        wcwidth                   0.2.5              pyh9f0ad1d_1    conda-forge
        webencodings              0.5.1                      py_1    conda-forge
        werkzeug                  1.0.1                    pypi_0    pypi
        wheel                     0.35.1             pyh9f0ad1d_0    conda-forge
        widgetsnbextension        3.5.1            py38h32f6830_1    conda-forge
        wrapt                     1.12.1                   pypi_0    pypi
        xarray                    0.16.0                   pypi_0    pypi
        xlrd                      1.2.0              pyh9f0ad1d_1    conda-forge
        xz                        5.2.5                h516909a_1    conda-forge
        yaml                      0.2.5                h516909a_0    conda-forge
        yapf                      0.30.0                   pypi_0    pypi
        yarl                      1.5.1                    pypi_0    pypi
        zeromq                    4.3.2                he1b5a44_3    conda-forge
        zfp                       0.5.5                he1b5a44_1    conda-forge
        zict                      2.0.0                      py_0    conda-forge
        zipp                      3.1.0                      py_0    conda-forge
        zlib                      1.2.11            h516909a_1007    conda-forge
        zstd                      1.4.5                h6597ccf_2    conda-forge
krassowski commented 4 years ago

Hi @qTipTip, thank you for providing the detailed description. There are two issues:

The language servers usually support a debug mode, but we have no way to trigger it from the UI - certainly a thing to think about. I would be curious to know:

krassowski commented 4 years ago

As to the error code 1006: https://stackoverflow.com/a/19305172/6646912

krassowski commented 4 years ago

Would you be able to check if it also happens with a different browser (e.g. Chromium or Firefox)?

qTipTip commented 4 years ago

Hi @krassowski !

Thank you for looking into this! To answer some of your questions.

  1. I am using jupyter-hub from a Kubernetes deploment (Zero to jupyterhub). Hence, the environment is built from a docker-image. I'll see if I can launch this docker image locally. The rest of the JupyterHub is responsive and functions as expected.

  2. It happens usually within 10-15 seconds of the notebook starting. Up until then the functionality is as expected.

  3. (See 1.) No, JupyterHub is deployed using Kubernetes, so not the same computer for both browser and jupyterhub. Maybe this has something to do with it?

  4. I can confirm the issue happens with Brave, Chrome and Safari.

Let me know if there is anything else I can provide in terms of info.

Here is the packages installed in Docker.

FROM jupyter/tensorflow-notebook:04f7f60d34a6

# https://github.com/timkpaine/jupyterlab_templates
RUN pip install jupyterlab_templates
RUN jupyter labextension install jupyterlab_templates --no-build
RUN jupyter serverextension enable --py jupyterlab_templates

# https://github.com/krassowski/jupyterlab-lsp
RUN pip install --pre jupyter-lsp
RUN jupyter labextension install @krassowski/jupyterlab-lsp --no-build

RUN pip install python-language-server[all]

# https://github.com/jtpio/jupyterlab-python-file
RUN jupyter labextension install jupyterlab-python-file --no-build

# https://github.com/quigleyj97/jupyterlab-spreadsheet
RUN jupyter labextension install jupyterlab-spreadsheet --no-build

# https://github.com/jtpio/jupyterlab-system-monitor
RUN pip install nbresuse==0.3.3
RUN jupyter labextension install jupyterlab-topbar-extension jupyterlab-system-monitor --no-build

# https://github.com/matplotlib/ipympl
RUN pip install ipympl
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib --no-build

# https://github.com/jupyterhub/nbgitpuller
RUN pip install nbgitpuller

# https://github.com/plotly/jupyter-dash
RUN pip install jupyter-dash

# https://stackoverflow.com/questions/54936125/plotly-gives-an-empty-field-as-output-in-jupyter-lab
RUN jupyter labextension install jupyterlab-plotly --no-build

# https://github.com/jupyterhub/jupyter-server-proxy
RUN pip install jupyter-server-proxy
RUN jupyter labextension install @jupyterlab/server-proxy --no-build

RUN jupyter lab build
krassowski commented 4 years ago

Thank you for the update - this helps a lot. I guess that it might be related to another JupyterHub-specific issue, #353.

qTipTip commented 4 years ago

Cheers!

In which respect is it related to #353? It seems like that issue is related to users sharing a root-directory - in my case the users are each spawned into their own sandboxed environment, with the exception of a mounted shared folder.

Tell me if I can assist in any way :)

withsmilo commented 4 years ago
lsp_error

Same problem, too. @qTipTip , have you solved this problem? I also ran JupyterLab and jupyterlab-lsp in the docker environment similar to you.

@krassowski In my case, the Jupyter workspace is mounted on the server running JupyterLab via NFS to provide home to users. Could this be the cause?

withsmilo commented 3 years ago

My issue dispappeared with @krassowski/jupyterlab-lsp@2.1.2! Thanks!

JulianNotFound commented 3 years ago

It seems that this problem is not fully solved after updating to jupyterlab-lsp@2.1.2. I have exactly the same problem when using jupyterlab-lsp in jupyterhub. The connection was lost after about 30 seconds no typing and didn't reconnect automatically. Here is my information :

rob-potter commented 3 years ago

Same issue, jupyterhub spawing jupyter labs, each user with their own home folder.

Happens sporadically for multiple users; can see LSP trying to reconnect after error 1006, but appears to give up after 6 attempts. LSP continues to run, but no updates to detected errors.

Refreshing browser reconnects without issue.

In some cases, this happens for specific notebooks / files - usually for all. Newly opened files show LSP: Connect timed out for 5(python)

krassowski commented 3 years ago

I believe that the issue behind this is now fixed. In jupyter-lsp 1.1 we enabled pings on websocket to maintain the connection (https://github.com/krassowski/jupyterlab-lsp/pull/459) and in jupyterlab-lsp 3.1 we increased the timeouts for connection to the total of 5 minutes and 30 seconds (https://github.com/krassowski/jupyterlab-lsp/pull/479). I am reluctant to close this without your feedback as I have never experienced this issue, but I would be very keen to understand if the mentioned changes helped you.

May I suggest that you try with the latest version (jupyterlab-lsp 3.3.1 and jupyter-lsp 1.1.3 at the moment)?

qTipTip commented 3 years ago

Hey @krassowski!

That is great news! I am currently working on migrating our JupyterHub deployment to 1.3 with JLab 3.0. Will let you know!