Support Questions

Find answers, ask questions, and share your expertise

DatabaseError: database is locked

avatar
Contributor

cdh5.0.2

hue3.5

Save Query Results In an HDFS file,when it does not complete,I can not do other  hue actions,just like hue hangs.

 

the exception:

 

Traceback (most recent call last):
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/hue/desktop/core/src/desktop/views.py", line 69, in home
'json_documents': json.dumps(massaged_documents_for_json(docs, request.user)),
File "/usr/lib/hue/desktop/core/src/desktop/api.py", line 55, in massaged_documents_for_json
return [massage_doc_for_json(doc, user) for doc in documents]
File "/usr/lib/hue/desktop/core/src/desktop/api.py", line 59, in massage_doc_for_json
perms = doc.list_permissions()
File "/usr/lib/hue/desktop/core/src/desktop/models.py", line 481, in list_permissions
return DocumentPermission.objects.list(document=self)
File "/usr/lib/hue/desktop/core/src/desktop/models.py", line 536, in list
perm, created = DocumentPermission.objects.get_or_create(doc=document, perms=DocumentPermission.READ_PERM)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/manager.py", line 134, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/query.py", line 452, in get_or_create
obj.save(force_insert=True, using=self.db)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/base.py", line 551, in save_base
result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/query.py", line 1593, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/sql/compiler.py", line 912, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/backends/sqlite3/base.py", line 344, in execute
return Database.Cursor.execute(self, query, params)
DatabaseError: database is locked

 

help,thank you very much.

 

1 ACCEPTED SOLUTION

avatar
Super Guru
6 REPLIES 6

avatar
Expert Contributor
This is a problem with Hue and SQLite in a multithreaded environment. A workaround to have this error be intermittent is to provide options='{"timeout": 30}' in the database section of your hue.ini. This should restrict locks to 30 seconds.

avatar
Super Guru

avatar
Contributor

Many thanks.

The problem solved.

avatar
Expert Contributor
How did you solve the issue, i'm also facing the same. Could you plz post your solution

avatar
Super Guru

avatar
Expert Contributor
Thanks @Romainr for reply. Is there any other way to fix apart from changing the db..?