Reply
Contributor
Posts: 78
Registered: ‎06-19-2014
Accepted Solution

DatabaseError: database is locked

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.

 

Cloudera Employee abe
Cloudera Employee
Posts: 109
Registered: ‎08-08-2013

Re: DatabaseError: database is locked

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.
Cloudera Employee
Posts: 717
Registered: ‎07-30-2013

Re: DatabaseError: database is locked

Contributor
Posts: 78
Registered: ‎06-19-2014

Re: DatabaseError: database is locked

Many thanks.

The problem solved.

Expert Contributor
Posts: 82
Registered: ‎02-24-2016

Re: DatabaseError: database is locked

How did you solve the issue, i'm also facing the same. Could you plz post your solution
Cloudera Employee
Posts: 717
Registered: ‎07-30-2013

Re: DatabaseError: database is locked

Expert Contributor
Posts: 82
Registered: ‎02-24-2016

Re: DatabaseError: database is locked

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