ciur / papermerge

Open Source Document Management System for Digital Archives (Scanned Documents)
https://papermerge.com
Apache License 2.0
2.55k stars 267 forks source link

Error: docker run papermerge/papermerge backup #556

Open morelight101 opened 1 year ago

morelight101 commented 1 year ago

Description The suggested backup command: docker run papermerge/papermerge backup /place/backup/file/here/ produces an error.

Expected According to https://papermerge.github.io/documentation/2.1/backup-restore/

The result of backup operation is a (zipped) tar archive which contains following:

backup.json file sidecars/ folder docs/ folder username1/, username2, ... i.e. one folder per user with folder title being user's username

Actual

docker run papermerge/papermerge backup 
/venv/lib/python3.10/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.13) or chardet (None)/charset_normalizer (3.0.1) doesn't match a supported version!
  warnings.warn(
Traceback (most recent call last):
  File "/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/venv/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 477, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: core_user

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/manage.py", line 22, in <module>
    main()
  File "/app/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/venv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/venv/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute
    output = self.handle(*args, **options)
  File "/app/papermerge/core/management/commands/backup.py", line 41, in handle
    backup_data(file_path=file_path)
  File "/app/papermerge/core/backup_restore/backup.py", line 227, in backup_data
    dict_data = dump_data_as_dict()
  File "/app/papermerge/core/backup_restore/backup.py", line 211, in dump_data_as_dict
    result_dict['users'] = UserSerializer(User.objects, many=True).data
  File "/venv/lib/python3.10/site-packages/rest_framework/serializers.py", line 768, in data                                                                          
    ret = super().data                                                             
  File "/venv/lib/python3.10/site-packages/rest_framework/serializers.py", line 253, in data
    self._data = self.to_representation(self.instance)
  File "/venv/lib/python3.10/site-packages/rest_framework/serializers.py", line 686, in to_representation
    return [
  File "/venv/lib/python3.10/site-packages/django/db/models/query.py", line 320, in __iter__
    self._fetch_all()
  File "/venv/lib/python3.10/site-packages/django/db/models/query.py", line 1507, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/venv/lib/python3.10/site-packages/django/db/models/query.py", line 57, in __iter__
    results = compiler.execute_sql(
  File "/venv/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1361, in execute_sql
    cursor.execute(sql, params)
  File "/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/venv/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/venv/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 477, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: core_user

Info: