question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught exception POST /rstudio/events/get_events

See original GitHub issue

I am trying to install rstudio alongside r-notebook, and install jupyter-server-proxy and jupyter-rsession-proxy with the following Dockerfile

FROM jupyter/r-notebook:latest

USER root

RUN git clone https://github.com/TheLocehiliosan/yadm.git /usr/local/share/yadm && \
    ln -s /usr/local/share/yadm/yadm /usr/local/bin/yadm

RUN apt-get update && \
    curl --silent -L --fail https://s3.amazonaws.com/rstudio-ide-build/server/bionic/amd64/rstudio-server-1.2.1578-amd64.deb > /tmp/rstudio.deb && \
    echo '81f72d5f986a776eee0f11e69a536fb7 /tmp/rstudio.deb' | md5sum -c - && \
    apt-get install -y --no-install-recommends /tmp/rstudio.deb && \
    rm /tmp/rstudio.deb && \
    apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get remove -y r-*
ENV PATH=$PATH:/usr/lib/rstudio-server/bin

ENV R_HOME=/opt/conda/lib/R
ARG LITTLER=$R_HOME/library/littler

RUN echo "local({\n" \
         "   r <- getOption('repos')\n" \
         "   r['CRAN'] <- 'https://cloud.r-project.org'\n" \
         "   options(repos = r)\n" \
         "})\n" > $R_HOME/etc/Rprofile.site && \
         \
         R -e "install.packages(c('littler', 'docopt'))"
