InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Install errors and broken installation - unstyled login webpage and can't login

Open grojguy opened this issue 1 year ago • 7 comments

Deployment Method

  • [x] Installer

Describe the problem*

Using the scripted installer on Debian 11 VPS...

  1. I get multiple warnings/errors during install. See install log excerpts in the "Relevant log output" section below.

  2. The webpage loads, but is unstyled... Image

  3. I am not able to login with the 'admin' credentials provided after the install.

  4. Also, selecting the new UI link results in a blank page.

This is my first install ever, so not very encouraging. Please help! Thank you.

Steps to Reproduce

First install attempt: sudo wget -qO install.sh https://get.inventree.org && sudo bash install.sh Result: setup_2024-12-18_03_49_16.log Problem as described above under "Describe the problem"

Uninstall (best guess, could find no guidance in docs)

sudo apt remove inventree
sudo rm -Rf /etc/inventree /opt/inventree

Install yarn to address 'yarn: command not found' error in first install log sudo apt install yarn

Second install attempt: sudo wget -qO install.sh https://get.inventree.org && sudo bash install.sh Result: setup_2024-12-18_17_03_37.log Same problem as described above under "Describe the problem"

Relevant log output (from second install attempt)

error 1 excerpt:

/opt/inventree/env/lib/python3.9/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
  warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
Failed to set maintenance mode state
2024-12-18 17:04:09,195 WARNING Failed to set maintenance mode state
/opt/inventree/env/lib/python3.9/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
  warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
2024-12-18 17:04:14,243 INFO Backing Up Database: /opt/inventree/data/database.sqlite3
2024-12-18 17:04:14,244 DEBUG Backup size: 70.0 B
2024-12-18 17:04:14,244 INFO Writing file to default-Wagner-Engineering-2024-12-18-170414.dump.gz
/opt/inventree/env/lib/python3.9/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
  warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
2024-12-18 17:04:17,775 DEBUG Backup size: 86.0 B
2024-12-18 17:04:17,776 INFO Writing file to Wagner-Engineering-2024-12-18-170417.tar.gz
/opt/inventree/env/lib/python3.9/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
  warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
Failed to set maintenance mode state
2024-12-18 17:04:23,412 WARNING Failed to set maintenance mode state

error 2 excerpt:

# POI12| u |   Applying report.0019_returnorderreport_metadata... OK
/opt/inventree/env/lib/python3.9/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
  warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
# POI12| u |   Applying report.0020_stocklocationreport... OK

error 3 excerpt:

# POI12| u | Adding plugin sample static content
# POI12| u | - /opt/inventree/src/backend/InvenTree/plugin/samples/static
# POI12| u | /opt/inventree/env/lib/python3.9/site-packages/django/db/models/base.py:366: RuntimeWarning: Model 'company.company' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.
# POI12| u |   new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'
t' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.
# POI12| u |   new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

error 4 excerpt:

# POI12| u | Updating frontend...
# POI12| u | Compiling frontend code...
# POI12| u | Installing frontend dependencies
# POI12| u | ERROR: InvenTree command failed: 'yarn install'
# POI12| u | - Refer to the error messages in the log above for more information

final installation completion output:

# POI14| Setting up InvenTree site URL
# 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://20.57.155.162/

Admin user data:
   Email: [email protected]
   Username: admin
   Password: O36Rw4qkB9upeeq8ARCq5xqCG2bkYGOnQ/NUU9EI0tk=
####################################################################################
# POI17| Running postinstall script - done - Wed Dec 18 17:05:51 UTC 2024
### Install done!

grojguy avatar Dec 18 '24 19:12 grojguy

Your logs are missing the first few lines. There should be info like the following, which will be helpful in debugging:

root@debian-s-2vcpu-4gb-amd-fra1-01:~# wget -qO install.sh https://get.inventree.org && bash install.sh
### Installer for InvenTree - source: inventree/stable
### Detected distribution: Debian GNU/Linux 11
### Installing required packages for download
### Getting and adding key
### Adding package source
### Updating package lists
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://deb.debian.org/debian bullseye-backports InRelease
Hit:5 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Hit:6 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Get:7 https://dl.packager.io/srv/deb/inventree/InvenTree/stable/debian 11 InRelease [1857 B]
Get:8 https://dl.packager.io/srv/deb/inventree/InvenTree/stable/debian 11/main amd64 Packages [7024 B]
Fetched 8881 B in 1s (16.7 kB/s)
Reading package lists... Done
### Setting installer args
### Installing InvenTree

matmair avatar Dec 21 '24 11:12 matmair

Your logs are missing the first few lines. There should be info like the following, which will be helpful in debugging:

@matmair Thank you so much for the reply. I'm so sorry I did not see it until now. In regards to the missing log lines, I cannot explain that. What I attached is exactly how they exist on the system. See below...

$ ls -l /var/log/inventree
total 128
-rw-r--r-- 1 inventree inventree     0 Dec 20 00:00 setup_2024-12-18_03_49_16.log
-rw-r--r-- 1 inventree inventree 64636 Dec 20 00:00 setup_2024-12-18_03_49_16.log.1
-rw-r--r-- 1 root      root          0 Dec 20 00:00 setup_2024-12-18_17_03_37.log
-rw-r--r-- 1 root      root      63922 Dec 20 00:00 setup_2024-12-18_17_03_37.log.1

$ head /var/log/inventree/setup_2024-12-18_03_49_16.log*
==> /var/log/inventree/setup_2024-12-18_03_49_16.log <==

==> /var/log/inventree/setup_2024-12-18_03_49_16.log.1 <==
# POI01| Importing functions
# POI01| Functions imported
# POI03| Setting base environment variables
# POI03| No config file found: /etc/inventree/config.yaml, using envs or defaults
# 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

$ head /var/log/inventree/setup_2024-12-18_17_03_37.log*
==> /var/log/inventree/setup_2024-12-18_17_03_37.log <==

==> /var/log/inventree/setup_2024-12-18_17_03_37.log.1 <==
# POI01| Importing functions
# POI01| Functions imported
# POI03| Setting base environment variables
# POI03| No config file found: /etc/inventree/config.yaml, using envs or defaults
# 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

$ date
Thu Jan  9 22:37:13 UTC 2025

It's a bit strange how it is creating a zero-length log file and then another *.log.1 file with content.

I could uninstall and reinstall again and see if I get the same result with the logs. What would you recommend?

Thank you

grojguy avatar Jan 09 '25 22:01 grojguy

@matmair - Do you have any suggestions based on my last comment? Thank you

grojguy avatar Feb 11 '25 22:02 grojguy

@grojguy as per my last comment - to help, I need the command you typed, not the content of the logs directory.

matmair avatar Feb 12 '25 19:02 matmair

@grojguy as per my last comment - to help, I need the command you typed, not the content of the logs directory.

Understood. That is shown in my original post:

Image

The reason I included the extra info about the logs and directory was to provide more of the whole picture, in case that might be useful.

Since the logs are missing the first few lines, I am happy to uninstall and reinstall again per your instruction, or do any other steps to collect information that would be helpful

Thank you

grojguy avatar Feb 19 '25 22:02 grojguy

I need the command and the first few lines. There is no concrete version information in your whole post - no idea how you intend anyone to reproduce this

matmair avatar Feb 20 '25 17:02 matmair

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

github-actions[bot] avatar Apr 22 '25 11:04 github-actions[bot]