Navigation Menu

Skip to content
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

Error: Unable to retrieve package records for the following packages: - "grDevices", "graphics", "grid", "methods", "stats", "tools", "utils" #278

Closed
tbsund opened this issue Jun 4, 2018 · 30 comments

Comments

@tbsund
Copy link

tbsund commented Jun 4, 2018

I am getting this error when I try to deploy my shiny app to shinyapps.io:

Error: Unable to retrieve package records for the following packages:

  • "grDevices", "graphics", "grid", "methods", "stats", "tools", "utils"

These are all base packages so I can't use install.packages() for them, and the only libraries that are loaded in my shiny app are readxl, ggplot2, and reshape2 which are all CRAN packages.

@jspiewak
Copy link
Member

jspiewak commented Jun 7, 2018

Could you please include the full output of the deployment?
What is the output of rsconnect::appDependencies()?

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

Here is the output of the deployment:

rsconnect::deployApp('C:/Users/tsunderl/Desktop/folder')
Preparing to deploy application...DONE
Uploading bundle for application: 352639...Error: Unable to retrieve package records for the following packages:

  • "grDevices", "graphics", "grid", "methods", "stats", "tools", "utils"
    In addition: Warning messages:
    1: In FUN(X[[i]], ...) :
    Failed to infer source for package 'BH'; using latest available version on CRAN instead
    2: In FUN(X[[i]], ...) :
    3: In FUN(X[[i]], ...) :
    4: In FUN(X[[i]], ...) :
    5: In FUN(X[[i]], ...) :
    6: In FUN(X[[i]], ...) :
    7: In FUN(X[[i]], ...) :
    8: In FUN(X[[i]], ...) :

And here is the output of appDependencies:

rsconnect::appDependencies('C:/Users/tsunderl/Desktop/folder')
Error: Unable to retrieve package records for the following packages:

  • "grDevices", "graphics", "grid", "methods", "stats", "tools", "utils"
    In addition: Warning messages:
    1: In FUN(X[[i]], ...) :
    Failed to infer source for package 'BH'; using latest available version on CRAN instead
    2: In FUN(X[[i]], ...) :
    3: In FUN(X[[i]], ...) :
    4: In FUN(X[[i]], ...) :
    5: In FUN(X[[i]], ...) :
    6: In FUN(X[[i]], ...) :
    7: In FUN(X[[i]], ...) :
    8: In FUN(X[[i]], ...) :

Thanks!!

@jspiewak
Copy link
Member

jspiewak commented Jun 7, 2018

And what files are in 'C:/Users/tsunderl/Desktop/folder'?

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

My program, app.R, is the only file in the folder

@jspiewak
Copy link
Member

jspiewak commented Jun 7, 2018

@jmcphers any suggestions for tracking this down further?

@kevinushey
Copy link
Contributor

@tbsund, what is the output of:

ip <- as.data.frame(installed.packages(), stringsAsFactors = FALSE)
ip[ip$Priority %in% "base", ]

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

ip <- as.data.frame(installed.packages(), stringsAsFactors = FALSE)
ip[ip$Priority %in% "base", ]
[1] Package LibPath Version Priority Depends Imports
[7] LinkingTo Suggests Enhances License License_is_FOSS License_restricts_use
[13] OS_type Archs MD5sum NeedsCompilation Built
<0 rows> (or 0-length row.names)

@kevinushey
Copy link
Contributor

How did you install R? For some reason, R does not believe any of the installed packages have "base" priority. On my machine (with a CRAN binary of R on macOS) I see:

> ip <- as.data.frame(installed.packages(), stringsAsFactors = FALSE)
> ip[ip$Priority %in% "base", ]
            Package                                                        LibPath Version Priority Depends                    Imports LinkingTo                                 Suggests        Enhances         License License_is_FOSS
base           base /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                       <NA>      <NA>                                  methods            <NA> Part of R 3.5.0            <NA>
compiler   compiler /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                       <NA>      <NA>                                     <NA>            <NA> Part of R 3.5.0            <NA>
datasets   datasets /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                       <NA>      <NA>                                     <NA>            <NA> Part of R 3.5.0            <NA>
graphics   graphics /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                  grDevices      <NA>                                     <NA>            <NA> Part of R 3.5.0            <NA>
grDevices grDevices /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                       <NA>      <NA>                               KernSmooth            <NA> Part of R 3.5.0            <NA>
grid           grid /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>           grDevices, utils      <NA>                                  lattice            <NA> Part of R 3.5.0            <NA>
methods     methods /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>               utils, stats      <NA>                                codetools            <NA> Part of R 3.5.0            <NA>
parallel   parallel /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>            tools, compiler      <NA>                                  methods snow, nws, Rmpi Part of R 3.5.0            <NA>
splines     splines /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>            graphics, stats      <NA>                          Matrix, methods            <NA> Part of R 3.5.0            <NA>
stats         stats /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA> utils, grDevices, graphics      <NA> MASS, Matrix, SuppDists, methods, stats4            <NA> Part of R 3.5.0            <NA>
stats4       stats4 /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>   graphics, methods, stats      <NA>                                     <NA>            <NA> Part of R 3.5.0            <NA>
tcltk         tcltk /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                      utils      <NA>                                     <NA>            <NA> Part of R 3.5.0            <NA>
tools         tools /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                       <NA>      <NA>           codetools, methods, xml2, curl            <NA> Part of R 3.5.0            <NA>
utils         utils /Library/Frameworks/R.framework/Versions/3.5/Resources/library   3.5.0     base    <NA>                       <NA>      <NA>                methods, xml2, commonmark            <NA> Part of R 3.5.0            <NA>
          License_restricts_use OS_type MD5sum NeedsCompilation Built
base                       <NA>    <NA>   <NA>             <NA> 3.5.0
compiler                   <NA>    <NA>   <NA>             <NA> 3.5.0
datasets                   <NA>    <NA>   <NA>             <NA> 3.5.0
graphics                   <NA>    <NA>   <NA>              yes 3.5.0
grDevices                  <NA>    <NA>   <NA>              yes 3.5.0
grid                       <NA>    <NA>   <NA>              yes 3.5.0
methods                    <NA>    <NA>   <NA>              yes 3.5.0
parallel                   <NA>    <NA>   <NA>              yes 3.5.0
splines                    <NA>    <NA>   <NA>              yes 3.5.0
stats                      <NA>    <NA>   <NA>              yes 3.5.0
stats4                     <NA>    <NA>   <NA>             <NA> 3.5.0
tcltk                      <NA>    <NA>   <NA>              yes 3.5.0
tools                      <NA>    <NA>   <NA>              yes 3.5.0
utils                      <NA>    <NA>   <NA>              yes 3.5.0

@kevinushey
Copy link
Contributor

I'd also be curious to see what the output of:

tools:::.get_standard_package_names()

is. This sounds suspiciously similar to rstudio/packrat#381.

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

I downloaded it from the CRAN website. It is my work computer, so there's a chance it's a permissions issue. I'm the only R user in my office, so if you think the permissions is the issue, do you have any advice I could relay to IT to get it fixed? Everything, including my shiny app works fine on my computer, it is only deploying it that is an issue.

Her is that output:

tools:::.get_standard_package_names()
$base
[1] "base" "tools" "utils" "grDevices" "graphics" "stats" "datasets" "methods" "grid" "splines" "stats4"
[12] "tcltk" "compiler" "parallel"

$recommended
[1] "MASS" "lattice" "Matrix" "nlme" "survival" "boot" "cluster" "codetools" "foreign" "KernSmooth"
[11] "rpart" "class" "nnet" "spatial" "mgcv"

@kevinushey
Copy link
Contributor

kevinushey commented Jun 7, 2018

Strange -- can you share the whole output of:

installed.packages()

The only thing I can initially guess is that R somehow lacks permissions to read some of the package metadata required when querying installed.packages()...

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

Are either of these what you meant? I feel like neither are very informative...

install.packages()
Error in install.packages : argument "pkgs" is missing, with no default
install.packages
function (...)
.rs.callAs(name, hook, original, ...)
<environment: 0x00000000082a5c70>

