Repository navigation
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
I have a parts database with currently 731 parts. I export a few reports and merge with our Sage 50 accounting system from time to time. Three months ago I was able to export 652 parts fine. Today I am only getting 502 Bad Gateway when I try to export my parts database. Other reports have downloaded with no problem. SupplierPart, Stock Item, and BOMItem. The Supplierpart export has always been larger then the parts file.
Steps to Reproduce
- Go to Inventree Admin section. "Site administration"
- Scroll down to Part "Part administration"
- Then click on Parts "Select Part to change"
- Click on EXPORT.
- Select any output (I have checked, CSV, xlxs, and json)
- Click submit
- After about 28 to 30 seconds a 502 Bad Gateway message is returned.

This also occurs when I try to download the parts database from the regular site URL/Part/ and click download table data.
Expected behaviour
I expected the file to download.
Deployment Method
- Docker
- Bare metal
Version Information
Version Information:
InvenTree-Version: 0.12.6
Django Version: 3.2.19
Commit Hash: 942bc53
Commit Date: None
Commit Branch: stable
Database: sqlite3
Debug-Mode: False
Deployed using Docker: False
Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
Installer: PKG
Target: ubuntu:20.04
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}]
I am using the Quick Script install and check for updates weekly
Please verify if you can reproduce this bug on the demo site.
- I can reproduce this bug on the demo site.
Relevant log output
I was able to download the parts data from the demo site but it's parts database is only 415 items.
I can not find any logs that are created when this happens. If you feel that there should be please let me know where to look and I can provide.
If this is a time out error due to larger database Please let me know where to adjust the time out.
Thank you in advance for your help.
Activity
SchrodingersGat commentedon Sep 19, 2023
This may just be related to the number of items you are exporting. There are probably some improvements which could be made to make the export code faster, but I'd suggest simply increasing your timeout. Probably on your nxinx server?
SparkeyinVA commentedon Sep 20, 2023
@SchrodingersGat Thank you for the reply. I am not sure how to do this. I searched with Google and it suggested nginx server instead of nxinx as you typed. From what I read a time out would return a 504 error not a 502 error. I did try to increases the time out by following the instructions outline here : https://ubiq.co/tech-blog/increase-request-timeout-nginx/
After making these changes the 502 error is still happening, Did I do the correct changes? Are there other settings I can try to adjust?
SparkeyinVA commentedon Sep 28, 2023
@mattbnz @SchrodingersGat @elmo2k3 @bobek I am still experiencing this issue. I can add filter to do a smaller download and it works, so the allowed timeout makes since. I am still not sure how to increases the time out. Can anyone help me with this or point me to resources that can help me understand how to increase the timeout.
Thank you in advance for your reply
SchrodingersGat commentedon Sep 29, 2023
@SparkeyinVA which file are you editing to change the timeout value?
SparkeyinVA commentedon Sep 29, 2023
@SchrodingersGat I edited /etc/nginx/nginx.conf, by adding the following code.
http{
...
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
...
}
After saving the conf file, then did a reboot of the server. This did not change the behavior so I have since removed the changes.
SchrodingersGat commentedon Sep 29, 2023
@matmair in the context of the installer, is this:
A) the file that they should be changing
B) the correct settings to change (for nginx)
matmair commentedon Oct 4, 2023
Changing the timeout there should work as long as the default nginx settings the packager ships were not touched. The setting is correct.
5 minutes is a bit long though.
github-actions commentedon Dec 4, 2023
This issue seems stale. Please react to show this is still important.