RUN sed -i 's/\/usr\/local\/lib\/R\/site-library/\/opt\/conda\/lib\/R\/library/g' $LITTLER/examples/*.r && \
	ln -s $LITTLER/bin/r $LITTLER/examples/*.r /usr/local/bin/ && \
	echo "$R_HOME/lib" | sudo tee -a /etc/ld.so.conf.d/littler.conf && \
	ldconfig

USER $NB_UID

RUN pip install nbgitpuller && \
    conda install -c conda-forge jupyter-server-proxy jupyter-rsession-proxy

I am getting the following error, which I can’t seem to get rid of. However, the R studio seems to work fine except for this error. Is this just for keep-alive?

datascience-notebook_1  | Set username to: jovyan
datascience-notebook_1  | usermod: no changes
datascience-notebook_1  | Granting jovyan sudo access and appending /opt/conda/bin to sudo PATH
datascience-notebook_1  | Executing the command: jupyter lab --NotebookApp.password=sha1:8bc986167428:ec8719e895f4d408e658c23835844b3088bca5a9 --NotebookApp.certfile=/etc/ssl/notebook/mycert.pem --NotebookApp.keyfile=/etc/ssl/notebook/mykey.key
datascience-notebook_1  | [I 04:11:20.826 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
datascience-notebook_1  | [I 04:11:20.826 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
datascience-notebook_1  | [I 04:11:20.830 LabApp] Serving notebooks from local directory: /home/jovyan
datascience-notebook_1  | [I 04:11:20.830 LabApp] The Jupyter Notebook is running at:
datascience-notebook_1  | [I 04:11:20.830 LabApp] https://c55987e28ee9:8888/
datascience-notebook_1  | [I 04:11:20.830 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
datascience-notebook_1  | [W 04:11:57.370 LabApp] SSL Error on 9 ('111.111.111.111', 57084): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:57.370 LabApp] SSL Error on 10 ('111.111.111.111', 57086): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [I 04:11:57.423 LabApp] 302 GET / (111.111.111.111) 1.33ms
datascience-notebook_1  | [W 04:11:57.640 LabApp] SSL Error on 10 ('111.111.111.111', 57090): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:58.750 LabApp] SSL Error on 10 ('111.111.111.111', 57096): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:58.760 LabApp] SSL Error on 11 ('111.111.111.111', 57094): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:58.761 LabApp] SSL Error on 12 ('111.111.111.111', 57092): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:58.853 LabApp] SSL Error on 14 ('111.111.111.111', 57106): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:58.858 LabApp] SSL Error on 13 ('111.111.111.111', 57104): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:59.286 LabApp] SSL Error on 14 ('111.111.111.111', 57108): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [W 04:11:59.308 LabApp] SSL Error on 15 ('111.111.111.111', 57110): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:1056)
datascience-notebook_1  | [I 04:11:59.588 LabApp] Build is up to date
datascience-notebook_1  | [I 04:12:06.723 LabApp] 302 GET /rstudio (111.111.111.111) 1.44ms
datascience-notebook_1  | [I 04:12:07.016 LabApp] 302 GET /rstudio (111.111.111.111) 1.16ms
datascience-notebook_1  | /usr/lib/rstudio-server/bin/rsession: Relink `/opt/conda/lib/R/lib/../.././libgfortran.so.4' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'
datascience-notebook_1  | [E 04:12:35.730 LabApp] Uncaught exception POST /rstudio/events/get_events (111.111.111.111)
datascience-notebook_1  |     HTTPServerRequest(protocol='https', host='110.110.110.110:8887', method='POST', uri='/rstudio/events/get_events', version='HTTP/1.1', remote_ip='111.111.111.111')
datascience-notebook_1  |     Traceback (most recent call last):
datascience-notebook_1  |       File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
datascience-notebook_1  |         result = await result
datascience-notebook_1  |       File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 434, in proxy
datascience-notebook_1  |         return await super().proxy(self.port, path)
datascience-notebook_1  |       File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 199, in proxy
datascience-notebook_1  |         response = await client.fetch(req, raise_error=False)
datascience-notebook_1  |     tornado.simple_httpclient.HTTPTimeoutError: Timeout during request
datascience-notebook_1  | [E 04:12:35.762 LabApp] Could not open static file ''
datascience-notebook_1  | [E 04:12:35.763 LabApp] {
datascience-notebook_1  |       "Host": "110.110.110.110:8887",
datascience-notebook_1  |       "Connection": "keep-alive",
datascience-notebook_1  |       "Content-Length": "149",
datascience-notebook_1  |       "Sec-Fetch-Mode": "cors",
datascience-notebook_1  |       "Origin": "https://110.110.110.110:8887",
datascience-notebook_1  |       "X-Csrf-Token": "d9881612-d8e6-4d21-85d1-5b131c645780",
datascience-notebook_1  |       "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36",
datascience-notebook_1  |       "Content-Type": "application/json",
datascience-notebook_1  |       "Accept": "application/json",
datascience-notebook_1  |       "X-Rs-Rid": "-1304597456",
datascience-notebook_1  |       "Dnt": "1",
datascience-notebook_1  |       "Sec-Fetch-Site": "same-origin",
datascience-notebook_1  |       "Referer": "https://110.110.110.110:8887/rstudio/",
datascience-notebook_1  |       "Accept-Encoding": "gzip, deflate, br",
datascience-notebook_1  |       "Accept-Language": "en-US,en;q=0.9,ko;q=0.8",
datascience-notebook_1  |       "Cookie": "port-token=d6722da5d331; username-110-110-110-110-8888=\"2|1:0|10:1567738412|28:username-110-110-110-110-8888|44:OWJiMDgwMDJkMDliNDBhM2I0ODgzYTdjYWYzMzIxMzE=|473c88faa331af0c7daebcb1e8a1001c563ada26657dab0bdc46dbc7bba35684\"; _xsrf=2|ad2e4a8f|8bfda290a46f6003266ac8e302109d43|1567810202; csrf-token=d9881612-d8e6-4d21-85d1-5b131c645780; username-110.110.110.110-8887=\"2|1:0|10:1567827401|28:username-110.110.110.110-8887|44:YzY0YzZhNzI0MTU1NGJhMmFiY2YyYjBmYjNmMDFmYTI=|bf5a7f5b564fddbccd7f33eb1cd09e948aebc170f93dc33dd7e48e13e98b306d\""
datascience-notebook_1  |     }
datascience-notebook_1  | [E 04:12:35.763 LabApp] 500 POST /rstudio/events/get_events (111.111.111.111) 20056.74ms referer=https://110.110.110.110:8887/rstudio/
datascience-notebook_1  | [E 04:12:56.882 LabApp] Uncaught exception POST /rstudio/events/get_events (111.111.111.111)
datascience-notebook_1  |     HTTPServerRequest(protocol='https', host='110.110.110.110:8887', method='POST', uri='/rstudio/events/get_events', version='HTTP/1.1', remote_ip='111.111.111.111')
datascience-notebook_1  |     Traceback (most recent call last):
datascience-notebook_1  |       File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
datascience-notebook_1  |         result = await result
datascience-notebook_1  |       File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 434, in proxy
datascience-notebook_1  |         return await super().proxy(self.port, path)
datascience-notebook_1  |       File "/opt/conda/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 199, in proxy
datascience-notebook_1  |         response = await client.fetch(req, raise_error=False)
datascience-notebook_1  |     tornado.simple_httpclient.HTTPTimeoutError: Timeout during request
datascience-notebook_1  | [E 04:12:56.885 LabApp] {
datascience-notebook_1  |       "Host": "110.110.110.110:8887",
datascience-notebook_1  |       "Connection": "keep-alive",
datascience-notebook_1  |       "Content-Length": "149",
datascience-notebook_1  |       "Sec-Fetch-Mode": "cors",
datascience-notebook_1  |       "Origin": "https://110.110.110.110:8887",
datascience-notebook_1  |       "X-Csrf-Token": "d9881612-d8e6-4d21-85d1-5b131c645780",
datascience-notebook_1  |       "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36",
datascience-notebook_1  |       "Content-Type": "application/json",
datascience-notebook_1  |       "Accept": "application/json",
datascience-notebook_1  |       "X-Rs-Rid": "-2033399115",
datascience-notebook_1  |       "Dnt": "1",
datascience-notebook_1  |       "Sec-Fetch-Site": "same-origin",
datascience-notebook_1  |       "Referer": "https://110.110.110.110:8887/rstudio/",
datascience-notebook_1  |       "Accept-Encoding": "gzip, deflate, br",
datascience-notebook_1  |       "Accept-Language": "en-US,en;q=0.9,ko;q=0.8",
datascience-notebook_1  |       "Cookie": "port-token=d6722da5d331; username-110-110-110-110-8888=\"2|1:0|10:1567738412|28:username-110-110-110-110-8888|44:OWJiMDgwMDJkMDliNDBhM2I0ODgzYTdjYWYzMzIxMzE=|473c88faa331af0c7daebcb1e8a1001c563ada26657dab0bdc46dbc7bba35684\"; _xsrf=2|ad2e4a8f|8bfda290a46f6003266ac8e302109d43|1567810202; csrf-token=d9881612-d8e6-4d21-85d1-5b131c645780; username-110.110.110.110-8887=\"2|1:0|10:1567827401|28:username-110.110.110.110-8887|44:YzY0YzZhNzI0MTU1NGJhMmFiY2YyYjBmYjNmMDFmYTI=|bf5a7f5b564fddbccd7f33eb1cd09e948aebc170f93dc33dd7e48e13e98b306d\""
datascience-notebook_1  |     }
datascience-notebook_1  | [E 04:12:56.886 LabApp] 500 POST /rstudio/events/get_events (111.111.111.111) 20027.09ms referer=https://110.110.110.110:8887/rstudio/

What might be going wrong? What am I missing? Your help is appreciated!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bmshousecommented, Feb 5, 2020

I am getting this same error. It looks like RStudio is holding the connection open when there are no events to send back (unconfirmed suspicion). After 20 seconds the proxy times out and the uncaught exception is reported.

** Previous comment removed as it has been determined that is was unrelated **

I am in the early stages of debugging, but I will report when I find something more concrete. Anyone else have some insight into the situation? I am an RStudio noob.

1reaction
louiscpalmacommented, Apr 4, 2020

Haven’t done too much testing myself yet, as I just ran into this issue recently… I believe it comes down to the proxy_request_options definition:

    def proxy_request_options(self):
        '''A dictionary of options to be used when constructing
        a tornado.httpclient.HTTPRequest instance for the proxy request.'''
        return dict(follow_redirects=False, connect_timeout=250.0, request_timeout=300.0)

@bmshouse The default timeout for tornado.httpclient.HTTPRequest is 20 seconds so that would explain why you’re seeing those timings. Looks like connect_timeout and request_timeout were recently added to jupyter_server_proxy/handlers.py. Rstudio does tend to hold connections open like this, particularly when the console is waiting a long time without printing (long running function for example). Their recommended proxy config for nginx and apache can be found here.

With a diversity of IDE and other utilities that are being proxied in Jupyter notebooks, it would seem to make sense to have the timeouts configurable in some manner.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Shiny applications
The goal of this article is to arm you with tools and techniques for debugging in Shiny specifically. If you're interested in tools...
Read more >
shinyloadtest record on mac doesnt stop when closing browser
IllegalStateException : last event in log not a WS_CLOSE (did you close the tab after recording?) at com.rstudio.shinycannon.
Read more >
Rstudio daily on MacOS 13 Beta - reproducing bug - MPU Talk
1 After installing when I try to start RStudio I am getting screen with this error ``` Uncaught Exception: Error: Config schema violation:...
Read more >
rstudioevents: Home
R Studio is a branch of All in One Entertainment, a leading rental and ... with you to discuss this very important day...
Read more >
org.rstudio.studio.client.application.Application.java Source code
BarrierReleasedEvent; import org.rstudio.core.client.events. ... ApplicationUncaughtExceptionHandler uncaughtExHandler, Provider<UIPrefs> uiPrefs, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found