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

document_importer / exporter is not working, folders missing #45

Open
CMDren opened this issue Oct 24, 2023 · 2 comments
Open

document_importer / exporter is not working, folders missing #45

CMDren opened this issue Oct 24, 2023 · 2 comments

Comments

@CMDren
Copy link

CMDren commented Oct 24, 2023

Context

  • Hardware: VPS bought online
  • YunoHost version: 11.2.5
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no

Steps to reproduce

  • Install paperless-ngx via web interface
  • Put export data from another paperless instance into the export directory of paperless-ngx_ynh
  • run the command for import the files
    sudo -u paperless-ngx /var/www/paperless-ngx/venv/bin/python3 /var/www/paperless-ngx/src/manage.py document_importer ../export

Expected behavior

*Error:*
SystemCheckError: System check identified some issues:

ERRORS:
?: PAPERLESS_CONSUMPTION_DIR is set but doesn't exist.
	HINT: Create a directory at /var/www/paperless-ngx/consume
?: PAPERLESS_MEDIA_ROOT is set but doesn't exist.
	HINT: Create a directory at /var/www/paperless-ngx/media

Logs

nothing conspicuous in the logs

Workaround ???

If I use the paperless-ngx_ynh instance alone, does it make sense to create the required folders under /var/www/paperless-ngx/consume ?

@mjohanning99
Copy link

I have the same issue. When I create a symlink from /home/yunohost.app/paperless-ngx/media and /home/yunohost.app/paperless-ngx/media to /var/www/paperless-ngx the script does not throw an error anymore - but it still doesn't run, because now I get a different error. Not quite sure what to do about this one. It appears to be a database problem?

Traceback (most recent call last):
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 357, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: documents_correspondent

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

Traceback (most recent call last):
  File "/var/www/paperless-ngx/src/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/core/management/base.py", line 448, in execute
    output = self.handle(*args, **options)
  File "/var/www/paperless-ngx/src/documents/management/commands/document_exporter.py", line 181, in handle
    self.dump(options["no_progress_bar"])
  File "/var/www/paperless-ngx/src/documents/management/commands/document_exporter.py", line 210, in dump
    serializers.serialize("json", Correspondent.objects.all()),
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/core/serializers/__init__.py", line 134, in serialize
    s.serialize(queryset, **options)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/core/serializers/base.py", line 132, in serialize    for count, obj in enumerate(queryset, start=1):
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/models/query.py", line 394, in __iter__
    self._fetch_all()
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/models/query.py", line 1867, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/models/query.py", line 87, in __iter__
    results = compiler.execute_sql(
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1398, in execute_sql
    cursor.execute(sql, params)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/var/www/paperless-ngx/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 357, in execute
    return Database.Cursor.execute(self, query, params)

@CMDren
Copy link
Author

CMDren commented Oct 25, 2023

Hi @mjohanning99,
I have created the folders consume, media and export now under /var/www/paperless-ngx. I have created the export data in the new directory. The importer runs with it. Don`t forget the chown!

However, I can't say what that looks like in terms of safety. The opinion of a professional would be interesting.

Edit: It is not working, i can´t login into paperless-ngx

@CMDren CMDren closed this as completed Oct 25, 2023
@CMDren CMDren reopened this Oct 25, 2023
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

2 participants