rstudio / rsconnect

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

`showLogs()` not working for applications published to posit.cloud #801

Closed jacpete closed 1 year ago

jacpete commented 1 year ago

Steps to Reproduce

I published the 'Old Faithful' application from a posit.cloud project to posit.cloud with the name 'testApp'. My posit.cloud directory is set up as the following:

├── project.Rproj └── testApp    ├── app.R    └── rsconnect      └── posit.cloud         └── \<jacpete account>           └── testapp.dcf

I then tried to run showLogs() with a variety of different potential parameter combinations:

rsconnect::showLogs()
rsconnect::showLogs(appName = 'testApp')
rsconnect::showLogs(appPath = 'testApp')
rsconnect::showLogs(appPath = 'testApp', account = '<jacpete account> ', server = 'posit.cloud')

All of these return the following error:

No application found. Specify the application's directory, name, and/or associated account.

I noticed these values of potential interest in the testapp.dcf file:

aronatkins commented 1 year ago

With latest (516fb9cad24568ea502af784dad0e670f1f2f78b), we get similar errors:

> rsconnect::showLogs(account = "aronatkins", server = "posit.cloud")
Error in rsconnect::showLogs(account = "aronatkins", server = "posit.cloud") : 
  No application found. Specify the application's directory, name, and/or associated account.
> rsconnect::showLogs(appPath = ".", appName = "shiny", account = "aronatkins", server = "posit.cloud")
Error in `rsconnect::showLogs()`:
! Supplied `appId` (shiny) does not match deployment record (8684704).
ℹ Omit `appId` to use existing for deployment for app , or
ℹ Omit `appName` to create new deployment record.
Run `rlang::last_trace()` to see where the error occurred.

This issue is caused by cross-wiring fields from showLogs to deploymentTarget; the name is being passed as the id: https://github.com/rstudio/rsconnect/blob/516fb9cad24568ea502af784dad0e670f1f2f78b/R/applications.R#L218-L222

aronatkins commented 1 year ago

The same problem with deploymentTarget exists in:

hadley commented 1 year ago

I also noticed and fixed this problem in #794

hadley commented 1 year ago

FWIW even once this bug is fixed, I don't think showLogs() will work as the documentation says This function only uses the \code{libcurl} transport, and works only for ShinyApps servers.