Skip to content
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

Django 1.10 prevents by default deletion of large numbers of records #484

Closed
ingeba opened this issue Aug 18, 2016 · 3 comments
Closed

Django 1.10 prevents by default deletion of large numbers of records #484

ingeba opened this issue Aug 18, 2016 · 3 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@ingeba
Copy link

ingeba commented Aug 18, 2016

After pulling Netbox yesterday, an upgrade was made to Django 1.10. After this it was no longer possible to do a bulk delete of ~2500 prefixes (I got "Internal server error"). The Netbox log error was:

TooManyFieldsSent: The number of GET/POST parameters exceeded settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
[2016-08-17 13:15:54 +0000] [15415] [ERROR] Error handling request /ipam/prefixes/delete/

and a traceback was generated. According to the Django docs, the number of HTTP fields are on 1.10 limited by default to 1000. I resolved the issue by adding to netbox/netbox/settings.py:

DATA_UPLOAD_MAX_NUMBER_FIELDS = None

@jeremystretch
Copy link
Member

How were you performing the bulk deletion? Deleting objects using the "select all" box should only send one field with a list of objects IDs. Otherwise, the number of fields sent should be limited to the maximum page size IIRC.

@ingeba
Copy link
Author

ingeba commented Aug 18, 2016

I used the check box over the list - "Name" in "Devices", "Prefix" in "Prefixes" etc. It then prompts me with a list of objects to delete and asks me to confirm. After the confirmation it gives the error I cited above. Deleting 500-600 items at the time worked well, but not > 1000. After changing the Django config, deleting work regardless of the number of items.

EDIT: Note that I have done deletion of >1000 items at a time several times before (prior to the Django upgrade to 1.10) without problems.

@jeremystretch
Copy link
Member

Right, ok. On the second submission (post-confirmation), each object ID is passed independently.

I suppose I don't really see a reason for DATA_UPLOAD_MAX_NUMBER_FIELDS as far as NetBox is concerned. I'm going to disable it in settings.py.

@jeremystretch jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Aug 18, 2016
if-fi pushed a commit to if-fi/netbox that referenced this issue Oct 1, 2016
@netbox-community netbox-community deleted a comment from kusumkumari Sep 19, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants