Error in fetch(key) : lazy-load database
Asked Answered
H

7

108

I don't know what is going on, everything was working great but suddenly I started to have this error message on the documentation:

Error in fetch(key) : lazy-load database '......descopl.rdb' is corrupt

I removed almost all my code and build again then publish to Github, but when I use the other laptop to download the package, the package is being downloaded and loaded but I can't call any of the functions, and the documentation states that error.

I don't know what caused the problem, I am using roxygen to generate the documentation.

https://github.com/WilliamKinaan/descopl

Halbeib answered 24/5, 2015 at 14:28 Comment(3)
you could give a link to the repo. and exactly how you created the rdbFermata
@Fermata here you go github.com/WilliamKinaan/descoplHalbeib
I don't see major things wrong with your r package. I'm not sure why you have two scripts with copies of the same functions -- just keep the one with the roxygen docs. preprocessing should not be at top-level, move it to inst/preprocessing. And you should delete the read-and-delete-me file. Otherwise, it just seems like your .rdb is corrupt.. like the error says. Plus you didn't specify how you created itFermata
S
155

It seems that the error arises when the package cannot be decompressed by R (as @rawr established, it is corrupt). This solutions have worked for me:

1) Check for possible errors in the creation of the .Rdb files

2) Try restarting your R session (e.g. .rs.restartR() if in RStudio)

3) The package might have been installed in your computer (even though it does not work). Remove it using ?remove.packages()

Selfrenunciation answered 30/11, 2015 at 21:29 Comment(3)
my site restarted and devtools::install_github('WilliamKinaan/descopl') is working fine.Searching
In RStudio you can restart R with .rs.restartR() which will restore your session (variables, libraries) but fixes the .rdb' is corrupt issue.Patronymic
thank you,this worked for me while using magick library!Dinodinoflagellate
R
8

I have had this problem with roxygen2 as well. Couldn't see any problem with any of my functions. In the end deleting the .rdb file and then getting roxygen2 to rebuild it seemed to solve the problem.

Ramonramona answered 9/6, 2015 at 9:6 Comment(0)
G
6

I think the explanation for what is causing this is here. It's related to devtools. Per @Zfunk

cd ~/Rlibs/descopl/help
rm *.rdb

Restart R. Look at the help for the package again. Fixed!

Gus answered 17/1, 2017 at 7:40 Comment(0)
B
6

I received this error after re-installing a library whilst another R session was running.

Simply restarting the existing R session(s) solved for me (i.e. running .rs.restartR() to restart the sessions)

Bright answered 14/4, 2020 at 10:11 Comment(0)
M
5

Basically all answers require restarting R to resolve the issue, but I found myself in an environment where I really didn't want to restart R.

I am posting here a somewhat hack-ish solution suggested by Jim Hester in a bug report about the lazy-load corruption issue.

The gist of it is that the package may have some vestigial S3 methods listed in session's .__S3MethodsTable__. environment. I don't have a very systematic way of identifying which S3 methods in that environment come from where, but I think a good place to start is the print methods, and looking for S3method registrations in the package's NAMESPACE.

You can then remove those S3 methods from the .__S3MethodsTable__. environment and try again, e.g.

rm(list="print.object", envir = get(".__S3MethodsTable__.", envir = baseenv()))

You may also need to unload some DLLs if some new messages come up like

no such symbol glue_ in package /usr/local/lib/R/site-library/glue/libs/glue.so

You can check getLoadedDLLs() to see which such files are loaded in your session. In the case of glue here, the following resolved the issue:

library.dynam.unload('glue', '/usr/local/lib/R/site-library/glue')
Martins answered 9/7, 2020 at 9:29 Comment(0)
W
2

If you are using R-studio: 1) ctrl+shift+f10 to restart r session 2) tools -> Check for package updates -> update all packages 3) library(ggmap)

Problem is solved.

Washtub answered 4/7, 2019 at 0:22 Comment(0)
S
0

I got this error on RStudio on mac OS - updating all the packages and restarting r session did the trick.

Subdued answered 12/6, 2020 at 22:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.