rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
133 stars 81 forks source link

Deployment does not stop on local even when it is completed in the back-end #310

Closed herambgadgil closed 5 years ago

herambgadgil commented 5 years ago

Greetings,

I encountered this issue when I upgraded my RStudio to preview release - 1.2.1070 . Whenever I publish my application on rs-connect server; the deployment window opens and all the steps are executed. The application gets published on the server as well. But, on local machine, the deploy window doesn't halt. This hampers the next deployment. The only solution is to close and re-open RStudio session which kills the process. I am attaching the image snapshots for reference

image_i

image_ii

image_iv

Thanks! Heramb

jmcphers commented 5 years ago

@ronblum has seen this too, but I've not been able to reproduce it myself.

What happens here is that the Connect server stops sending status from the task; as you can see the request for status is made repeatedly but none is actually returned. The cause is quite mysterious since the deployment works fine and all of the other HTTP calls do what they're supposed to.

As far as we can tell it only happens on Windows, and only on the unreleased rsconnect 0.8.10 (the CRAN version, 0.8.8, doesn't have this issue). You can use rsconnect from CRAN temporarily if this is affecting your workflow.

herambgadgil commented 5 years ago

@jmcphers : I was able to rollback to 0.8.8 by deleting the rsconnect-0.8.10.tar.gz file from the ~\RStudio\R\package folder and then installing the source file from CRAN. So its not affecting my work anymore.

If it is of any help - I was not able to fetch rs-connect application info with rsconnect-0.8.10 even when it existed. I will try and recreate that error and post the reperex code in the comments.

Thanks! Heramb

herambgadgil commented 5 years ago
devtools::install_github("rstudio/rsconnect")
#> Downloading GitHub repo rstudio/rsconnect@master
#> 
#>   

   checking for file 'C:\Users\XXXXX\AppData\Local\Temp\RtmpS0bDNY\remotes29107d542543\rstudio-rsconnect-e6a7248/DESCRIPTION' ...

   checking for file 'C:\Users\XXXXX\AppData\Local\Temp\RtmpS0bDNY\remotes29107d542543\rstudio-rsconnect-e6a7248/DESCRIPTION' ... 

v  checking for file 'C:\Users\XXXXX\AppData\Local\Temp\RtmpS0bDNY\remotes29107d542543\rstudio-rsconnect-e6a7248/DESCRIPTION' (2.4s)
#> 

-  preparing 'rsconnect': (946ms)
#> 

   checking DESCRIPTION meta-information ...

   checking DESCRIPTION meta-information ... 

v  checking DESCRIPTION meta-information
#> 

-  checking for LF line-endings in source and make files and shell scripts (602ms)
#> 

-  checking for empty or unneeded directories
#> 

Removed empty directory 

   Removed empty directory 'rsconnect/examples'
#> 

-  building 'rsconnect_0.8.10.tar.gz'
#> 

#> 
# This gives out error
rsconnect::applications("XXXXX", "rs-connect-x.xxxx.com")
#> Error in if (length(results) >= response$total || length(results) >= max) break: missing value where TRUE/FALSE needed

Created on 2018-10-31 by the reprex package (v0.2.1)

# Installing CRAN version - 0.8.8
install.packages("rsconnect")
#> package 'rsconnect' successfully unpacked and MD5 sums checked
#> 
#> The downloaded binary packages are in
#>  C:\Users\XXXXX\AppData\Local\Temp\RtmpM3HYpB\downloaded_packages

# This works - listing the applications
rsconnect::applications("XXXXX", "rs-connect-x.xxxxx.com")
#>    id                     name
#> 1 127      testing_plumber_api
#> 2  95                   pdcaas
#> 3  77       r_h2o_introduction
#> 4   6 multi_component_declared
#> 5   5   customer_unit_declared
#> 6   3           target_density
#> 7   2           target_modeler
#>                                             url   NA         created_time
#> 1 http://rs-connect-x.xxxxx.com/content/127/ NULL 2018-10-24T17:13:38Z
#> 2  http://rs-connect-x.xxxxx.com/content/95/ NULL 2018-09-10T09:58:34Z
#> 3  http://rs-connect-x.xxxxx.com/content/77/ NULL 2018-08-31T13:26:20Z
#> 4   http://rs-connect-x.xxxxx.com/content/6/ NULL 2018-04-19T10:18:17Z
#> 5   http://rs-connect-x.xxxxx.com/content/5/ NULL 2018-04-19T10:10:04Z
#> 6   http://rs-connect-x.xxxxx.com/content/3/ NULL 2018-04-18T08:50:37Z
#> 7   http://rs-connect-x.xxxxx.com/content/2/ NULL 2018-04-18T08:40:24Z
#>     NA   NA size instances
#> 1 NULL NULL   NA        NA
#> 2 NULL NULL   NA        NA
#> 3 NULL NULL   NA        NA
#> 4 NULL NULL   NA        NA
#> 5 NULL NULL   NA        NA
#> 6 NULL NULL   NA        NA
#> 7 NULL NULL   NA        NA
#>                                             config_url
#> 1 https://rs-connect-x.xxxxx.com/connect/#/apps/127
#> 2  https://rs-connect-x.xxxxx.com/connect/#/apps/95
#> 3  https://rs-connect-x.xxxxx.com/connect/#/apps/77
#> 4   https://rs-connect-x.xxxxx.com/connect/#/apps/6
#> 5   https://rs-connect-x.xxxxx.com/connect/#/apps/5
#> 6   https://rs-connect-x.xxxxx.com/connect/#/apps/3
#> 7   https://rs-connect-x.xxxxx.com/connect/#/apps/2

Created on 2018-10-31 by the reprex package (v0.2.1)

This issue might be vaguely linked with the current issue. I have masked the account and server details.

Thanks! Heramb

jmcphers commented 5 years ago

I've found the problem, but not a fix yet. The issue first started happening with this commit: https://github.com/rstudio/rsconnect/commit/ae203f870f241e7b1e5de35230b635be754785ee. When we use the command-line version of cURL, the task status endpoint's payload isn't read because it's sent using chunked encoding (Transfer-Encoding: chunked), and for some reason cURL is not returning the payload when it's encoded this way.