@kevinushey
Copy link
Contributor

Sorry, I meant installed.packages() -- I since edited the post to update but not fast enough!

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

installed.packages()
Package LibPath Version Priority Depends Imports LinkingTo Suggests Enhances License License_is_FOSS License_restricts_use OS_type
Archs MD5sum NeedsCompilation Built

@kevinushey
Copy link
Contributor

That makes even less sense! What is the output of:

.libPaths()

on your machine? Are you actually able to load any of those packages? Does library(stats) succeed for you?

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

I edited the output a little just because I don't know much about stuff and didn't know if the network name is sensitive.

.libPaths()
[1] "\\network.corp/Personal$/tsunderl/My Documents/R/win-library/3.5"
[2] "\\network.corp/Personal$/tsunderl/My Documents/R/R-3.5.0/library"

and library(stats) did not give any error messages, so I assume it succeeds!

@kevinushey
Copy link
Contributor

Interesting. I can only guess that installed.packages() is failing to query the set of installed packages because your R libraries are located on a networked drive.

We could potentially work around this in Packrat.

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

Okay! How?

Btw, thanks for all your help! :)

@kevinushey
Copy link
Contributor

This will require some work on the Packrat side, so unfortunately there's nothing to be done on your side until we get those fixes in.

Can you by any chance provide the output of:

list.files(.libPaths()[1])

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018

list.files(.libPaths()[1])
[1] "assertthat" "base64enc" "bitops" "cellranger" "cli" "colorspace" "crayon"
[8] "dichromat" "digest" "file1ed43486f49" "file614128c20b7" "filea04566c4702" "filed8c64675d8" "ggplot2"
[15] "glue" "gtable" "htmltools" "httpuv" "jsonlite" "labeling" "later"
[22] "lattice" "lazyeval" "lme4" "magrittr" "MASS" "Matrix" "mime"
[29] "minqa" "munsell" "nlme" "nloptr" "packrat" "pillar" "PKI"
[36] "plyr" "promises" "R6" "RColorBrewer" "Rcpp" "RcppEigen" "RCurl"
[43] "readxl" "rematch" "reshape2" "RJSONIO" "rlang" "rsconnect" "rstudioapi"
[50] "scales" "shiny" "sourcetools" "stringi" "stringr" "tibble" "utf8"
[57] "viridisLite" "xtable" "yaml"

@kevinushey
Copy link
Contributor

Great! With that I should be able to get a workaround into Packrat.

@kevinushey
Copy link
Contributor

I have a candidate fix in Packrat now. Can you try installing the development version with:

if (!requireNamespace("devtools")) install.packages("devtools")
devtools::install_github("rstudio/packrat")

and let me know if you have any better luck with deployment?

@tbsund
Copy link
Author

tbsund commented Jun 7, 2018 via email

@kevinushey
Copy link
Contributor

Awesome! I'm glad to hear it :-)

@TMax66
Copy link

TMax66 commented Jun 28, 2018

HI, all
meet an analogue problem when try to deploy my app
I get this message:

Preparing to deploy application...DONE
Uploading bundle for application: 369321...Errore: 
* Application depends on package "MASS" but it is not installed.
   Please resolve before continuing.

any suggestion??

no solution in other topic https://community.rstudio.com/t/error-during-deploy-shiny-app/9604
Massimo
Thanks

@kevinushey
Copy link
Contributor

Can you confirm that an attempt to load the MASS package succeeds? E.g.

library(MASS)

In addition, what is the output of find.package("MASS")?

Does installing the latest version from CRAN with install.packages("MASS") help at all?

@TMax66
Copy link

TMax66 commented Jun 29, 2018

Hi Kevin,
yes I I tried them all..no success!

@kevinushey
Copy link
Contributor

What did you see in the R console after trying each of these steps?

@TMax66
Copy link

TMax66 commented Jun 29, 2018

HI Kevin
I tried to install again MASSand it seems that it works now....

thanks
Max

@jmcphers
Copy link
Member

Fixed on the packrat side; no work to do in rsconnect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants