Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database locked #9

Open
Floehe opened this issue Dec 22, 2017 · 6 comments
Open

database locked #9

Floehe opened this issue Dec 22, 2017 · 6 comments

Comments

@Floehe
Copy link

Floehe commented Dec 22, 2017

When trying to add my first file from a local server source folder, I get the following error:

[2017-12-22 09:03:58,261: ERROR/MainProcess] Task sources.tasks.task_check_interval_source[a2b61d94-0153-4645-9965-d33c2f9dc4df] raised unexpected: OperationalError('database is locked',)

@zhoubear
Copy link
Owner

zhoubear commented Dec 22, 2017

The default database used is SQLite which doesn't support too many open connections at the same time. Working on making MySQL the default database manage.

@peteygao
Copy link

Why not use Postgres as the default database instead of MySQL?

@zhoubear
Copy link
Owner

I gave Postgres a try but the user creation and authentication stumped me. If you have some experience with Postgres and could provide a step by step for creating users and such I could give it another try.

@Floehe
Copy link
Author

Floehe commented Dec 28, 2017

...I understand the limitations of SQLite but I do not open any connections deliberately. I just added a new new source folder and manually started a check on this folder. Also there are many manage.py tasks running, maybe they all want to access the DB?

this comes approx. 10 times in a ps-ef:
python manage.py celery worker --settings=mayan.settings.production -B -Ofair -l ERROR

@mbnoimi
Copy link

mbnoimi commented Jan 2, 2018

I've same issue which stopped my from using it.

I only added one pdf file!!!

 [2018-01-02 13:21:45,268: ERROR/Beat] Database error while sync: OperationalError('database is locked',)
Traceback (most recent call last):
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/djcelery/schedulers.py", line 212, in sync
    self.schedule[name].save()
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/djcelery/schedulers.py", line 102, in save
    obj.save()
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/djcelery/models.py", line 281, in save
    super(PeriodicTask, self).save(*args, **kwargs)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/models/base.py", line 796, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/models/base.py", line 824, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/models/base.py", line 889, in _save_table
    forced_update)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/models/base.py", line 939, in _do_update
    return filtered._update(values) > 0
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/models/query.py", line 654, in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 1148, in execute_sql
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 835, in execute_sql
    cursor.execute(sql, params)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/mbnoimi/Downloads/open-paperless-master/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: database is locked

@kawael
Copy link

kawael commented Feb 23, 2018

Same Problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants