Shiny: Any way to not have the "ERROR: [on_request_read] connection reset by peer" appear when running apps in RStudio Viewer?

Created on 17 Nov 2016  Â·  6Comments  Â·  Source: rstudio/shiny

It seems to trip up beginners into thinking they've done something wrong.

Most helpful comment

From RStudio I get this error (i.e. ERROR: [on_request_read] connection reset by peer) whenever I run my app in "_Viewer Pane_" or in "_External_", but I do not get the error when I run in "_Window_" mode.

All 6 comments

hate this error.
I have another one case of it.
I use RSelenium+phantomjs to test a shiny app.
Built-in 'check' RStudio opportunity generates it too:

image

From RStudio I get this error (i.e. ERROR: [on_request_read] connection reset by peer) whenever I run my app in "_Viewer Pane_" or in "_External_", but I do not get the error when I run in "_Window_" mode.

New Shiny app, same error, but my "workaround" mentioned above doesn't work.
Shiny 1.0.3
shinyjs 0.9
R version 3.4.0 Patched (2017-05-25 r72742)

New perplexing behavior: (1) Launch RStudio, Run App, app works fine, close app; (2a) Run App (again), dies with ERROR: [on_request_read] connection reset by peer; (2b) Close RStudio, Launch RStudio, Run App, app works fine.

I've also tried removing all variable from global environment before re-running app, but that doesn't help.

Update: I isolated the problem, but I still don't know why its a problem. At the top of my app.R I make a series of library calls:

library(shiny)
library(shinydashboard)
library(ggplot2)
library(dplyr)
library(magrittr)
library(glue)
library(plotly)
library(shinyjs)

In my server block, I call observe() where I selectively show() and hide() various UI elements using shinyjs API.

...
    } else if (gt == "Redemptions") {
      hide(id = "dist_ctrls_panel")
      hide(id = "distPlot")
      hide(id = "scan_ctrls_panel")
      hide(id = "scanPlot")
      show(id = "redeem_ctrls_panel")
      show(id = "redeemPlot")
      }
...

Running elicited a strange warning:
Warning: Error in show: unused argument (id = "redeem_ctrls_panel") before the proverbial ERROR: [on_request_read] connection reset by peer.

I replaced my show() calls using the package::fun notation (e.g., shinyjs::show(id = "redeem_ctrls_panel")) and the app now works fine!

@loudermilk "connection reset by peer" is probably not the cause of the grey-out, but the result. Right before the call to show, try print(environment(show)), that should show you which package's implementation of show you're getting when you don't qualify it with the shinyjs:: prefix.

Moving this to httpuv

I'm going to make it more clear that showElement is the preferred alias to
show, it's one too many times that someone suffered from this!
On Jul 5, 2017 23:43, "Joe Cheng" notifications@github.com wrote:

@loudermilk https://github.com/loudermilk "connection reset by peer" is
probably not the cause of the grey-out, but the result. Right before the
call to show, try print(environment(show)), that should show you which
package's implementation of show you're getting when you don't qualify it
with the shinyjs:: prefix.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rstudio/shiny/issues/1469#issuecomment-313235469, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA6IFK-mWhI31HoN0hpzV0FI-HG7zB_eks5sLAOdgaJpZM4K1uBT
.

Was this page helpful?
0 / 5 - 0 ratings