rstudio / rsconnect

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

rsconnect::deployApp() => requested object does not exist #648

Closed nick-youngblut closed 1 year ago

nick-youngblut commented 1 year ago
Error: HTTP 404
  GET http://10.22.20.45/__api__/applications/9
  The requested object does not exist.

rsconnect::application()shows that http://10.22.20.45/__api__/applications/9 no longer exists on that server, but rsconnect::deployApp() keeps trying to use that API url instead of "realizing" that the app no longer exists and thus instead creating a new deployment.

I can't figure out a way to "force" re-create the app on Connect via rsconnect::deployApp. The rsconnect::deployApp docs don't seem to describe a way of re-deploying an app after it is deleted in Connect.

sessionInfo

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] shinytest2_0.2.0      testthat_3.1.6        glue_1.6.2            dbplyr_2.2.1          DBI_1.1.3            
 [6] jsonlite_1.8.4        httr_1.4.4            stringr_1.5.0         memoise_2.0.1         htmlwidgets_1.6.0    
[11] tidytable_0.9.1       data.table_1.14.6     dplyr_1.0.10          config_0.3.1          plotly_4.10.1        
[16] ggplot2_3.4.0         rhandsontable_0.3.8   reactable_0.4.1       shinycssloaders_1.0.0 shinyBS_0.61.1       
[21] shiny_1.7.4           RPostgres_1.4.4      

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9        tidyr_1.2.1       ps_1.7.2          packrat_0.8.1     assertthat_0.2.1  digest_0.6.31     utf8_1.2.2       
 [8] mime_0.12         R6_2.5.1          pillar_1.8.1      rlang_1.0.6       lazyeval_0.2.2    curl_4.3.3        rstudioapi_0.14  
[15] callr_3.7.3       blob_1.2.3        bit_4.0.5         munsell_0.5.0     compiler_4.2.1    httpuv_1.6.7      askpass_1.1      
[22] pkgconfig_2.0.3   htmltools_0.5.4   openssl_2.0.5     tidyselect_1.2.0  tibble_3.1.8      fansi_1.0.3       viridisLite_0.4.1
[29] crayon_1.5.2      withr_2.5.0       later_1.3.0       brio_1.1.3        grid_4.2.1        xtable_1.8-4      gtable_0.3.1     
[36] lifecycle_1.0.3   magrittr_2.0.3    scales_1.2.1      cli_3.5.0         stringi_1.7.8     cachem_1.0.6      renv_0.15.5      
[43] promises_1.2.0.1  ellipsis_0.3.2    generics_0.1.3    vctrs_0.5.1       tools_4.2.1       bit64_4.0.5       purrr_1.0.0      
[50] hms_1.1.2         rsconnect_0.8.28  processx_3.8.0    fastmap_1.1.0     yaml_2.3.6        colorspace_2.0-3 
nick-youngblut commented 1 year ago

I had to re-deploy the app via the publish button in Workbench. This created http://10.22.20.45/__api__/applications/12. I then tried using rsconnect::deployApp() to update the app, but the function created a new version of the app: http://10.22.20.45/__api__/applications/13. Subsequent runs of rsconnect::deployApp() successfully update the 13 deployment.

aronatkins commented 1 year ago

Could you try rsconnect::deployments to enumerate the known deployments and then rsconnect::forgetDeployment to remove specific records?

rsconnect::forgetDeployment(appPath = ".", account = "USERNAME", server = "SERVER", name = "DEPLOYNAME")
aronatkins commented 1 year ago

One note: If attempting to remove records for a document rather than a Shiny application (e.g. index.Rmd, you'll need to use the filename as the appPath argument.

rsconnect::forgetDeployment(appPath = "./index.Rmd", ...)
nick-youngblut commented 1 year ago

rsconnect::forgetDeployment deployment fixed the issue. Maybe it would be helpful to provide that hint in the error:

Error: HTTP 404
  GET ${URL}/__api__/applications/${ID}
  The requested object does not exist.