You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] 400 Bad Request when working with a larger BOM #2568
"Bad Request (400)" when trying to upload a BOM with 100 lines. (At least, I think it's size-related).
Steps to Reproduce
Steps to reproduce the behavior:
Upload a large-ish (100 lines) BOM from CSV
Make part selections
Submit Selections
I can share the CSV but not sure how much use that'd be without the matching part database.
Expected behavior
The BOM is uploaded.
Instead, I get a "Bad Request (400)".
If the server is run in the foreground, I get
inventree-server | The number of GET/POST parameters exceeded settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
inventree-server | Bad Request: /part/42/bom-upload
It feels like the issue is obvious - DATA_UPLOAD_MAX_NUMBER_FIELDS needs to be increased - but I don't even know where to find it. I'm not a sysadmin I just want to track inventory lol
Frankly I think this is two bugs. There is no context delivered with this 400 bad request, and no errors are logged to the admin interface. Without running the server in the foreground there is zero feedback. There seems to be a huge chunk of error reporting tooling that is missing.
Hi there this is loosely connected to #2331 and being worked on. If you want to increase the number of possible fields increase the setting. This might open you up increased risk of DDOS attacks, so please do not do this if you expose your instance to the web directly.
@alexisvl as this is a security concern, the error code is as general as possible. The message would appear in the logs if the verbosity level of the logs is set lower.
You can add the desired value to Inventree/setttings.py with the key DATA_UPLOAD_MAX_NUMBER_FIELDS and value of how many fields you would like.
@eeintech I do not recommend that due to security risks loading that much multiform. I am refactoring rn, it is a bit trickier than thought, might start over.
Users that can not wait a week can adjust their setting, I will try to get the proper new code into 0.6.0
@eeintech I do not recommend that due to security risks loading that much multiform. I am refactoring rn, it is a bit trickier than thought, might start over. Users that can not wait a week can adjust their setting, I will try to get the proper new code into 0.6.0
Thank you for your contribution, I figured out a quicker way would be to make a python script to push those automatically one by one using the API, doesn't have a limit and works pretty well.
Activity
github-actions commentedon Jan 24, 2022
Welcome to InvenTree! Please check the contributing docs on how to help.\nIf you experience setup / install issues please read all install docs.
Zontex commentedon Jan 24, 2022
Following, I'm having the same issue on bare metal installation with 142 lines BOM
matmair commentedon Jan 24, 2022
Hi there this is loosely connected to #2331 and being worked on. If you want to increase the number of possible fields increase the setting. This might open you up increased risk of DDOS attacks, so please do not do this if you expose your instance to the web directly.
matmair commentedon Jan 24, 2022
@alexisvl as this is a security concern, the error code is as general as possible. The message would appear in the logs if the verbosity level of the logs is set lower.
You can add the desired value to Inventree/setttings.py with the key DATA_UPLOAD_MAX_NUMBER_FIELDS and value of how many fields you would like.
Some background for this setting is provided here:
https://docs.djangoproject.com/en/4.0/ref/settings/#data-upload-max-number-fields
eeintech commentedon Jan 24, 2022
@matmair Can we make it a higher number by default?
matmair commentedon Jan 24, 2022
@eeintech I do not recommend that due to security risks loading that much multiform. I am refactoring rn, it is a bit trickier than thought, might start over.
Users that can not wait a week can adjust their setting, I will try to get the proper new code into 0.6.0
Zontex commentedon Jan 24, 2022
Thank you for your contribution, I figured out a quicker way would be to make a python script to push those automatically one by one using the API, doesn't have a limit and works pretty well.
matmair commentedon Jan 24, 2022
@Zontex the rewrite is already on the roadmap but glad you found a way to get it going that fast!