kubeflow-kale / kale

Kubeflow’s superfood for Data Scientists
http://kubeflow-kale.github.io
Apache License 2.0
628 stars 129 forks source link

JupyterLab Markdown and Raw Cell Error #165

Open sylus opened 4 years ago

sylus commented 4 years ago

When a new markdown or raw cell are added to a notebook, an error repeatedly pops up every time you try to interact with the cell:

errorconsole

I've tried this with 3 images: minimal-notebook-cpu, machine-learning-notebook-cpu, and geomatics-notebook-cpu and they all had the same problem. This only seems to be a problem with newly created notebook servers as it was tested with a notebook from ~2 weeks ago and a machine-leaning-notebook-cpu from 43 days ago and no errors came up.

The following is how we added Kale atm:

https://github.com/StatCan/kubeflow-containers/commit/746d058e2f37e004da5ca483d121bfb9e0545f2b

elikatsis commented 4 years ago

Hello @sylus,

From the top of my head, without knowing if that's the issue or not, I can see that you are using npm to install deps and build. However, we've been using jlpm (and that's the recommended way).

jlpm is a package manager and is essentially a wrapper of yarn. It is installed along with jupyterlab python package. Using the correct package manager is essential to proper functionality, since it uses the lock file found inside the package to tune package versions. npm looks for package-lock.json, yarn (and jlpm) looks for yarn.lock. [If you notice, there is a yarn.lock in labextension/ directory.]

So, for starters, could you try using jlpm instead of npm and report back whether the issue persists or not?

sylus commented 4 years ago

We gave it a go with jlpm but it stil has the same issue, I'll try to see if can provide further information.

elikatsis commented 4 years ago

Taking another look into this, it looks like this error is thrown by some other extension, not Kale. It is just that Kale implements a handler showing a dialog when an error thrown from within a Promise pops up and there is no one catching it.

For example, I see some LSP logs just before the error is thrown. Searching a bit in the LSP extension code, I found out that it is this that throws the error here: https://github.com/krassowski/jupyterlab-lsp/blob/13c8000998d60e9d4e5ed50d108e363127846fe2/packages/jupyterlab-lsp/src/virtual/editors/notebook.ts#L125 and this is what we see in the console: https://github.com/krassowski/jupyterlab-lsp/blob/a46f3a8620a5e6460333850bd3fdb324870399b9/packages/jupyterlab-lsp/src/command_manager.ts#L174-L175

  1. Is it expected to have such an error?
  2. If the error is caught, why does our handler gets triggered? We will have to look more into this from our end. If you have any knowledge on the subject, feel free to contribute.
ca-scribner commented 4 years ago

Yeah good catch. If I uninstall LSP then the errors go away for me. So probably LSP has an uncaught error that hasn't broken anything meaningful, but the kale handler does catch it?