zhoubear / open-paperless

Scan, index, and archive all of your paper documents (acquired by Mayan EDMS)
https://openpaperless.com
Other
2.56k stars 220 forks source link

database locked #9

Open Floehe opened 6 years ago

Floehe commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

zhoubear commented 6 years ago

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 commented 6 years ago

...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 commented 6 years ago

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 commented 6 years ago

Same Problem