Python error: cannot operate on a closed database

880 views
Skip to first unread message

Whitney Lisenbee

unread,
Jun 1, 2022, 3:37:21 PM6/1/22
to QSWAT+

Hello! I got this error when trying to delineate a watershed from an existing watershed. It seemed like strange python bug so I tried starting a new QSWAT+ project from scratch but I received the same error at the create streams stage. 

I am not sure what I can do about a programming error. Is this just a bug or can we troubleshoot around it?


2022-05-31T12:09:25     WARNING    Traceback (most recent call last):
              File "C:\Users/whitn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_9\QSWATPlus\globals.py", line 475, in writeProjectConfig
              cur = conn.cursor()
             sqlite3.ProgrammingError: Cannot operate on a closed database.
             
             During handling of the above exception, another exception occurred:
             
             Traceback (most recent call last):
              File "C:\Users/whitn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_9\QSWATPlus\delineation.py", line 1505, in runTauDEM1
              self.runTauDEM(None, False)
              File "C:\Users/whitn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_9\QSWATPlus\delineation.py", line 1548, in runTauDEM
              self._gv.writeProjectConfig(0, 0)
              File "C:\Users/whitn/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATPlus3_9\QSWATPlus\globals.py", line 515, in writeProjectConfig
              conn.commit()
             sqlite3.ProgrammingError: Cannot operate on a closed database.
             

Antonio Carmona

unread,
Jun 8, 2022, 11:28:34 AM6/8/22
to QSWAT+
Hello,
I would review the limits and extension of the DEM. In my case, this error appeared because a vertex of the basin did not have its DEM pixel. It was a bit smaller and i couldn't see it.  I suppose the coordinate system is the same.
Best
Reply all
Reply to author
Forward
0 new messages