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

Terminal disconnects when running server in Docker #1844

Closed
gtritchie opened this issue Dec 13, 2017 · 6 comments · Fixed by #1858
Closed

Terminal disconnects when running server in Docker #1844

gtritchie opened this issue Dec 13, 2017 · 6 comments · Fixed by #1858
Assignees
Milestone

Comments

@gtritchie
Copy link
Member

@gtritchie gtritchie commented Dec 13, 2017

From community: https://community.rstudio.com/t/button-to-re-connect-to-terminal-in-rstudio-server-terminal-tab/3485

I have also repro'd this in a docker scenario. Needs further investigation to determine why the terminal isn't automatically reconnecting (the intended behavior).

@gtritchie gtritchie added the bug label Dec 13, 2017
@gtritchie gtritchie self-assigned this Dec 13, 2017
@andresrcs
Copy link

@andresrcs andresrcs commented Dec 15, 2017

It also happens when running rstudio server in AWS EC2 Ubuntu instance and it's really annoying

@gtritchie
Copy link
Member Author

@gtritchie gtritchie commented Dec 15, 2017

Investigation notes

In the repro I get on rstudio.cloud, here's the terminal diagnostics:

2017/12/15 9:16:45: WebSocket connected
2017/12/15 9:21:47: WebSocket closed
2017/12/15 9:43:03: Disconnected

In the second stage (websocket closed), which looks like it happens after five minutes of inactivity, the reported behavior takes place. Typing in terminal is a no-op, and the Javascript console shows: Tried to send user input over null websocket.

If I wait for the "disconnected" state to take place, then the terminal will reconnect the way it is supposed to.

gtritchie added a commit that referenced this issue Dec 15, 2017
Fixes #1844

If the websocket was closed (seeing this happen in container scenarios), mark the terminal as disconnected so the reconnection logic kicks in. For example, terminal should reconnect if the user types in the disconnected terminal.

Prior to this fix, the terminal would remain inactive and ignore input if the underlying websocket had closed.
@jmcphers jmcphers added this to the v1.1-patch milestone Dec 15, 2017
jmcphers pushed a commit that referenced this issue Dec 18, 2017
Fixes #1844

If the websocket was closed (seeing this happen in container scenarios), mark the terminal as disconnected so the reconnection logic kicks in. For example, terminal should reconnect if the user types in the disconnected terminal.

Prior to this fix, the terminal would remain inactive and ignore input if the underlying websocket had closed.
@jmcphers
Copy link
Member

@jmcphers jmcphers commented Dec 18, 2017

Backported to 1.1 in d2bcc3b.

@ronblum
Copy link
Contributor

@ronblum ronblum commented Jan 5, 2018

@andresrcs, there’s a preview release at
  https://www.rstudio.com/products/rstudio/download/preview/
which is a patch for 1.1. It addresses this issue—would you be willing to try out it and see if the issue is resolved? You might still see a message in the console, but the terminal should reconnect.

@andresrcs
Copy link

@andresrcs andresrcs commented Jan 5, 2018

@ronblum, I had some problems installing it, because installation fails with python 3.6 I had to change my python3 alternatives to 3.5 but... The terminal reconnects!

@ronblum
Copy link
Contributor

@ronblum ronblum commented Jan 8, 2018

Excellent @andresrcs, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants