Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page

** Fatal ** The SQLite database failed to open.

I'm getting an intermittent failure using ep-launch to run a energyplus 9.0 simulation. Sometimes no err file is generated, and sometimes this err file is generated.

Link to file showing sqlite error

Program Version,EnergyPlus, Version 9.0.1-bb7ca4f0da, YMD=2019.01.03 08:16,
**  Fatal  ** The SQLite database failed to open.
...Summary of Errors that led to program termination:
..... Reference severe error count=0
..... Last severe error=
************* Warning:  Node connection errors not checked - most system input has not been read (see previous warning).
************* Fatal error -- final processing.  Program exited before simulations began.  See previous error messages.
************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
************* EnergyPlus Terminated--Fatal Error Detected. 0 Warning; 0 Severe Errors; Elapsed Time=00hr 00min  1.03sec


I have no idea what's causing it. Everything was running fine yesterday. I'm hoping it just goes away, but any idea what I can do to troubleshoot?

In response to @shorowit's comment

Here is the whole err file. Not all of it was overwritten, and there are a ton of characters notepad++ is displaying as NUL.

edit retag close merge delete

Are you working on a network drive or cloud or something? The quickest thing you can do is to go delete the SQL file before you relaunch the simulation...

( 2019-01-03 10:41:54 -0600 )edit

Also, make sure the SQL file isn't open in another program or process (e.g. script). OpenStudio won't overwrite it during a sim if that's the case.

( 2019-01-03 11:03:55 -0600 )edit

@Julien Marrec I am running energyplus on my personal computer locally with local file access. I tried deleting all the files related to the simulation besides the idf file. The problem is still intermittent.

( 2019-01-04 10:11:05 -0600 )edit

@MatthewSteen As far as I can tell, the file is not open anywhere else. Also, I am not using openstudio.

( 2019-01-04 10:11:59 -0600 )edit

Is there any additional information in the sqlite.err file?

( 2019-01-04 11:06:12 -0600 )edit

Sort by » oldest newest most voted

Digging into the source code, this fatal error line only appears in SQLiteProcedures.cc if the variable ok is set to false. Above this line, ok is initialized to true, and then followed by series of 5 if checks that can reset ok to false and result in the fatal error you are seeing. The order of these checks are:

• Test if EnergyPlus can write to the SQLite error file
• Test if EnergyPlus can create a new SQLite file
• Test if EnergyPlus can write to the SQLite file
• Test if the SQLite file is locked
• Open the SQLite file so that EnergyPlus can write simulation outputs to it

I would recommend opening the SQL file after a failed run to search for any error messages. You can open this in a text editor, but it would be easier to navigate in a database GUI. A free tool like sqliteman, or a free trial of a commercial tool like RazorSQL are some options.

@Kyle Benne seems to be the last person to alter this source code, maybe he can chime in. It is definitely interesting that just by running the same IDF a number of times, this fatal error eventually goes away on its own. I'm guessing that for the initial runs that fail, the SQLite file is locked or EnergyPlus cannot open it.

more

Not a great workaround, but here's what I did. The problem is intermittent, so I just kept running the simulations that failed until the "The SQLite database failed to open" error didn't occur and the simulation ran to completion. The failed runs tended to fail very quickly, so not a huge waste of time. Still no idea what causes it though.

more