hannes / MonetDBLite

MonetDB reconfigured as a library
108 stars 10 forks source link

Failed initialization prohibits startup #17

Open hannes opened 8 years ago

hannes commented 8 years ago

Steps to Reproduce:

# # # R session one

library(DBI)
library(MonetDB.R)
library(MonetDBLite)

# you will need this same filepath in session two
( my_tempdir <- tempdir() )

db <- dbConnect( MonetDBLite() , my_tempdir )

# copy this folder path to clipboard
dput( my_tempdir )

# # # keep R session one open

# # # R session two

library(DBI)
library(MonetDB.R)
library(MonetDBLite)

# use the same `my_tempdir` as session one
my_tempdir <- [[use output of session one `dput` here]]

# expected error:
db <- dbConnect( MonetDBLite() , my_tempdir )
# Error in MonetDBLite::monetdb_embedded_startup(embedded, !getOption("monetdb.debug.embedded",  : 
  # Failed to initialize embedded MonetDB !FATAL: GDKlockHome: Database lock '.gdk_lock' denied

# # # CLOSE R session one

# # # remain in R session two

# still does not connect to database created in session one
db <- dbConnect( MonetDBLite() , my_tempdir )
# Error in MonetDBLite::monetdb_embedded_startup(embedded, !getOption("monetdb.debug.embedded",  : 
  # Failed to initialize embedded MonetDB !FATAL: BBPaddfarm: bad rolemask

# also does not connect to a different database..  
db <- dbConnect( MonetDBLite() , tempdir() )
# Error in MonetDBLite::monetdb_embedded_startup(embedded, !getOption("monetdb.debug.embedded",  : 
  # Failed to initialize embedded MonetDB !FATAL: BBPaddfarm: bad rolemask
monicarodguev commented 7 years ago

@hannesmuehleisen did you solve the error?

hannes commented 7 years ago

no not yet unfortunately.

monicarodguev commented 7 years ago

What we are thinking is happening is the bbdd got corrupted after forcing a query to stop. But is just our intuition.

teshomem commented 7 years ago

@hannesmuehleisen i think this a major issue using monetdb in shiny app.

solmanz commented 7 years ago

I am not sure if this is related. MonetDB doesn't work when I start shiny application from shiny server (browser). I get "ERROR: Failed to initialize embedded MonetDB !FATAL: BBPaddfarm: bad rolemask". It works when i start the shiny app from RStudio.

hannes commented 7 years ago

I have no experience with Shiny Server, but assume its trying to connect multiple R sessions to the same MonetDBLite folder?

solmanz commented 7 years ago

Yes, it is trying to connect multiple R sessions to same MonetDBLite directory. I have around 15GB csv formatted genomic data for visualisation (common issue in genomics field). I have tested different database solution including data table. MonetDB is the right and fastest database for this kind of shiny applications if it works. If this is fixable, I can write a white paper to show how MonetDBLite should be a choice for growing genomics data visualisation in R. I don't know what is it going to take to fix this but I can assure you that making MonetDBLite friendly with shiny will make it very popular in short period of time.

ajdamico commented 7 years ago

hi @solmanz just in case it's of any use: you can connect multiple R sessions to a single external mserver with ?MonetDBLite::MonetDB.R

solmanz commented 7 years ago

Thanks @ajdamico but i used that for connection when i get the error message. The problem is I don't know the root cause. It could be multiple R session or another.

ajdamico commented 7 years ago

i'm not sure this fix is high priority if you prefer to migrate to 0.5.0. thanx bud

hannes commented 7 years ago

its not and difficult to fix.

cboettig commented 6 years ago

I get this same error if an R session crashes. Starting a new session I can disconnect with MonetDBLite::monetdblite_shutdown() to free the .gdk_lock, and then I get this same error. I gather this means the database is corrupt at this point? Is recovery of the data possible?

hannes commented 6 years ago

@cboettig which error exactly?

cboettig commented 6 years ago

@hannesmuehleisen sorry I wasn't precise, thanks for the followup. After removing the .gdk_lock after the crash, I get the error:

ERROR: Failed to initialize embedded MonetDB !FATAL: BBPaddfarm: bad rolemask"

whenever I try to connect to my database.

hannes commented 6 years ago

@cboettig thats not great. Could you please open up a separate issue, since it seems unrelated to the issue discussed here.

cboettig commented 6 years ago

@hannesmuehleisen ok, thanks, will do. Would you prefer the issue here or over in https://github.com/hannesmuehleisen/MonetDBLite-R ?

hannes commented 6 years ago

@cboettig here is fine, also include some details (sessionInfo() output) and if you can a reproducible example please.