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

Be lenient about Connection header contents when Upgrade header is present #153

Merged
merged 2 commits into from Jun 8, 2018

Conversation

jcheng5
Copy link
Member

@jcheng5 jcheng5 commented Jun 8, 2018

This is a workaround for rstudio/rstudio#2940. It
stops an erroneously sent "Connection: close" header from breaking an
otherwise legit websocket request.

Testing notes

Log into an RStudio Server (rstudio.cloud doesn't count, maybe because they run through a proxy) using Firefox. Do shiny::runExample("01_hello"). If httpuv is 1.4.x, the app will launch but immediately disconnect without rendering output. (Older versions of httpuv don't have the problem.)

…esent

This is a workaround for rstudio/rstudio#2940. It
stops an erroneously sent "Connection: close" header from breaking an
otherwise legit websocket request.
@jcheng5 jcheng5 merged commit dd1c2e7 into master Jun 8, 2018
@jcheng5 jcheng5 deleted the joe/bugfix/websocket-connection-close branch June 8, 2018 20:10
@jspiewak
Copy link
Member

jspiewak commented Jul 3, 2018

@jcheng5 yes, rstudio.cloud has a proxy, but this still needs to work on rstudio.cloud and remains broken with httpuv 1.4.4.2

@jcheng5
Copy link
Member Author

jcheng5 commented Jul 3, 2018

@jspiewak Oh, I wasn't able to repro the problem on rstudio.cloud, that's why I said that. You're seeing the grey-out with these exact repro steps?

@jspiewak
Copy link
Member

jspiewak commented Jul 3, 2018

@wch
Copy link
Collaborator

wch commented Jul 3, 2018

@jcheng5 I've been able to reproduce it and am investigating now. It doesn't happen with all apps.

@wch
Copy link
Collaborator

wch commented Jul 3, 2018

I dug around in the code a little bit and found a smaller example that crashes about 50% of the time on rstudio.cloud.

# devtools::install_github("skranz/restorepoint")
# devtools::install_github("skranz/shinyEvents")

library(shinyEvents)

# Create a new eventsApp
app = eventsApp()

app$ui = fluidPage(
  textInput("input_name","Your Name")
)

viewApp(app)

@wch
Copy link
Collaborator

wch commented Jul 3, 2018

Hm, even runExample('01_hello') seems to crash most of the time for me.

> sessioninfo::session_info()
Failed to create bus connection: No such file or directory
─ Session info ────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.0 (2018-04-23)
 os       Ubuntu 16.04.4 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language (EN)                        
 collate  C.UTF-8                     
 tz       Etc/UTC                     
 date     2018-07-03                  

─ Packages ────────────────────────────────────────────────────────────────────────────────────
 package      * version date       source        
 clisymbols     1.2.0   2017-05-21 RSPM (R 3.5.0)
 digest         0.6.15  2018-01-28 RSPM (R 3.5.0)
 htmltools      0.3.6   2017-04-28 RSPM (R 3.5.0)
 httpuv         1.4.4.2 2018-07-02 CRAN (R 3.5.0)
 jsonlite       1.5     2017-06-01 RSPM (R 3.5.0)
 later          0.7.3   2018-06-08 RSPM (R 3.5.0)
 magrittr       1.5     2014-11-22 RSPM (R 3.5.0)
 mime           0.5     2016-07-07 RSPM (R 3.5.0)
 promises       1.0.1   2018-04-13 RSPM (R 3.5.0)
 R6             2.2.2   2017-06-17 RSPM (R 3.5.0)
 Rcpp           0.12.17 2018-05-18 RSPM (R 3.5.0)
 restorepoint * 0.1.8   2018-07-03 local         
 rlang          0.2.1   2018-05-30 RSPM (R 3.5.0)
 rstudioapi   * 0.7     2017-09-07 RSPM (R 3.5.0)
 sessioninfo    1.0.0   2017-06-21 RSPM (R 3.5.0)
 shiny        * 1.1.0   2018-05-17 RSPM (R 3.5.0)
 shinyEvents  * 2.3     2018-07-03 local         
 withr          2.1.2   2018-03-15 RSPM (R 3.5.0)
 xtable         1.8-2   2016-02-05 RSPM (R 3.5.0)

@dernapo
Copy link

dernapo commented Jun 21, 2019

I have the same issue, when I run shiny::runExample('01_hello', display.mode="normal") I get a gray screen. Is there any work around? Thanks!

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 
 
locale:
 [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8    
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8    LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.2.0 **shiny_1.3.2**  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        rstudioapi_0.10   magrittr_1.5      tidyselect_0.2.5  munsell_0.5.0     colorspace_1.4-1 
 [7] xtable_1.8-4      R6_2.4.0          rlang_0.3.4       dplyr_0.8.1       tools_3.6.0       grid_3.6.0       
[13] packrat_0.5.0     gtable_0.3.0      sessioninfo_1.1.1 cli_1.1.0         withr_2.1.2       htmltools_0.3.6  
[19] assertthat_0.2.1  lazyeval_0.2.2    digest_0.6.19     tibble_2.1.2      crayon_1.3.4      purrr_0.3.2      
[25] later_0.8.0       promises_1.0.1    rsconnect_0.8.13  glue_1.3.1        mime_0.7          compiler_3.6.0   
[31] pillar_1.4.1      scales_1.0.0      **httpuv_1.5.1**      pkgconfig_2.0.2  

@jcheng5
Copy link
Member Author

jcheng5 commented Jun 21, 2019

@dernapo Are you on rstudio.cloud, RStudio Server (Pro), or RStudio desktop? And if one of the latter two, what version?

If not desktop then installing httpuv from GitHub master may help--if that works then you likely have a misconfigured nginx proxy between you and RStudio. See https://community.rstudio.com/t/shiny-v1-3-known-regressions-and-serious-issues/28180/4

@dernapo
Copy link

dernapo commented Jun 21, 2019

Hi @jcheng5 I am using RStudio Server Version 1.2.1335, no NGINX but Apache 2.4.
Tried with installing httpuv from GitHub but still not working :(

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

Successfully merging this pull request may close these issues.

None yet

4 participants