-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unable to serialize database with dumpdata #1336
Comments
FWIW, dumping only the findings works fine ( Can anyone reproduce this issue? @dr3dd589 @valentijnscholten @aaronweaver This feature is so important in my eyes to be able to feel safer... |
@dr3dd589 If you can take a look. Just a quick search, this may be the solution.
|
Do you think there is a remote chance it could be connected to my upgrading from 2.x to 3.x branch through the import, that also caused #1315 ? I will dump the mysql, and see how I can redact it to hand over to you. I am guessing this is the only way for you to truly test that. Anything else that could help you? My exact git reflog (the 2 most recent lines was to incorporate work from @propersam for the API notes endpoint)
|
yes, maybe it is some kind of issue on upgrading DD on your system. You can test it by doing a fresh install of DD. |
I've spent some time this morning writing some proxySQL rules to anonymize my mysql dump, which looks ok. To make sure I had the same experience on my local copy of DD, I imported it (went ok) and ran a I could use some help to identify this issue. If you're willing @dr3dd589, I could send you a link to a private download of this anonimized mysql dump for you to look at? Even if the fresh installs work, it's not going to help me, since I cannot afford to lose the data in this particular instance. Hopefully, this will help later down the road also for potential troubleshooting; I can start a wiki page with proxySQL basic rules and some guidance? |
I found the culprit. When you associate a JIRA configuration to a product, then dumpdata fails. Started with fresh config, and added little by little... |
@Maffooch maybe you know something looking at git blame, seems you pushed some stuff a few weeks ago? |
It should still be able to serialize it. I think it's a 2->3 bug. |
It is not. My test was only on the latest dev (python3) branch. |
Let me clarify, I think the the object relation is breaking as a result of the code upgrade from 2 to 3. |
@dr3dd589 would you have some time to look into this soon? Cheers. |
So I just fetched the latest dev locally, re-added jira conf and association, and I cannot reproduce what I could a week ago 🤔 Could #1371 as a collateral (even though it is not clear how this could have?). Or something else? |
I can no longer reproduce on fresh instance. I am guessing I had left-over stuff from a previous db schema or something from previous tests... sigh |
Culprit probably hides in there: 6508e7e (@Maffooch ). Saw this as well: https://stackoverflow.com/questions/52057583/python-2-3-django-migration-causes-field-parameter-type-change leading to https://code.djangoproject.com/ticket/23226, which does sound something that is awfully happening to me here after the migration? |
Tried to revert the notifications model of
|
My anonymized sql dump is here, can be simply loaded with mysqldump on a new instance of defectdojo: https://send.firefox.com/download/a5cb53aab79d472f/#rkST0cU3qbTP2u2hD5icjQ You'd need to load up a user fixture to have a valid user then. The first 3 persons willing to help wins ;-) valid 7 days. I hope a good soul can help... Cheers. |
Quickly tried the hack presented at goinnn/django-multiselectfield#74 and it works. I can dumpdata fine. (why didn't I try it before, go figure) However, I am definitely no django guy as you have surely noticed by now, so I do not know if there is anything you want to do with this, such as implementing a class as described at goinnn/django-multiselectfield#74 (comment) ? |
Btw, I am still being hit by this on a yet newer instance -- of course bringing forward data that lived through the python 2 -> python 3 transition. Eg. could this suggestion be implemented without hindering anything else? or as a flag? |
but this is happening only when you upgrade from python2 to python3 and now default it is patched for Django 2.0. So I don't think it would be great to implement this manually for python2 when it is already fixed. it may raise another problem. |
Yea... Sucks to be the only person in the world to have migrated from py2 to py3 with some "prod" data :-/ I am going to go ahead and close this. Cheers. |
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:
Expected behavior
The
dumpdata
works.Deployment method (select with an
X
)The text was updated successfully, but these errors were encountered: