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

Export of parts through admin fails with 502 Bad Gateway #5571

Closed
2 of 4 tasks
SparkeyinVA opened this issue Sep 19, 2023 · 8 comments
Closed
2 of 4 tasks

Export of parts through admin fails with 502 Bad Gateway #5571

SparkeyinVA opened this issue Sep 19, 2023 · 8 comments
Labels
bug Identifies a bug which needs to be addressed inactive Indicates lack of activity question This is a question

Comments

@SparkeyinVA
Copy link

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

  1. Go to Inventree Admin section. "Site administration"
  2. Scroll down to Part "Part administration"
  3. Then click on Parts "Select Part to change"
  4. Click on EXPORT.
  5. Select any output (I have checked, CSV, xlxs, and json)
  6. Click submit
  7. After about 28 to 30 seconds a 502 Bad Gateway message is returned.
    image_2023-09-19_130535926

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.
@SparkeyinVA SparkeyinVA added bug Identifies a bug which needs to be addressed question This is a question triage:not-checked Item was not checked by the core team labels Sep 19, 2023
@SchrodingersGat SchrodingersGat removed the triage:not-checked Item was not checked by the core team label Sep 19, 2023
@SchrodingersGat
Copy link
Member

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
Copy link
Author

@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
Copy link
Author

@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
Copy link
Member

@SparkeyinVA which file are you editing to change the timeout value?

@SparkeyinVA
Copy link
Author

SparkeyinVA commented 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
Copy link
Member

@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
Copy link
Member

matmair commented 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.

Copy link
Contributor

github-actions bot commented Dec 4, 2023

This issue seems stale. Please react to show this is still important.

@github-actions github-actions bot added the inactive Indicates lack of activity label Dec 4, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2023
@SchrodingersGat SchrodingersGat mentioned this issue Apr 3, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug which needs to be addressed inactive Indicates lack of activity question This is a question
Projects
None yet
Development

No branches or pull requests

3 participants