0

I have a flexdashboard which queries from a local DuckDB (similar to SQLite) but every so often it says:

Warning: Error in initialize: duckdb_startup_R: Failed to open database

There is no "onStop dbdisconnect" style command in my code (I'm not sure where to put it in flexdashboard) so it doesn't shut down correctly if my R instance crashes. My only solution is to restart the computer. How can I fix this?

HCAI
  • 2,213
  • 8
  • 33
  • 65
  • 1
    I put ```onStop dbdisconnect``` right after ```dbConnect```. – José Mar 04 '21 at 11:45
  • Thanks José. Could you put the exact code you use please? flexdashboard doesn't seem to recognise onStop. – HCAI Mar 04 '21 at 13:39
  • 2
    Funny, I read shinydashboard, by anyway gave it a try with flexdashboard and it worked: https://gist.github.com/jjesusfilho/d7ed3254d6ea5c6c5bdf1b798aebc020 – José Mar 04 '21 at 14:27
  • Thank you, so far, flex hasn't complained about not being able to open the connection. – HCAI Mar 04 '21 at 19:54

0 Answers0