mathworks / jupyter-matlab-proxy

MATLAB Integration for Jupyter enables you to run MATLAB code in Jupyter Notebooks and other Jupyter environments. You can also open MATLAB in a browser directly from your Jupyter environment to use more MATLAB features.
Other
284 stars 36 forks source link

HTTP Error 408 - Request Timeout when launching MATLAB #28

Closed craig-willis closed 1 year ago

craig-willis commented 1 year ago

Problem: Running jupyter-matlab-proxy 0.5.1 in containerized environment with a network license, I have no problem running Matlab code via the Jupyter kernel or terminal, but I am unable to use the MATLAB web desktop (i.e., "Open MATLAB"). In some cases, I get an HTTP Error 408 - Request Timeout when launching MATLAB. Other symptoms include:

Environment: Docker image based on Ubuntu 18.04.6 LTS jupyter-matlab-proxy==0.5.1 matlab-kernel==0.16.11 matlab-proxy==0.5.8 matlabengineforpython===R2020b

**Container logs***:

[I 00:58:16.268 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 00:58:16.519 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.6.1
INFO:MATLABProxyApp:Initializing Jupyter MATLAB Proxy
[W 2023-04-01 00:58:17.837 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.837 LabApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.837 LabApp] 'token' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.837 LabApp] 'base_url' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.837 LabApp] 'port_retries' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.837 LabApp] 'port_retries' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.837 LabApp] 'tornado_settings' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.837 LabApp] 'cookie_options' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-04-01 00:58:17.838 LabApp] 'cookie_options' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2023-04-01 00:58:17.847 LabApp] JupyterLab extension loaded from /srv/conda/envs/notebook/lib/python3.8/site-packages/jupyterlab
[I 2023-04-01 00:58:17.847 LabApp] JupyterLab application directory is /srv/conda/envs/notebook/share/jupyter/lab
[I 00:58:17.854 NotebookApp] nteract extension loaded from /srv/conda/envs/notebook/lib/python3.8/site-packages/nteract_on_jupyter
[I 00:58:17.856 NotebookApp] Serving notebooks from local directory: /home/jovyan/work/workspace
[I 00:58:17.856 NotebookApp] Jupyter Notebook 6.4.12 is running at:
[I 00:58:17.856 NotebookApp] http://b3128f48d884:8888/?token=...
[I 00:58:17.856 NotebookApp]  or http://127.0.0.1:8888/?token=...
[I 00:58:17.856 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

[I 2023-04-01 00:58:34.725 LabApp] Build is up to date
INFO:MATLABProxyApp:/licenses/matlab/network.lic is a path to a file. MATLAB will attempt to use it.
INFO:MATLABProxyApp:
============================
MATLAB can be accessed at:
http://127.0.0.1:34591/matlab
============================

INFO:MATLABProxyApp:Deleting any cached licensing files!
INFO:MATLABProxyApp:Stopped (any running)MATLAB process.
INFO:MATLABProxyApp:Communicating with MATLAB on port:31511, lock file: /home/jovyan/.matlab/MWI/ports/mwi_proxy.lock.31511
INFO:MATLABProxyApp:matlab_stderr_reader() task: Starting task...
[I 00:58:44.803 NotebookApp] 302 GET /matlab/ (10.0.3.10) 1444.710000ms
MATLAB is selecting SOFTWARE OPENGL rendering.

                                                                              < M A T L A B (R) >
                                                                    Copyright 1984-2020 The MathWorks, Inc.
                                                                    R2020b (9.9.0.1467703) 64-bit (glnxa64)
                                                                                August 26, 2020

To get started, type doc.
For product information, visit www.mathworks.com.

[W 00:59:13.292 NotebookApp] 404 GET /serviceregistrylookup/1/service (10.0.3.10) 49.610000ms referer=https://tmp-0ulf6ndnrddw.redacted.org/

Screenshots: MATLAB web desktop with startup.m displayed, no error. 408 error seems intermittent:

Screen Shot 2023-03-31 at 9 01 59 PM

JupyterLab session with correct files displayed, matlab command running and license acquired (quickly) while above MATLAB web desktop is running:

Screen Shot 2023-03-31 at 9 02 53 PM
prabhakk-mw commented 1 year ago

Hi @craig-willis

The 408 Time out issues are usually encountered when there are issues with the network. Communication between the MATLAB Desktop Interface in the browser and the underlying MATLAB executable occur via HTTP(S) and are subject to any latency issues in the network on which it is deployed.

I notice that you are running Ubuntu 18.04 & MATLAB R2020b, are you able to install a newer version of MATLAB, with perhaps Ubuntu 20.04 as the base layer ? There have been significant improvements in newer versions of MATLAB wrt to our integration and may provide a more stable experience.

Finally, please note that the matlab-kernel package you've listed is a community kernel and not a part of the jupyter-matlab-proxy packages.

I don't see anything exceptionally incorrect in your environment. If this issue continues to persist, kindly share with us the Dockerfile used to create the container along with the commands used to create and run them. This will allow us to reproduce the issue at our end and provide more assistance.

Please feel free to reopen the issue to continue this thread.

Thank you!