inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.39k stars 792 forks source link

502 Bad Gateway on 0.13.0 docker image #6212

Closed NightSkySK closed 10 months ago

NightSkySK commented 10 months ago

Please verify that this bug has NOT been raised before.

Describe the bug*

Simmilarly to Issue 6156, also once I install version stable/0.13.0 via docker compose I get 502 Bad Gateway Ngix response on http://localhost:1337 As it is my first contact with InvenTree, before I rise this ticket I've edit docker compose yml and changed INVENTREE_TAG=0.12.10 and repeat procedure:

This time InvenTree is up and running at 0.12.10

Steps to Reproduce

  1. In .env file make sure you are have INVENTREE_TAG=stable
  2. docker compose run inventree-server invoke update
  3. docker compose run inventree-server invoke superuser
  4. docker compose up -d

Expected behaviour

We should see login page at http://localhost:1337 instead I saw 502 Bad Gateway

Deployment Method

Version Information

Inventree: 0.13.0

Please verify if you can reproduce this bug on the demo site.

Relevant log output

[ec2-user@ip-172-31-24-205 ~]$ docker compose stop
[+] Running 4/4
 ⠿ Container inventree-production-inventree-proxy-1   Stoppe...                                                    0.5s
 ⠿ Container inventree-production-inventree-worker-1  Stopp...                                                    10.3s
 ⠿ Container inventree-production-inventree-server-1  Stopp...                                                     0.0s
 ⠿ Container inventree-production-inventree-db-1      Stopped                                                      0.3s
[ec2-user@ip-172-31-24-205 ~]$ docker compose pull
[+] Running 24/24
 ⠿ inventree-db Pulled                                                                                            12.7s
   ⠿ 2f44b7a888fa Pull complete                                                                                    3.0s
   ⠿ a7f35665fcb5 Pull complete                                                                                    3.0s
   ⠿ 084e7cac132b Pull complete                                                                                    3.5s
   ⠿ 3dfd9d3ef559 Pull complete                                                                                    3.7s
   ⠿ f9a86bb2457f Pull complete                                                                                    4.6s
   ⠿ fe977d323b28 Pull complete                                                                                    4.8s
   ⠿ 683d6af0b661 Pull complete                                                                                    4.8s
   ⠿ 9d6cf683eb24 Pull complete                                                                                    4.9s
   ⠿ e3dde9f5a40c Pull complete                                                                                   10.6s
   ⠿ 0c6134ad6fc1 Pull complete                                                                                   10.7s
   ⠿ b1aae309429c Pull complete                                                                                   10.7s
   ⠿ b9fca0bb2c78 Pull complete                                                                                   10.7s
   ⠿ a7ce99218bd0 Pull complete                                                                                   10.7s
   ⠿ 79e76ae8b2b7 Pull complete                                                                                   10.7s
 ⠿ inventree-worker Pulled                                                                                         1.2s
 ⠿ inventree-proxy Pulled                                                                                         11.1s
   ⠿ 0e0969fcaa82 Pull complete                                                                                    7.0s
   ⠿ 9cfddd3151d4 Pull complete                                                                                    8.9s
   ⠿ 0a14c9c58a70 Pull complete                                                                                    9.0s
   ⠿ 46aff079cc60 Pull complete                                                                                    9.0s
   ⠿ 93498c6629aa Pull complete                                                                                    9.0s
   ⠿ a67e21d7eabc Pull complete                                                                                    9.1s
 ⠿ inventree-server Pulled                                                                                         1.2s
[ec2-user@ip-172-31-24-205 ~]$ docker compose run inventree-server invoke update
[+] Running 1/1
 ⠿ Container inventree-production-inventree-db-1  Recreated                                                        0.4s
[+] Running 1/1
 ⠿ Container inventree-production-inventree-db-1  Started                                                          0.5s
Loading config file : /home/inventree/data/config.yaml
Installing required python packages from 'requirements.txt'
Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages (23.0.1)
Collecting pip
  Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 24.6 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.0.1
    Uninstalling pip-23.0.1:
      Successfully uninstalled pip-23.0.1
Successfully installed pip-23.3.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Requirement already satisfied: setuptools in /root/.local/lib/python3.10/site-packages (69.0.2)
Collecting setuptools
  Downloading setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)
Downloading setuptools-69.0.3-py3-none-any.whl (819 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.5/819.5 kB 14.7 MB/s eta 0:00:00
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 69.0.2
    Uninstalling setuptools-69.0.2:
      Successfully uninstalled setuptools-69.0.2
Successfully installed setuptools-65.5.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Requirement already satisfied: asgiref==3.7.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 7)) (3.7.2)
Requirement already satisfied: async-timeout==4.0.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 9)) (4.0.3)
Requirement already satisfied: attrs==23.1.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 11)) (23.1.0)
Requirement already satisfied: babel==2.13.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 15)) (2.13.1)
Requirement already satisfied: bleach==6.1.0 in /root/.local/lib/python3.10/site-packages (from bleach[css]==6.1.0->-r requirements.txt (line 17)) (6.1.0)
Requirement already satisfied: brotli==1.1.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 19)) (1.1.0)
Requirement already satisfied: certifi==2023.7.22 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 21)) (2023.7.22)
Requirement already satisfied: cffi==1.16.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 25)) (1.16.0)
Requirement already satisfied: charset-normalizer==3.3.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 29)) (3.3.2)
Requirement already satisfied: coreapi==2.3.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 31)) (2.3.3)
Requirement already satisfied: coreschema==0.0.4 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 33)) (0.0.4)
Requirement already satisfied: cryptography==41.0.6 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 35)) (41.0.6)
Requirement already satisfied: cssselect2==0.7.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 40)) (0.7.0)
Requirement already satisfied: defusedxml==0.7.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 42)) (0.7.1)
Requirement already satisfied: diff-match-patch==20230430 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 46)) (20230430)
Requirement already satisfied: dj-rest-auth==5.0.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 48)) (5.0.1)
Requirement already satisfied: django==3.2.23 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 50)) (3.2.23)
Requirement already satisfied: django-allauth==0.54.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 84)) (0.54.0)
Requirement already satisfied: django-allauth-2fa==0.11.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 88)) (0.11.1)
Requirement already satisfied: django-cleanup==8.0.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 90)) (8.0.0)
Requirement already satisfied: django-cors-headers==4.3.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 92)) (4.3.0)
Requirement already satisfied: django-crispy-forms==1.14.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 94)) (1.14.0)
Requirement already satisfied: django-dbbackup==4.0.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 96)) (4.0.2)
Requirement already satisfied: django-error-report-2==0.4.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 98)) (0.4.2)
Requirement already satisfied: django-filter==23.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 100)) (23.3)
Requirement already satisfied: django-flags==5.0.13 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 102)) (5.0.13)
Requirement already satisfied: django-formtools==2.4.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 104)) (2.4.1)
Requirement already satisfied: django-ical==1.9.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 106)) (1.9.2)
Requirement already satisfied: django-import-export==3.3.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 108)) (3.3.1)
Requirement already satisfied: django-js-asset==2.1.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 110)) (2.1.0)
Requirement already satisfied: django-maintenance-mode==0.21.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 112)) (0.21.0)
Requirement already satisfied: django-markdownify==0.9.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 114)) (0.9.3)
Requirement already satisfied: django-money==3.2.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 116)) (3.2.0)
Requirement already satisfied: django-mptt==0.11.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 118)) (0.11.0)
Requirement already satisfied: django-otp==1.2.4 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 120)) (1.2.4)
Requirement already satisfied: django-picklefield==3.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 122)) (3.1)
Requirement already satisfied: django-q-sentry==0.1.6 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 124)) (0.1.6)
Requirement already satisfied: django-q2==1.6.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 126)) (1.6.1)
Requirement already satisfied: django-recurrence==1.11.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 128)) (1.11.1)
Requirement already satisfied: django-redis==5.4.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 130)) (5.4.0)
Requirement already satisfied: django-sesame==3.2.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 132)) (3.2.1)
Requirement already satisfied: django-sql-utils==0.7.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 134)) (0.7.0)
Requirement already satisfied: django-sslserver==0.22 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 136)) (0.22)
Requirement already satisfied: django-stdimage==6.0.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 138)) (6.0.2)
Requirement already satisfied: django-taggit==4.0.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 140)) (4.0.0)
Requirement already satisfied: django-user-sessions==2.0.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 142)) (2.0.0)
Requirement already satisfied: django-weasyprint==2.2.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 144)) (2.2.1)
Requirement already satisfied: django-xforwardedfor-middleware==2.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 146)) (2.0)
Requirement already satisfied: djangorestframework==3.14.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 148)) (3.14.0)
Requirement already satisfied: djangorestframework-simplejwt==5.3.0 in /root/.local/lib/python3.10/site-packages (from djangorestframework-simplejwt[crypto]==5.3.0->-r requirements.txt (line 154)) (5.3.0)
Requirement already satisfied: drf-spectacular==0.26.5 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 156)) (0.26.5)
Requirement already satisfied: dulwich==0.21.6 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 158)) (0.21.6)
Requirement already satisfied: et-xmlfile==1.1.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 160)) (1.1.0)
Requirement already satisfied: feedparser==6.0.10 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 162)) (6.0.10)
Requirement already satisfied: fonttools==4.44.0 in /root/.local/lib/python3.10/site-packages (from fonttools[woff]==4.44.0->-r requirements.txt (line 164)) (4.44.0)
Requirement already satisfied: gunicorn==21.2.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 166)) (21.2.0)
Requirement already satisfied: html5lib==1.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 168)) (1.1)
Requirement already satisfied: icalendar==5.0.11 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 170)) (5.0.11)
Requirement already satisfied: idna==3.4 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 172)) (3.4)
Requirement already satisfied: importlib-metadata==6.8.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 174)) (6.8.0)
Requirement already satisfied: inflection==0.5.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 178)) (0.5.1)
Requirement already satisfied: itypes==1.2.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 180)) (1.2.0)
Requirement already satisfied: jinja2==3.1.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 182)) (3.1.2)
Requirement already satisfied: jsonschema==4.19.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 184)) (4.19.2)
Requirement already satisfied: jsonschema-specifications==2023.7.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 186)) (2023.7.1)
Requirement already satisfied: markdown==3.5.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 188)) (3.5.1)
Requirement already satisfied: markuppy==1.14 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 190)) (1.14)
Requirement already satisfied: markupsafe==2.1.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 192)) (2.1.3)
Requirement already satisfied: oauthlib==3.2.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 194)) (3.2.2)
Requirement already satisfied: odfpy==1.4.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 196)) (1.4.1)
Requirement already satisfied: openpyxl==3.1.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 198)) (3.1.2)
Requirement already satisfied: packaging==23.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 200)) (23.2)
Requirement already satisfied: pdf2image==1.16.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 202)) (1.16.3)
Requirement already satisfied: pillow==10.1.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 204)) (10.1.0)
Requirement already satisfied: pint==0.21 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 212)) (0.21)
Requirement already satisfied: py-moneyed==3.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 214)) (3.0)
Requirement already satisfied: pycparser==2.21 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 216)) (2.21)
Requirement already satisfied: pydyf==0.8.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 218)) (0.8.0)
Requirement already satisfied: pyjwt==2.8.0 in /root/.local/lib/python3.10/site-packages (from pyjwt[crypto]==2.8.0->-r requirements.txt (line 220)) (2.8.0)
Requirement already satisfied: pyphen==0.14.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 224)) (0.14.0)
Requirement already satisfied: pypng==0.20220715.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 226)) (0.20220715.0)
Requirement already satisfied: python-barcode==0.15.1 in /root/.local/lib/python3.10/site-packages (from python-barcode[images]==0.15.1->-r requirements.txt (line 228)) (0.15.1)
Requirement already satisfied: python-dateutil==2.8.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 230)) (2.8.2)
Requirement already satisfied: python-dotenv==1.0.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 234)) (1.0.0)
Requirement already satisfied: python-fsutil==0.12.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 236)) (0.12.0)
Requirement already satisfied: python3-openid==3.2.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 238)) (3.2.0)
Requirement already satisfied: pytz==2023.3.post1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 240)) (2023.3.post1)
Requirement already satisfied: pyyaml==6.0.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 246)) (6.0.1)
Requirement already satisfied: qrcode==7.4.2 in /root/.local/lib/python3.10/site-packages (from qrcode[pil]==7.4.2->-r requirements.txt (line 251)) (7.4.2)
Requirement already satisfied: rapidfuzz==0.7.6 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 255)) (0.7.6)
Requirement already satisfied: redis==5.0.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 257)) (5.0.1)
Requirement already satisfied: referencing==0.30.2 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 259)) (0.30.2)
Requirement already satisfied: regex==2023.10.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 263)) (2023.10.3)
Requirement already satisfied: requests==2.31.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 265)) (2.31.0)
Requirement already satisfied: requests-oauthlib==1.3.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 270)) (1.3.1)
Requirement already satisfied: rpds-py==0.12.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 272)) (0.12.0)
Requirement already satisfied: sentry-sdk==1.34.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 276)) (1.34.0)
Requirement already satisfied: sgmllib3k==1.0.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 280)) (1.0.0)
Requirement already satisfied: six==1.16.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 282)) (1.16.0)
Requirement already satisfied: sqlparse==0.4.4 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 287)) (0.4.4)
Requirement already satisfied: tablib==3.5.0 in /root/.local/lib/python3.10/site-packages (from tablib[html,ods,xls,xlsx,yaml]==3.5.0->-r requirements.txt (line 291)) (3.5.0)
Requirement already satisfied: tinycss2==1.2.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 295)) (1.2.1)
Requirement already satisfied: typing-extensions==4.8.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 300)) (4.8.0)
Requirement already satisfied: uritemplate==4.1.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 305)) (4.1.1)
Requirement already satisfied: urllib3==2.0.7 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 309)) (2.0.7)
Requirement already satisfied: weasyprint==60.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 314)) (60.1)
Requirement already satisfied: webencodings==0.5.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 318)) (0.5.1)
Requirement already satisfied: xlrd==2.0.1 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 324)) (2.0.1)
Requirement already satisfied: xlwt==1.3.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 326)) (1.3.0)
Requirement already satisfied: zipp==3.16.0 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 328)) (3.16.0)
Requirement already satisfied: zopfli==0.2.3 in /root/.local/lib/python3.10/site-packages (from -r requirements.txt (line 330)) (0.2.3)
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/site-packages (from django-money==3.2.0->-r requirements.txt (line 116)) (65.5.1)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Backing up InvenTree database...
Python version 3.10.13 - /usr/local/bin/python3
Backing Up Database: inventree
Writing file to default-e526b9807234-2024-01-12-080056.psql.bin.gz
Backing up InvenTree media files...
Python version 3.10.13 - /usr/local/bin/python3
Writing file to e526b9807234-2024-01-12-080101.tar.gz
Running InvenTree database migrations...
========================================
Python version 3.10.13 - /usr/local/bin/python3
No changes detected
Python version 3.10.13 - /usr/local/bin/python3
Operations to perform:
  Apply all migrations: InvenTree, account, admin, auth, build, common, company, contenttypes, django_q, error_report, exchange, flags, label, order, otp_static, otp_totp, part, plugin, report, sites, socialaccount, stock, taggit, user_sessions, users
Running migrations:
  No migrations to apply.
Python version 3.10.13 - /usr/local/bin/python3
Operations to perform:
  Synchronize unmigrated apps: allauth, allauth_2fa, corsheaders, crispy_forms, dbbackup, dj_rest_auth, django_cleanup, django_filters, django_ical, django_otp, djmoney, drf_spectacular, formtools, generic, import_export, maintenance_mode, markdownify, messages, mptt, registration, rest_framework, staticfiles, web
  Apply all migrations: InvenTree, account, admin, auth, build, common, company, contenttypes, django_q, error_report, exchange, flags, label, order, otp_static, otp_totp, part, plugin, report, sites, socialaccount, stock, taggit, user_sessions, users
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
Running migrations:
  No migrations to apply.
Python version 3.10.13 - /usr/local/bin/python3
System check identified no issues (1 silenced).
========================================
InvenTree database migrations completed!
Python version 3.10.13 - /usr/local/bin/python3
render api.js
render attachment.js
render barcode.js
render bom.js
render build.js
render charts.js
render company.js
render filters.js
render forms.js
render helpers.js
render index.js
render label.js
render modals.js
render model_renderers.js
render news.js
render notification.js
render order.js
render part.js
render plugin.js
render pricing.js
render purchase_order.js
render report.js
render return_order.js
render sales_order.js
render search.js
render status_codes.js
render stock.js
render table_filters.js
render tables.js
rendered all files in /home/inventree/InvenTree/templates/js/translated
Python version 3.10.13 - /usr/local/bin/python3

957 static files copied to '/home/inventree/data/static', 2400 unmodified.
Python version 3.10.13 - /usr/local/bin/python3
Python version 3.10.13 - /usr/local/bin/python3
File “/home/inventree/InvenTree/locale/zh/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/ko/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/id/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/zh_hant/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/bg/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/pl/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/he/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/sr/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/de/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/sv/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/hi/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/da/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/es/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/es_MX/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/en/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/ja/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/cs/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/no/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/fi/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/it/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/ru/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/fr/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/el/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/pt/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/vi/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/pt_br/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/nl/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/zh_Hans/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/hu/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/tr/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/fa/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/th/LC_MESSAGES/django.po” is already compiled and up to date.
File “/home/inventree/InvenTree/locale/sl/LC_MESSAGES/django.po” is already compiled and up to date.
InvenTree translation coverage: 28%
[ec2-user@ip-172-31-24-205 ~]$ docker compose up -d
[+] Running 4/4
 ⠿ Container inventree-production-inventree-db-1      Running                                                      0.0s
 ⠿ Container inventree-production-inventree-server-1  Start...                                                    10.8s
 ⠿ Container inventree-production-inventree-proxy-1   Starte...                                                   11.5s
 ⠿ Container inventree-production-inventree-worker-1  Start...                                                    11.4s
