Load data and Whoosh

Hello, I’m unable to load data on a project. I’ve never seen this error before:

File “/Envs/site/lib/python3.7/site-packages/whoosh/codec/whoosh3.py”, line 1109, in _read_values
assert isinstance(vs, bytes_type)
AssertionError: Problem installing fixture

I can’t find any resources unique to this problem. Can anyone help?

What are you doing when the error appears? We’d need a bit more details (or a minimal example, even) to help, I’m afraid.

Hello and thanks for the reply.

I’ve dumped data from a Python 3 production app running Postrges 9.4.25 and attempted to load the data locally to Postgres 12.1. The error seems to be related to Whoosh==2.7.4

AssertionError
Problem installing fixture

whoosh/codec/whoosh3.py in _read_values at line 1119
    if fixedsize is None or fixedsize < 0:
        self._values = vs
    elif fixedsize is 0:
        self._values = (None,) * self._blocklength
    else:
        assert isinstance(vs, bytes_type)
        self._values = tuple(vs[i:i + fixedsize]
                             for i in xrange(0, len(vs), fixedsize))

Particularly this line.

What are the steps you take to dump and then load the data? This might not be a Django-specific issue.

Edit: I tried searching the issue tracker for the Whoosh project, but couldn’t find a related issue.

I activate virtual environment and run the following on production:

python manage.py dumpdata --indent=4 pages > $HOME/datadump.json

Then locally:

python manage.py makemigrations
python manage.py migrate
python manage.py loaddata datadump.json

I’ve used this method many times and never encountered this error.

This issue (Error in woosh #18) results in a similar error, but has no answers: https://github.com/qgis/QGIS-Django/issues/18