Shinyapps.io deploy error - 409 Application exists with name

Hi,

Have been successfully deploying several apps for a while with no issues, but I've just started getting the following error on deploys for a few different shiny apps that I'm trying to deploy to shinyapps.io:

Warning message:
renv took longer than expected (20 seconds) to activate the sandbox.

The sandbox can be disabled by setting:

    RENV_CONFIG_SANDBOX_ENABLED = FALSE

within an appropriate start-up .Renviron file.

See `?renv::config` for more details. 
── Preparing for deployment ────────────────────────────────────────────────────
✔ Deploying "dev-ufs-skills-data-catalogue" to "server: shinyapps.io / username: ..."
ℹ Creating application on server...
Error in `POST()`:
! <https://api.shinyapps.io/v1/applications/> failed with HTTP status
  409
Application exists with name: dev-ufs-skills-data-catalogue
Backtrace:
    ▆
 1. └─rsconnect::deployApp(...)
 2.   └─client$createApplication(...)
 3.     └─rsconnect:::POST_JSON(service, authInfo, "/applications/", json)
 4.       └─rsconnect:::POST(...)
 5.         └─rsconnect:::httpRequestWithBody(...)
 6.           └─rsconnect:::handleResponse(httpResponse, error_call = error_call)
 7.             └─rsconnect (local) reportError(json$error)
 8.               └─cli::cli_abort(...)
 9.                 └─rlang::abort(...)
Execution halted
Error: Process completed with exit code 1.

I'm assuming the renv warning isn't relevant, but including just in case. I tried adding forceUpdate=TRUE to the deploy command, but that didn't help.

Any ideas on what's causing the deploy to not want to overwrite the existing app in this case?

Many thanks.

same issue here - tried multiple times since last night (July 23, 2023)

Update:

Downgrading rsconnect via remotes::install_version("rsconnect", "0.8.29") solves the issue - see this post. Hope it also helps on your end, @richbielby.

2 Likes

Same issue here. Downgrading rsconnect to "0.8.29" also solved the issue.

Any news on this? Since shinyapps.io [dropped the support for rsconnect < 1.0.1]( Notice – Posit Cloud/shinyapps.io dropping support for rsconnect < 1.0.1 - shiny / shinyapps.io - Posit Community (rstudio.com)), downgrading does not help anymore. It seems that the forceUpdate = TRUE is not doing its job?

This has been fixed in rsconnect 1.0.2, which was published just last week. Have you tried upgrading?

Thanks for your quick reply! I have tried with the latest rsconnect and it does not work.

In this repo I have installed the latest rsconnect version (1.0.2), but still get the HTTP 409 error. I am using R version 4.2.1 for consistency reasons, as this is what we have in our development environment. However, using the latest rocker/R version also does not help. Do you have any ideas?

I think I have the same problem here (Debian Buster with R 3.5.2).

Everything was fine till 2 days ago.
Then rsconnect stops and tells me that I need to update the package (don't remember the exact message).
I update to 1.0.2.
Now both showProperties() and showLogs() give a "! Couldn't find any deployments matching supplied criteria."
applications(), accounts() and accountInfo() show the right information, token included.

2 Likes

I have the similar issue, I updated to 1.0.2. and I get
── Preparing for deployment ────────────────────────────────────────────────────
Error in rsconnect::deployApp():
! This directory has been previously deployed in multiple places.
Please use appName, server or account to disambiguate.
Known applications:
• Spawner_Recruit_Bayes (server: shinyapps.io / userrname: XXXXX)
• Spawner_Recruit_Bayes (server: shinyapps.io / username: XXXXX):
Backtrace:

1 └─rsconnect::deployApp(...)
2 └─rsconnect:::deploymentTarget(...)
3 └─rsconnect:::disambiguateDeployments(appDeployments, error_call = error_call)
4 └─rsconnect:::cli_menu(...)
5 └─cli::cli_abort(c(header, not_interactive), .envir = .envir, call = error_call)
6 └─rlang::abort(...)
Execution halted

Hi @hhamazaki , as the error suggests, have you specified an appName with deployApp?

rsconnect::deployApp(forceUpdate = TRUE,
                     appName = "some_name")

I have the same issue. I've updated RStudio to latest version. Have similarly updated rsconnect to 1.0.2.

── Preparing for deployment ────────────────────────────────────────────────────
Error in `rsconnect::deployApp()`:
! This directory has been previously deployed in multiple places.
Please use `appName`, `server` or `account` to disambiguate.
Known applications:
• IdiographicNetworkModels (server: shinyapps.io / username: hulsmans):
  <https://hulsmans.shinyapps.io/IdiographicNetworkModels/>
• IdiographicNetworkModels (server: shinyapps.io / username: hulsmans):
  <https://hulsmans.shinyapps.io/IdiographicNetworkModels/>
Backtrace:
    ▆
 1. └─rsconnect::deployApp(...)
 2.   └─rsconnect:::deploymentTarget(...)
 3.     └─rsconnect:::disambiguateDeployments(appDeployments, error_call = error_call)
 4.       └─rsconnect:::cli_menu(...)
 5.         └─cli::cli_abort(c(header, not_interactive), .envir = .envir, call = error_call)
 6.           └─rlang::abort(message, ..., call = call, use_cli_format = TRUE)
Execution halted

Try running renv::init() then renv::refresh()

Then try publishing!

Hi @shaenzi
No I have never specified an appNmame. I am simply clidking RStudio Publish to Server Icon. Things I updated previously was separating file from single app.r to server.R and ui.R. So, in a way, I published to the server , either from single app.R, ui.R, and server.R from the same directory where the file is located. If that helps.

Is there some reason install.packages("rsconnect") still pulls the older version, and we have to use install_version to get the latest, without which we can no longer deploy to shinapps.io?

Posit retracted it. downgrading rsconnect to 0.8.29" works again.

1 Like

I think the installation takes your R version into account, and installs the version of the package that somehow fits (maybe was built under?) your R version.

downgrading version of Rsconnect worked on my side - thanks!

1 Like