[ec2-user@ip-172-31-24-205 ~]$ curl -l http://localhost:1337
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.24.0</center>
</body>
</html>
SchrodingersGat commented 10 months ago

The logs you posted here look like everything is running fine - perhaps you have just not waited long enough for the server to make initial connection to the database?

As an experiment, run docker compose up (instead of docker compose up -d) and you can see the logs from the different containers. Then make your request, and the docker logs should provide more information.

Ensure that you wait a minute or so after starting the server

NightSkySK commented 10 months ago

I have been trying to make it work for some time, but I will try it again during the weekend and let you know the result.

SchrodingersGat commented 10 months ago

No worries. The docker logs should be the most informative for us

NightSkySK commented 10 months ago

I don't know what I do wrong this time... Launching fresh EC2 instance with Amazon Linux 2023 and prepare all dependencies with user data

#!/bin/bash
set -x
#docker
dnf update -y
dnf install -y docker
service docker start
systemctl enable docker
usermod -a -G docker ec2-user
chmod 666 /var/run/docker.sock

#docker-compose-plugin
mkdir -p /usr/local/lib/docker/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose

#docker-compose
#curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose 
#chmod +x /usr/local/bin/docker-compose

#git
dnf install -y git

Docker version 24.0.5, build ced0996 Docker Compose version v2.24.0

coping production docker-compose.yml and prepared .env

scp -i ~/.ssh/aws.pem docker-compose.yml .env nginx.prod.conf ec2-user@16.171.24.xxx:~/.

and run docker compose run inventree-server invoke update

[+] Running 15/15
 ✔ inventree-db 14 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                 10.5s
   ✔ 2f44b7a888fa Pull complete                                                                                    0.8s
   ✔ a7f35665fcb5 Pull complete                                                                                    0.4s
   ✔ 084e7cac132b Pull complete                                                                                    0.4s
   ✔ 3dfd9d3ef559 Pull complete                                                                                    0.9s
   ✔ f9a86bb2457f Pull complete                                                                                    1.0s
   ✔ fe977d323b28 Pull complete                                                                                    1.2s
   ✔ 683d6af0b661 Pull complete                                                                                    1.3s
   ✔ 9d6cf683eb24 Pull complete                                                                                    1.3s
   ✔ e3dde9f5a40c Pull complete                                                                                    2.8s
   ✔ 0c6134ad6fc1 Pull complete                                                                                    1.7s
   ✔ b1aae309429c Pull complete                                                                                    1.8s
   ✔ b9fca0bb2c78 Pull complete                                                                                    2.2s
   ✔ a7ce99218bd0 Pull complete                                                                                    2.2s
   ✔ 79e76ae8b2b7 Pull complete                                                                                    2.6s
[+] Creating 2/1
 ✔ Network inventree-production_default           Created                                                          0.1s
 ✔ Volume "inventree-production_inventree_data"   Created                                                          0.0s
 ⠋ Container inventree-production-inventree-db-1  Creating                                                         0.0s
Error response from daemon: invalid mount config for type "bind": invalid mount path: 'inventree-production_inventree_data' mount path must be absolute

Each time I get same error, once on Friday I was able to fix it (it was occurring using docker-compose but not with docker compose plugin) Any advice?

SchrodingersGat commented 10 months ago

Have you edited any of the following files in any way?

