django-DefectDojo: Unable to serialize database with dumpdata
Bug description
On a python3 dev branch (from june 26), I wanted to perform a dumpdata prior to upgrading.
The following command
docker exec -ti dojo_upstream_afterpy3_migration_uwsgi_1 bash -c 'python manage.py dumpdata --indent=4 -e sessions -e admin --natural-foreign --natural-primary -e contenttypes -e auth.permission' > datadump_prior_to_update.json
launches, performs up to a certain point before failing with this error:
CommandError: Unable to serialize database: 'MultiSelectField' object has no attribute '_get_val_from_obj'
}Exception ignored in: <generator object cursor_iter at 0x7f6ba391f660>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1515, in cursor_iter
cursor.close()
File "/usr/local/lib/python3.7/site-packages/MySQLdb/cursors.py", line 86, in close
while self.nextset():
File "/usr/local/lib/python3.7/site-packages/MySQLdb/cursors.py", line 136, in nextset
nr = db.next_result()
MySQLdb._exceptions.OperationalError: (2006, '')
Expected behavior
The dumpdata works.
Deployment method (select with an X)
- Kubernetes
- Docker
- setup.bash / legacy-setup.bash
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (6 by maintainers)
Let me clarify, I think the the object relation is breaking as a result of the code upgrade from 2 to 3.