rstudio / rsconnect

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

read.dcf error when using connectApiUser #515

Closed dewoller closed 1 year ago

dewoller commented 3 years ago

When I try to connectApIUser prior to batch publish an Rmd document, using the following command

rsconnect::connectApiUser(account = "XXX", server = "XXX", apiKey = "XXX")

I get the following error

Error in if (any(ind)) { : missing value where TRUE/FALSE needed

4: read.dcf(...)
3: readDcf(serverConfigFile(name), all = TRUE)
2: serverInfo(server)
1: rsconnect::connectApiUser(account = "XXX",
       server = "XXX", apiKey = "XXX")
>

The error persists after I delete all my dcf files in the project, and restart R. Suggestions?

kevinushey commented 3 years ago

Not sure if this is the underlying cause, but it looks like this can happen if read.dcf(<path>, all = TRUE) is called on an empty file; for example:

dcf <- tempfile(fileext = ".dcf")
file.create(dcf)
read.dcf(dcf, all = TRUE)

I see:

> dcf <- tempfile(fileext = ".dcf")
> file.create(dcf)
[1] TRUE
> read.dcf(dcf, all = TRUE)
Error in if (any(ind)) { : missing value where TRUE/FALSE needed

Is that true in your case? If so, the question would then become why that .dcf is empty at all...

aronatkins commented 3 years ago

That DCF file is located with rsconnect:::serverConfigFile; could you let us know if the referenced file is empty? The following code should help:

file.info(rsconnect:::serverConfigFile("SERVER_NAME"))
hadley commented 1 year ago

@dewoller we're happy to help, but there's not much we can do with out further information, so I'm closing this issue. If you do have more details, I'll be more than happy to re-open.