NightSkySK commented 10 months ago

docker-compose.yml and ngix.prod.conf same as in the repo Inventree\docker\production folder .env only necessary changes to make it all working:

# InvenTree environment variables for a postgresql production setup

# Location of persistent database data (stored external to the docker containers)
# Note: You *must* un-comment this line, and point it to a path on your local machine

# e.g. Linux
INVENTREE_EXT_VOLUME=/home/inventree/data

# e.g. Windows (docker desktop)
#INVENTREE_EXT_VOLUME=c:/Users/inventree/data

# Default web port for the InvenTree server
INVENTREE_WEB_PORT=1337

# Ensure debug is false for a production setup
INVENTREE_DEBUG=False
INVENTREE_LOG_LEVEL=WARNING

# InvenTree admin account details
# Un-comment (and complete) these lines to auto-create an admin acount
INVENTREE_ADMIN_USER=admin.user
INVENTREE_ADMIN_PASSWORD=admin.password
INVENTREE_ADMIN_EMAIL=admin@email.com

# Database configuration options
# Note: The example setup is for a PostgreSQL database
INVENTREE_DB_ENGINE=postgresql
INVENTREE_DB_NAME=inventree
INVENTREE_DB_HOST=inventree-db
INVENTREE_DB_PORT=5432

# Database credentials - These must be configured before running
# Uncomment the lines below, and change from the default values!
INVENTREE_DB_USER=dbuser
INVENTREE_DB_PASSWORD=dbpassword

# Redis cache setup (disabled by default)
# Un-comment the following lines to enable Redis cache
# Note that you will also have to run docker-compose with the --profile redis command
# Refer to settings.py for other cache options
#INVENTREE_CACHE_HOST=inventree-cache
#INVENTREE_CACHE_PORT=6379

# Options for gunicorn server
INVENTREE_GUNICORN_TIMEOUT=90

# Enable custom plugins?
INVENTREE_PLUGINS_ENABLED=True

# Run migrations automatically?
INVENTREE_AUTO_UPDATE=False

# Image tag that should be used
INVENTREE_TAG=stable

COMPOSE_PROJECT_NAME=inventree-production
Nudelsalad commented 10 months ago

Normally you get the bind error if /home/inventree/data does not exist or if docker can somehow not access the folder(permission error). Checked if it is there? If not create it and try it again. For your bad gateway error the docker logs of the proxy would be interesting, assuming all files @SchrodingersGat mentioned are in one folder and have not been modified. If it persists it can be an issue with docker too. I don't know the installation procedure on fedora but maybe just use the convenience script if youre unsure https://docs.docker.com/engine/install/fedora/#install-using-the-convenience-script

SchrodingersGat commented 10 months ago

If you are pointing to /home/inventree/data/ - does the inventree user (and associated directories) exist?

NightSkySK commented 10 months ago

Finally, I didn't manage to fix my problem with the binding error on Amazon Linux 2023. Even if user inventree was created, folder /home.inventree/data existed and with a double check of all permission settings. After many tries, I've given up. I've set up a new server running Ubuntu 20.04 LTS and the whole installation went smoothly including the docker and docker compose plugin installation as well as the whole process of setting up production dockers of Inventree finished with success from the first time. (no invalid mount config for type "bind": invalid mount path: 'inventree-production_inventree_data' mount path must be absolute or 502 Bad Gateway ngix response either) Most probably my problem with Amazon Linux installation could be solved, however I'm not advanced enough to solve them, may be some community member will be able to deal with those and propose some guidelines for less advanced user as I am. From other hand documentation clearly says:

Docker Skills Required
This guide assumes that you are reasonably comfortable with the basic concepts of docker and docker compose.

So the Amazon Linux / Fedora / Centos are clearly requiring mode skills than Ubuntu or Debian so I will stick with that.

SchrodingersGat commented 10 months ago

@NightSkySK glad you got it working in one way. There are so many complexities with setting up a system like this even with a simplified docker interface

p-fruck commented 10 months ago

As a side note, this might be also due to SELinux. Makes me wonder why the 0.12.X worked if it was due to SELinux, but I still submitted a patch here which should reduce future issues on the RHEL family of systems. With SELinux in enforcing mode, you have to make sure that your volume mounts contain the container_file_t label (check with ls -laZ /your/data/directory). You can also apply the labels manually using chcon -t container_file_t -R /your/data/directory