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

is not a valid R package, it is an empty archive #518

Closed
royfrancis opened this issue Jul 2, 2023 · 10 comments
Closed

is not a valid R package, it is an empty archive #518

royfrancis opened this issue Jul 2, 2023 · 10 comments

Comments

@royfrancis
Copy link

royfrancis commented Jul 2, 2023

Getting this error with some packages. As an example;

>> pak::pkg_install("patchwork")
                                                                       
→ Will install 1 package.
→ Will download 1 CRAN package (3.19 MB).
+ patchwork   1.1.2 [bld][dl] (3.19 MB)
ℹ Getting 1 pkg (3.19 MB)
✔ Got patchwork 1.1.2 (source) (3.19 MB)                               
✔ Downloaded 1 package (3.19 MB)in 946ms                               
ℹ Building patchwork 1.1.2
✔ Built patchwork 1.1.2 (4.1s)                                       
Error:                                                                 
! error in pak subprocess
Caused by error in `verify_extracted_package(filename, pkg_cache)`:
! '/tmp/Rtmp7LxpdS/file95fd9c3dbb/patchwork_1.1.2_R_x86_64-pc-linux-gnu.tar.gz' is not a valid R package, it is an empty archive

It works with install.packages().

>> install.packages("patchwork")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/patchwork_1.1.2.tar.gz'
Content type 'application/x-gzip' length 3192018 bytes (3.0 MB)
==================================================
downloaded 3.0 MB

* installing *source* package ‘patchwork’ ...
** package ‘patchwork’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location

** testing if installed package keeps a record of temporary installation path
* DONE (patchwork)

The downloaded source packages are in
	‘/tmp/RtmpnFKcDc/downloaded_packages’
>> sessionInfo()
R version 4.2.3 (2023-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

loaded via a namespace (and not attached):
 [1] prettyunits_1.1.1 pak_0.5.1         ps_1.7.5         
 [4] crayon_1.5.2      rprojroot_2.0.3   pkgdepends_0.5.0 
 [7] R6_2.5.1          jsonlite_1.8.4    zip_2.3.0        
[10] cli_3.6.1         rstudioapi_0.14   callr_3.7.3      
[13] filelock_1.0.2    desc_1.4.2        tools_4.2.3      
[16] glue_1.6.2        compiler_4.2.3    processx_3.8.1   
[19] pkgbuild_1.4.0    lpSolve_5.6.18  

>> options("repos")
$repos
                                                    CRAN 
                          "https://cloud.r-project.org/" 
                                                BioCsoft 
           "https://bioconductor.org/packages/3.16/bioc" 
                                                 BioCann 
"https://bioconductor.org/packages/3.16/data/annotation" 
                                                 BioCexp 
"https://bioconductor.org/packages/3.16/data/experiment" 
                                               CRANextra 
                   "https://www.stats.ox.ac.uk/pub/RWin" 

Running in RStudio Server in a docker container.

RStudio Server 2023.03.0 Build 386

@gaborcsardi
Copy link
Member

Are you sure that you are not running out of disk space?

@royfrancis
Copy link
Author

As far as I can see, there is plenty of disk space. Even if it was the disk space, the regular install.packages() command works immediately after.

@gaborcsardi
Copy link
Member

gaborcsardi commented Jul 3, 2023

Pak uses more disk space because it has a cache and it creates a binary package first.

@royfrancis
Copy link
Author

It's a new laptop and there is more than a TB of space. I am hoping the docker container I am running has access to all that. I haven't defined any restrictions.

@gaborcsardi
Copy link
Member

What OS do you have on the host? Ie on the laptop itself?

@royfrancis
Copy link
Author

royfrancis commented Jul 3, 2023

It's a MacBook Pro M2.

aarch64-apple-darwin20.0.0 (64-bit)
macOS Ventura 13.4.1

@gaborcsardi
Copy link
Member

Then Docket does not have access to that space. You can see the amount of empty space and you can also make it bigger in the Docker dashboard. And/or you can run 'docker system prune' to remove unused images and containers.

If this does not work then can you please share your Dockerfile?

@royfrancis
Copy link
Author

royfrancis commented Jul 3, 2023

Interesting! So, I looked into disk usage and it was by default set to 64GB. But only 43GB of 64GB was used. So, it probably shouldn't be limiting. Anyhow, I increased it to 200GB. Restarted docker and the container and tried the installation again. Same error! I will put together a Dockerfile that I can share.

@royfrancis
Copy link
Author

Tried again with a new Dockerfile, image and container and it works!

@gaborcsardi
Copy link
Member

It would be good to know why the first file didn't work. Do you think you can share that?

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

2 participants