Skip to content

sqlite3.InterfaceError when exporting the elements of a corpus

Sentry Issue: ARKINDEX-BACKEND-19W

InterfaceError: Error binding parameter 1 - probably unsupported type.
  File "rq/worker.py", line 1068, in perform_job
    rv = job.perform()
  File "rq/job.py", line 847, in perform
    self._result = self._execute()
  File "rq/job.py", line 870, in _execute
    result = self.func(*self.args, **self.kwargs)
  File "arkindex/documents/export/__init__.py", line 125, in export_corpus
  File "arkindex/documents/export/__init__.py", line 83, in save_sqlite

This errors currently occurs only in preprod and cannot be reproduced in prod, demo, or locally both with and without Docker.

The elements export PostgreSQL query appears to be returning a list with only 10 columns, when it should have 11, causing sqlite to not be able to match all the parameters to the INSERT query. Testing in a Django shell on the preprod containers directly shows that the PostgreSQL query is returning 11 columns on each row, despite Sentry reporting that only 10 columns were returned!