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

502 Bad Gateway after upgrade 0.16.1 -> 0.16.5 / OSError: No translation files found #8252

Open
2 of 6 tasks
JustusRijke opened this issue Oct 7, 2024 · 0 comments
Open
2 of 6 tasks
Labels
bug Identifies a bug which needs to be addressed setup Relates to the InvenTree setup / installation process
Milestone

Comments

@JustusRijke
Copy link

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

After updating to 0.16.5, the server only serves a "502 Bad Gateway".

Console output:

Preparing to unpack .../01-inventree_0.16.5-1728322301.6e37f0cd.focal_amd64.deb ...
# Clearing precompiled files
# PRI01| Running preinstall script - start - Mon 07 Oct 2024 07:57:20 PM CEST
# PRI02| Clearing precompiled files - skipping
# PRI03| Running preinstall script - done - Mon 07 Oct 2024 07:57:21 PM CEST
Unpacking inventree (0.16.5-1728322301.6e37f0cd.focal) over (0.16.1-1724998827.4c15e5c9.focal) ...
Preparing to unpack .../02-libcups2_2.3.3op2-3+deb11u9_amd64.deb ...
Unpacking libcups2:amd64 (2.3.3op2-3+deb11u9) over (2.3.3op2-3+deb11u8) ...
Preparing to unpack .../03-libexpat1-dev_2.2.10-2+deb11u6_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.2.10-2+deb11u6) over (2.2.10-2+deb11u5) ...
Preparing to unpack .../04-libexpat1_2.2.10-2+deb11u6_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.10-2+deb11u6) over (2.2.10-2+deb11u5) ...
Preparing to unpack .../05-mariadb-common_1%3a10.5.26-0+deb11u2_all.deb ...
Unpacking mariadb-common (1:10.5.26-0+deb11u2) over (1:10.5.23-0+deb11u1) ...
Preparing to unpack .../06-libmariadb3_1%3a10.5.26-0+deb11u2_amd64.deb ...
Unpacking libmariadb3:amd64 (1:10.5.26-0+deb11u2) over (1:10.5.23-0+deb11u1) ...
Preparing to unpack .../07-libnghttp2-14_1.43.0-1+deb11u2_amd64.deb ...
Unpacking libnghttp2-14:amd64 (1.43.0-1+deb11u2) over (1.43.0-1+deb11u1) ...
Preparing to unpack .../08-libss2_1.46.2-2+deb11u1_amd64.deb ...
Unpacking libss2:amd64 (1.46.2-2+deb11u1) over (1.46.2-2) ...
Selecting previously unselected package linux-image-5.10.0-33-amd64.
Preparing to unpack .../09-linux-image-5.10.0-33-amd64_5.10.226-1_amd64.deb ...
Unpacking linux-image-5.10.0-33-amd64 (5.10.226-1) ...
Preparing to unpack .../10-linux-image-amd64_5.10.226-1_amd64.deb ...
Unpacking linux-image-amd64 (5.10.226-1) over (5.10.223-1) ...
Preparing to unpack .../11-linux-libc-dev_5.10.226-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.10.226-1) over (5.10.223-1) ...
Setting up libexpat1:amd64 (2.2.10-2+deb11u6) ...
Setting up linux-image-5.10.0-33-amd64 (5.10.226-1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-5.10.0-32-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-5.10.0-32-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-5.10.0-33-amd64
I: /initrd.img is now a symlink to boot/initrd.img-5.10.0-33-amd64
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-33-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-33-amd64
Found initrd image: /boot/initrd.img-5.10.0-33-amd64
Found linux image: /boot/vmlinuz-5.10.0-32-amd64
Found initrd image: /boot/initrd.img-5.10.0-32-amd64
Found linux image: /boot/vmlinuz-5.10.0-31-amd64
Found initrd image: /boot/initrd.img-5.10.0-31-amd64
Found linux image: /boot/vmlinuz-5.10.0-30-amd64
Found initrd image: /boot/initrd.img-5.10.0-30-amd64
Found linux image: /boot/vmlinuz-5.10.0-28-amd64
Found initrd image: /boot/initrd.img-5.10.0-28-amd64
Found linux image: /boot/vmlinuz-5.10.0-27-amd64
Found initrd image: /boot/initrd.img-5.10.0-27-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done
Setting up libsqlite3-0:amd64 (3.34.1-3+deb11u1) ...
Setting up libnghttp2-14:amd64 (1.43.0-1+deb11u2) ...
Setting up linux-libc-dev:amd64 (5.10.226-1) ...
Setting up inventree (0.16.5-1728322301.6e37f0cd.focal) ...
# POI01| Running postinstall script - start - Mon 07 Oct 2024 07:57:36 PM CEST
# POI01| Importing functions
# POI01| Functions imported
# POI03| Setting base environment variables
# POI03| Using existing config file: /etc/inventree/config.yaml
# POI03| Installing requirements
# POI03| Installed requirements
# POI03| Collected environment variables:
# POI03|    INVENTREE_MEDIA_ROOT=/opt/inventree/data/media
# POI03|    INVENTREE_STATIC_ROOT=/opt/inventree/data/static
# POI03|    INVENTREE_BACKUP_DIR=/opt/inventree/data/backup
# POI03|    INVENTREE_PLUGINS_ENABLED=true
# POI03|    INVENTREE_PLUGIN_FILE=/etc/inventree/plugins.txt
# POI03|    INVENTREE_SECRET_KEY_FILE=/etc/inventree/secret_key.txt
# POI03|    INVENTREE_DB_ENGINE=postgresql
# POI03|    INVENTREE_DB_NAME=inventree
# POI03|    INVENTREE_DB_USER=inventree
# POI03|    INVENTREE_DB_HOST=localhost
# POI03|    INVENTREE_DB_PORT=5432
# POI04| Running in docker: no
# POI05| Using init command: systemctl
# POI06| Getting the IP address of the server via web service
# POI06| IP address is 77.167.208.18
# POI07| Python environment already present
# POI07| Found earlier used version: /opt/inventree/env/bin/python
# POI07| Using python command: /opt/inventree/env/bin/python
# POI08| Checking if update checks are needed
# POI08| Running upgrade
# POI08| Old version is: 0.16.1-1724998827.4c15e5c9.focal | 16 - updating to 0.16.5-1728322301.6e37f0cd.focal | 16
# POI09| Setting up python environment
Requirement already satisfied: invoke in ./env/lib/python3.9/site-packages (2.1.3)
Requirement already satisfied: wheel in ./env/lib/python3.9/site-packages (0.40.0)
# POI09| Stopping nginx
# POI09| Stopped nginx
# POI09| Setting up nginx to /etc/nginx/sites-enabled/inventree.conf
# POI09| Starting nginx
# POI09| Started nginx
# POI09| (Re)creating init scripts
Nothing to do.
Nothing to do.
# POI09| Enabling InvenTree on boot
# POI09| Enabled InvenTree on boot
# POI10| Admin data already exists - skipping
# POI11| Stopping InvenTree
# POI11| Stopped InvenTree
# POI12| Updating InvenTree
Collecting uv
  Downloading uv-0.4.18-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Requirement already satisfied: wheel in ./env/lib/python3.9/site-packages (0.40.0)
Downloading uv-0.4.18-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.9/12.9 MB 3.5 MB/s eta 0:00:00
Installing collected packages: uv
Successfully installed uv-0.4.18
Resolved 137 packages in 4.61s
Prepared 1 package in 988ms
Uninstalled 1 package in 27ms
Installed 1 package in 7ms
 - setuptools==75.1.0
 + setuptools==72.1.0
warning: Requirements file /etc/inventree/plugins.txt does not contain any dependencies
Audited in 2ms
2024-10-07 19:57:59,979 ERROR No CSRF_TRUSTED_ORIGINS specified. Please provide a list of trusted origins, or specify INVENTREE_SITE_URL
# POI12| u | Installing required python packages from 'src/backend/requirements.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.9/site-packages (0.4.18)
# POI12| u | Requirement already satisfied: setuptools in ./env/lib/python3.9/site-packages (72.1.0)
# POI12| u | Collecting setuptools
# POI12| u |   Downloading setuptools-75.1.0-py3-none-any.whl.metadata (6.9 kB)
# POI12| u | Downloading setuptools-75.1.0-py3-none-any.whl (1.2 MB)
# POI12| u |    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 2.0 MB/s eta 0:00:00
# POI12| u | Installing collected packages: setuptools
# POI12| u |   Attempting uninstall: setuptools
# POI12| u |     Found existing installation: setuptools 72.1.0
# POI12| u |     Uninstalling setuptools-72.1.0:
# POI12| u |       Successfully uninstalled setuptools-72.1.0
# POI12| u | Successfully installed setuptools-75.1.0
# POI12| u | Installing plugin packages from '/etc/inventree/plugins.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.9/site-packages (0.4.18)
# POI12| u | Python version 3.9.2 - /opt/inventree/env/bin/python3
# POI12| Set permissions for data dir and media: /opt/inventree/data
# POI14| Site URL already set - skipping
# POI15| Starting InvenTree
# POI15| Started InvenTree
# POI16| Printing Final message
####################################################################################
This InvenTree install uses nginx, the settings for the webserver can be found in
/etc/nginx/sites-enabled/inventree.conf
Try opening InvenTree with either
http://localhost/ or http://XXXXXXXXXXX/

Admin user data:
   Email:
   Username:
   Password:
####################################################################################
# POI17| Running postinstall script - done - Mon 07 Oct 2024 07:58:00 PM CEST

Seem good except for 2024-10-07 19:57:59,979 ERROR No CSRF_TRUSTED_ORIGINS specified. Please provide a list of trusted origins, or specify INVENTREE_SITE_URL

After the update, I have a case of 502 Bad Gateway. So tried to trigger a database migration as that sometimes works when upgrades fail. Result:

Running InvenTree database migrations...
========================================
Python version 3.9.2 - /opt/inventree/env/bin/python3
Traceback (most recent call last):
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/inventree/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/inventree/env/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/apps/registry.py", line 116, in populate
    app_config.import_models()
  File "/opt/inventree/env/lib/python3.9/site-packages/django/apps/config.py", line 269, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/opt/inventree/src/backend/InvenTree/build/models.py", line 9, in <module>
    from django.contrib.auth.models import User
  File "/opt/inventree/env/lib/python3.9/site-packages/django/contrib/auth/models.py", line 98, in <module>
    class Group(models.Model):
  File "/opt/inventree/env/lib/python3.9/site-packages/django/db/models/base.py", line 194, in __new__
    new_class.add_to_class(obj_name, obj)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/db/models/base.py", line 371, in add_to_class
    value.contribute_to_class(cls, name)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/db/models/fields/related.py", line 1910, in contribute_to_class
    self.remote_field.through = create_many_to_many_intermediary_model(
  File "/opt/inventree/env/lib/python3.9/site-packages/django/db/models/fields/related.py", line 1269, in create_many_to_many_intermediary_model
    "verbose_name": _("%(from)s-%(to)s relationship")
  File "/opt/inventree/env/lib/python3.9/site-packages/django/utils/functional.py", line 191, in __mod__
    return str(self) % rhs
  File "/opt/inventree/env/lib/python3.9/site-packages/django/utils/functional.py", line 155, in __text_cast
    return func(*self.__args, **self.__kw)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/utils/translation/__init__.py", line 95, in gettext
    return _trans.gettext(message)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/utils/translation/trans_real.py", line 380, in gettext
    _default = _default or translation(settings.LANGUAGE_CODE)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/utils/translation/trans_real.py", line 293, in translation
    _translations[language] = DjangoTranslation(language)
  File "/opt/inventree/env/lib/python3.9/site-packages/django/utils/translation/trans_real.py", line 179, in __init__
    raise OSError(
OSError: No translation files found for default language en-us.

Seems to be related to #8155 ...

Steps to Reproduce

Upgrade

Expected behaviour

Hassle free upgrade :-)

Deployment Method

  • Docker
  • Package
  • Bare metal
  • Other - added info in Steps to Reproduce

Version Information

0.16.5 (can't copy version info, server is down)

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

  • I can reproduce this bug on the demo site.

Relevant log output

No response

@JustusRijke JustusRijke 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 Oct 7, 2024
@SchrodingersGat SchrodingersGat added setup Relates to the InvenTree setup / installation process and removed question This is a question triage:not-checked Item was not checked by the core team labels Oct 9, 2024
@SchrodingersGat SchrodingersGat added this to the 0.17.0 milestone Oct 9, 2024
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 setup Relates to the InvenTree setup / installation process
Projects
None yet
Development

No branches or pull requests

2 participants