Ticket #1427 (new)

Opened 2 years ago

Last modified 2 years ago

Django-admin dumpdata command throws CommandError

Reported by: davidmarn Owned by: kostko
Priority: normal Milestone:
Component: nodewatcher/core Version:
Keywords: Cc:
Related nodes: Realization state:
Blocking: Effort: normal
Blocked by: Security sensitive: no



sudo docker-compose run web python manage.py dumpdata

stops amidst the dump with the error message:

CommandError: Unable to serialize database: relation "corsheaders_corsmodel" does not exist
LINE 1: ...smodel"."id", "corsheaders_corsmodel"."cors" FROM "corsheade...

The last serialized model is:
{"model": "sites.site", "pk": 1, "fields": {"domain": "example.com", "name": "example.com"}}

Change History

comment:1 Changed 2 years ago by mitar

From what I remember, that model comes from an app which does not yet use migrations. Can you check if there is a never version of that app and upgrade it in requirements and see if it fixes it?

comment:2 Changed 2 years ago by mitar

  • Keywords django, dumpdata removed

comment:3 Changed 2 years ago by mitar

  • Cc mitar removed

comment:4 Changed 2 years ago by davidmarn

A fix for this seems to be to run

manage.py makemigrations corsheaders
manage.py migrate

Although in my local version corsheaders are not seen in the output of migrate so the migration is not applied although properly created. Where is this app stored?

comment:5 Changed 2 years ago by mitar

This is a dependency. And no, this is not a correct fix because you fixed it only locally for yourself. We have or to find an upstream release which has fixed it, or we create a fork where we fix it (and send pull request upstream). Find a repository for that package and see if there are any open tickets about it, pull requests, or maybe it is already fixed.

comment:6 Changed 2 years ago by davidmarn

comment:7 Changed 2 years ago by mitar

It is useful to comment or just upvote the issue so that they know it is important for more people.

Note: See TracTickets for help on using tickets.