Shiny server not working after update to 1.5 - r

I had a shiny app working using shiny-server 1.4.2.786 and after upgrading to 1.5.9.923 and I get the following error:
Error in if (nchar(bookmarkStateDir) > 0) { :
missing value where TRUE/FALSE needed
Calls: local -> eval.parent -> eval -> eval -> eval -> eval
Execution halted
If I roll back to 1.4.2.786, everything works as expected, therefore I don't think it's an issue with permissions or general shiny config files. Any idea what this is due to? I couldn't find any solutions online, however, I did read that 1.5 introduces big changes in Node.js, so perhaps this causes errors? Thanks!

Related

Write and Read keys in rEnvironment in Shiny

can someone help me with this?
Im setting up a map with maptiles by mapbox on shinyapps.io.
I saved the mapbox token in the rEnvironment. This command is not in the server-side of shiny and is run just once, when starting the script. Followed by readRenviron("~/.Renviron") to load all keys etc.
In the server-side before needed in leaflet I call Sys.getenv("MAPBOX_PUBLIC_TOKEN")
I get this error and the application shuts down
2022-11-28T08:26:09.047038+00:00 shinyapps[7740855]: A MAPBOX_PUBLIC_TOKEN already exists. You can overwrite it with the argument overwrite=TRUE 2022-11-28T08:26:09.047050+00:00 shinyapps[7740855]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> 2022-11-28T08:26:09.047054+00:00 shinyapps[7740855]: Execution halted
Is it the wrong way around? I tried many different ways.

Error in enforcePackage(name, curVersion) : The shiny package was not found in the library

I'm trying to deploy a shiny app to shinyapps server. the app works just fine locally and when deploying using rsconnect::deployApp() I can see the message Application successfully deployed to in the console but actually on browser is not working and showing the following:
Error in enforcePackage(name, curVersion) : The shiny package was not found in the library. Calls: local ... eval -> eval -> eval -> <Anonymous> -> enforcePackage. Execution halted
Shiny package is loaded of course.
Also when trying to run rsconnect::appDependencies() the following error pop-up :
Error in [.data.frame(deps, , "Package") : undefined columns selected
Thank you all in advance for your help

gzfile error when publishing Shiny app

I'm trying to publish an R Shiny app. It works when run locally, but once published to shinyapps.io produces the following error.
Warning in gzfile(file, "wb") :
cannot open compressed file '/key.rda', probable reason 'Permission denied'
Error in value[[3L]](cond) : cannot open the connection
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
You can also see the actual page with the error here: https://povertylab.shinyapps.io/ACS-Map-Dashboard/
Though I have tried to reproduce this error it doesn't appear when I publish other apps, and my searches haven't turned up anything. Other things I've tried: publishing from other computers, publishing only global.R, server.R, and ui.R files, and copying files to a new project and publishing from there.
You can find all code for the app here: https://github.com/Poverty-Lab/ACS-Map-Dashboard
I would appreciate any input, even if it's just guidance on what gzfile is and what the error message could mean. Thank you!
Where is the key.rda file supposed to be? I've looked through your repo and I don't see it, which is probably causing the "cannot open the connection" error.
As a side note, you should probably ignore the .Renviron file; right now anyone can use see and use your key. Make sure you remove it from the history as well.
Thanks all. Turns out this was a problem with the way we were handing the api key for the acs package. We were using api.key.install to install the api key inside the app, and one of api.key.install's default arguments is file = "key.rda", and that file apparently could not be found. I'm still not sure why this problem only came up when we published the app, but we got around it by supplying the actual api key to the acs.fetch function in server.R.

Error in x[[method]](...) : attempt to apply non-function in testthat test when sourcing file

I am developing an R app and came up with a workaround to integrate testthat in it (it usually requires your project to be a package) by adding a DESCRIPTION file to the project root.
I got this method from a colleague who managed to get it to work like this.
The problem is, when I try to test anything (even empty test files), I get this error:
Error in x[[method]](...) : attempt to apply non-function
Calls: <Anonymous> ... <Anonymous> -> o_apply -> lapply -> FUN -> <Anonymous>
Execution halted
What I know is that this appears only on macOS. My colleague can still run this app without problems on Windows.
What's the deal with it?
The MCVE for reproducing this error would be:
create a minimum DESCRIPTION file with content:
Package: testpckg
add testthat to your project:
usethis::use_testthat()
usethis::use_test("foo")
create empty file bar.R
in test-foo.R, source bar: source("bar.R")
RStudio Version 1.1.447,
R version 3.4.4, Mac OS X 10_13_4
This appears to be due to a bug in testthat 2.0.0. Adding a context("Name of test context") to the top of each test file worked for me (tested using Ubuntu and Windows).

The app is disconnected after a second

I ran shiny app in linux.
I open the browser in the url: http://192.241.147.231:4949/sample-apps/MonitorUI/
The page is open but after a second disconnected.
I check the log file and it write to me this massage:
Error in eval(expr, envir, enclos) :
You are attempting to load an rmarkdown file, but the
rmarkdown package was not found in the library. Ensure that
rmarkdown is installed and is available in the Library of the
user you're running this application as.
Calls: local -> eval.parent -> eval -> eval -> eval -> eval
Execution halted
I already downloaded the "rmarkdown" package. and it updated.
What is the problem? i don't find anything for this problem in the web.
the sample app that given by shiny-server package:http://192.241.147.231:4949/sample-apps/hello/ is working so what is the problem?
Thanks.

Resources