-
Notifications
You must be signed in to change notification settings - Fork 112
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
app doesn't work in posit cloud #79
Comments
I have issues with rstudio server. I often get connection refused. Maybe it's related to the time needed to load the shiny app? What about adding this code after the # wait for the app to start
start_time <- as.numeric(Sys.time())
repeat {
r <- tryCatch(
httr::GET(glue::glue("http://{host}:{port}/")),
error = \(e) NULL
)
if (
as.numeric(Sys.time()) - start_time > 10 ||
(!is.null(r) && httr::status_code(r) < 300)
) {
break
}
Sys.sleep(0.2)
} That seems to solve the issue for rstudio server for me. |
You spotted my very unrealiable bug fix for linux 🥲 . Your code looks like a much better aproach in handling the wait for the app starting time. However, the bug I found is different and it seems related to the URL translation. Allow me to explain it better. In a new empty project when you have only installed
When 1 is not respected the URL is opened in the system's browser. Here is how it goes with the chatgpt app: gptstudio.bug.in.posit.cloud.mp4The addin is still running in the background, but it is not possible to get a valid translated URL, even if you run the following code while the app runs in the jobs panel: url <- "http://127.0.0.1:<port>"
rstudioapi::viewer(rstudioapi::translateLocalUrl(url)) However, if you manually close the app and restart the R session, you can create a fake app wrapping the relevant app modules. This is to get the Run App button in Rstudio. With this, you can choose to run the app in the Viewer pane. After that it is possible to inspect the URL with the format that the Viewer pane accepts. Video.sin.titulo.3.mp4I believe this is the format that |
There seems to be an unexpected manual fix for this. I don't know why this works but it does. After installation you need to relaunch the project. If you do this the addin runs with no problems. This is not the same as restarting the R session, I've tried that and it still fails if you don't relaunch the project. You can see it in action here (in Youtube because it was too long for Github): Maybe |
Your experience is similar to one I've seen on Posit Workbench. This might be an artifact of working on RStudio server environments in general. Best approach might be to get this issue in from of the team at Posit support Cloud and Workbench. |
I'm thinking on closing this since downloading from CRAN works after restarting the R session (no longer requires to Relaunch project). @JamesHWade Can you test on Posit Workbench to confirm? If not, we still can close this until someone reports on Posit Workbench. |
Closing until someone reports something similar |
There seems to be an issue in
open_bg_shinyapp()
. The translated URL sometimes works fine and sometimes opens an external browser with an unexpected URL that leads nowhere. This was tried multiple times in different blank posit cloud projects.The text was updated successfully, but these errors were encountered: