RMariaDB Error fetching buffer:


#1

I’m trying to use an SQL database on Shiny-Server for the first time. Shiny-Server and the database (MariaDB) are running on the same Amazon Lightsail LInux instance. I can see the database remotely using HeidiSQL, so I’m convinced it’s up and running. The program crashes at the first place it tries to access the database. (The code runs fine locally on Win7 with a local MySQL database).

Here’s the code in that area:

root.pool <- dbPool(
   drv = RMariaDB::MariaDB(),
   host = "localhost",
   user = "root",
   password = SQL.Passwords[1]
)
zzz = onStop(function() { poolClose(root.pool) } )

print("Getting SQL.DBs...")
SQL.DBs <- dbGetQuery(root.pool, "SHOW DATABASES")
print(SQL.DBs)

The print(“Getting SQL.DBs…”) appears in the log and the following print() doesn’t, so I think this is where the program stops. That would make sense anyhow, since it’s the first spot I use a DBI function.Here’s the error log:

[1] "Getting SQL.DBs..."
Warning: Error in result_fetch: Error fetching buffer: 
Stack trace (innermost first):
    56: <Anonymous>
    55: stop
    54: result_fetch
    53: sqlColumnToRownames
    52: .local
    51: dbFetch
    50: dbFetch
    49: .local
    48: DBI::dbGetQuery
    47: DBI::dbGetQuery
    46: dbGetQuery
    45: dbGetQuery
    44: eval
    43: eval
    42: withVisible
    41: source
     1: runApp
Error : Error fetching buffer:

Does anyone have any thoughts on what I need to do next?


#2

Although my instance had about 12% of its 1Gig of memory free, I thought it might be an out-of-memory error. So I tried it on a 2Gig instance but got the same error.

Then I discovered this is an issue with the RMariaDB package that is still open.

So I switched to the combination of MySQL 5.7 (rather than MariaDB) and the RMariaDB package (which is a successor to the RMySQL package).

However, RMariaDB wouldn’t install because there was one file in an unexpected location. After finding it and setting up the following symbolic link, RMariaDB installed and everything seems to be working now, although with MySQL rather than MariaDB.

sudo ln -s /usr/lib64/mysql57/libmysqlclient.so.1020 /usr/lib64/libmysqlclient.so.1020

Tom