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

lazy-load database 'P' is corrupt #3

Open
phillip-burger-sculpturearts opened this issue Jul 18, 2014 · 4 comments
Open

lazy-load database 'P' is corrupt #3

phillip-burger-sculpturearts opened this issue Jul 18, 2014 · 4 comments

Comments

@phillip-burger-sculpturearts

Encountered below error. Any suggestions on how to resolve appreciated.

shiny::runApp()
Error in get(Info[i, 1], envir = env) : lazy-load database 'P' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

@wch
Copy link
Owner

wch commented Jul 18, 2014

The internal error -3 often happens when you use install_github to install a package that's currently loaded; try restarting R and running the app again.

@jdthorpe
Copy link

jdthorpe commented Apr 5, 2016

I find that this occurres when calling library(foo) for the second time when the library foo has been updated in between library() calls using any of the devtools install methods, as in:

# Load my super cool user package:
devtools::install('path/to/my/package')
library(MyPackage)

# do some testing in R ...

# find a bug in my R code ...

# edit the package code to fix a bug I found ...

# reload the package:
devtools::install('path/to/my/package')
library(MyPackage) 
#> Error in get(method, envir = home) : 
#>   lazy-load database 'C:/Users/User/Documents/R/win-library/3.2/MyPackage/R/MyPackage.rdb' is corrupt
#> In addition: Warning messages:
#> 1: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4],  :
#>   restarting interrupted promise evaluation
#> 2: In get(method, envir = home) :
#>   restarting interrupted promise evaluation
#> 3: In get(method, envir = home) : internal error -3 in R_decompress1
#> Error: package or namespace load failed for ‘MarketQualityQuery’

Of course, you have to have an error in the library somewhere for this to occur. The most reliable way I've found to generate such an error is to comment out an Roxygen comment block and call devtools::document() and then devtools::install(). For example, If you have a function in your package like this one:

#' A function
#' 
#' This is a function.
#' 
#' @param x A parameter
#' 
#' @export
foo <- function(x)
    print(x)

and you comment out the comments like so:

#-- #' A function
#-- #' 
#-- #' This is a function.
#-- #' 
#-- #' @param x A parameter
#-- #' 
#-- #' @export
foo <- function(x)
    print(x)

and then you call :

devtools::document('path/to/my/package')
devtools::install('path/to/my/package')
library(MyPackage)

you'll get an the above error message, and devtools::install will clobber
your package, requiring that R be re-started each time you want to re-load your
library (which makes the process of debugging your package slooooow).

@wch
Copy link
Owner

wch commented Apr 6, 2016

I think if you're using a newer version of devtools, this shouldn't be an issue anymore. See r-lib/devtools#1001

@romunov
Copy link

romunov commented May 9, 2019

We've had similar issue with building a docker image. The packages are being built as a dependency so it would be pretty cumbersome to install dependencies first where order could be somewhat controlled. We've had this issue with assertthat package (everything worked two weeks ago).

Error in run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout),  : 
  lazy-load database '/usr/local/lib/R/site-library/assertthat/R/assertthat.rdb' is corrupt
Calls: install_github ... with.default -> eval -> eval -> with_envvar -> force -> run
In addition: Warning message:
In run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout),  :
  internal error -3 in R_decompress1
Execution halted
xargs: bash: exited with status 255; aborting

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

4 participants