Error : unable to open database file

283 views
Skip to first unread message

Sandeep Kumar

unread,
Jun 26, 2014, 5:29:05 PM6/26/14
to web...@googlegroups.com
Hi,
     I am getting this strange error one in 10 times in my app. The error is "<class 'sqlite3.OperationalError'> unable to open database file". I am getting this error after i replaced the databases folder with one from my backup app which is running on a different server. I think the plugin_wiki is has some problem. I want to uninstall this plugin_wiki and reinstall it but then i fear of losing all the pages that were created using plugin_wiki. Can someone help me out on this?

The error traceback is as follows : 

     Traceback (most recent call last):
  File "/backup1/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
File "/backup1/web2py/applications/lims/models/plugin_wiki.py", line 715, in <module>
plugin_wiki=PluginWiki()
File "/backup1/web2py/applications/lims/models/plugin_wiki.py", line 534, in __init__
code_page = db(db.plugin_wiki_page.slug=='meta-code').select().first()
File "/backup1/web2py/gluon/dal.py", line 9958, in select
return adapter.select(self.query,fields,attributes)
File "/backup1/web2py/gluon/dal.py", line 2245, in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
File "/backup1/web2py/gluon/dal.py", line 1704, in select
return self._select_aux(sql,fields,attributes)
File "/backup1/web2py/gluon/dal.py", line 1669, in _select_aux
self.execute(sql)
File "/backup1/web2py/gluon/dal.py", line 1784, in execute
return self.log_execute(*a, **b)
File "/backup1/web2py/gluon/dal.py", line 1778, in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
OperationalError: unable to open database file

Massimo Di Pierro

unread,
Jun 27, 2014, 3:03:38 AM6/27/14
to web...@googlegroups.com
Do you have a background process? Do you have multiple web2py's running in the same instance?
sqlite is not client server and each instance locks the database. If the database is locked for too long and another process/thread/request tries to access, it may timeout.

Sandeep Kumar

unread,
Jul 2, 2014, 3:35:33 AM7/2/14
to web...@googlegroups.com
I checked for the multiple instances of web2py. There are 10 main processes running which should be actually scheduler workers.. i changed those to scheduler workers again with -K option. It seems the app is working fine.

Thank you for your solution.. 
Reply all
Reply to author
Forward
0 new messages