inventree / InvenTree

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

Install Problem on Ubuntu 24.02 LTS #7665

Closed LarryJoy closed 2 weeks ago

LarryJoy commented 3 months ago

Deployment Method

Describe the problem*

As indicated in issue #7633 I have Docker Engine downloaded and need further instructions as to what to do next to get InvenTree running. How much, in US$, to have someone work with me one on one so that I can get InvenTree working on my OS?

Steps to Reproduce

As stated above.

Relevant log output

No response

matmair commented 3 months ago

@LarryJoy please be more specific about which issues you are facing

LarryJoy commented 3 months ago

matmair, I got ahead of myself and I have Ubuntu version 22.04 as my OS--NOT 24.02 (don't know where I got that).

The following is from issue 7633: Note that you don't need docker "desktop" to use inventree in a production setup with inventree. You only need the docker engine, which should work just fine with ubuntu 24.04 [that should be ubuntu 22.04] (taken from https://docs.docker.com/engine/install/ubuntu/#os-requirements).

Oliver,I seem to have muddled through downloading the Docker Engine as I get the following message: "Hello from Docker! This message shows that your installation appears to be working correctly." Next I executed "sudo docker pull inventree/inventree." and got "Status: Downloaded newer image for inventree/inventree:latest."

My problem is, what terminal commands to execute to setup the inventree program as my reading of the documents that are online do not indicate what to do next?

Appreciate any help that you can give me.

SchrodingersGat commented 3 months ago

@LarryJoy if you follow the instructions here - https://docs.inventree.org/en/stable/start/docker_install/#docker-production-server - you should not have any issues

LarryJoy commented 3 months ago

Ok Oliver, The first problem is the first instruction: "This guide assumes that you have already installed Docker and Docker Compose. If you have not yet installed Docker, please refer to the official installation guide."***Do I need to install these or because I have installed the Docker Engine I am okay?

2nd problem is I can not download the ".env" file because it starts with a period. What do I do with this, how to download it?

I have made a directory in my Ubuntu OS version 22.04 at "/home/larry/MyInventory". to collect the three files as instructed.

SchrodingersGat commented 3 months ago

Do I need to install these or because I have installed the Docker Engine I am okay?

If you have docker and docker compose already installed, you are OK. You can check this by running:

docker --version
docker compose version

2nd problem is I can not download the ".env" file because it starts with a period. What do I do with this, how to download it?

What is stopping you from downloading this file? Your browser? OS?

LarryJoy commented 3 months ago

The commands 'docker --version' and 'docker compose version' came back with good information. I ended up using the 'wget' command and then checking that the ".env" file had been downloaded by running 'ls -a' and it was there. So, I was able to continue quite a ways, but keep getting: "WARN[0000] /home/larry/MyInventory/docker-compose.yml: version is obsolete." I don't know what is going on there. I then ran: 'docker compose run inventree-server invoke superuser' and then 'docker compose up -d'. I had to use sudo prefix for these. I see this message in red print: "You have 594 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): InvenTree, account, admin, auth, build, common, company, contenttypes, django_q, error_report, exchange, flags, label, machine, order, otp_static, otp_totp, part, plugin, report, socialaccount, stock, taggit, user_sessions, users. Run 'python manage.py migrate' to apply them.--This I did even with sudo prefix and this is what I got: "larry@larry-MS-7693:~// MyInventory$ python manage.py migrate Command 'python' not found, did you mean: command 'python3' from deb python3 command 'python' from deb python-is-python3 larry@larry-MS-7693:~/MyInventory$ sudo python manage.py migrate [sudo] password for larry: sudo: python: command not found" I then ran: "You should now be able to view the InvenTree login screen at http://inventree.localhost/ (or whatever custom domain you have configured in the .env file)." I did this, but all I get is a Firefox screen of websites.

Looks like I am almost there but need a little more help to get over this hump. Thank you. P.S.: I don't know what the lines are running through the above 5 lines. I used to know what to do to not have the lines, but it has been too long ago.

wolflu05 commented 3 months ago

As you found out, the issue with the .env file was maybe just that you missed the -a on ls to show all files (also the files starting with a period.

As described in the official inventree docker install guide, before running the command ending with invoke superuser, you first need to run invoke update.

Then it should work fine.

LarryJoy commented 3 months ago

I went back to the previous command: 'docker compose run --rm inventree-server invoke update' and this is what I got: "larry@larry-MS-7693:~/MyInventory$ invoke update" "Can't find any collection named 'tasks'!" "larry@larry-MS-7693:~/MyInventory$ sudo invoke update" "[sudo] password for larry: " "Can't find any collection named 'tasks'!" I then executed: "docker compose run --rm inventree-server invoke update" And then as you stated I just ran "Invoke update" and to make sure I ran "sudo invoke update". I got a bunch of "Requirement already satisfied" lines. Next I ran: "larry@larry-MS-7693:~/MyInventory$ docker compose up -d" WARN[0000] /home/larry/MyInventory/docker-compose.yml: version is obsolete permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.46/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.project%3Dinventree%22%3Atrue%7D%7D": dial unix /var/run/docker.sock: connect: permission denied larry@larry-MS-7693:~/MyInventory$ sudo docker compose up -d WARN[0000] /home/larry/MyInventory/docker-compose.yml: version is obsolete [+] Running 5/0 ✔ Container inventree-db Running 0.0s ✔ Container inventree-cache Running 0.0s ✔ Container inventree-worker Running 0.0s ✔ Container inventree-proxy Running 0.0s ✔ Container inventree-server Started" I went to my Firefox Web Server and entered: "http://inventree.localhost/". This time instead of a Firefox screen with Web listings, I get a blank screen.--Still not working! Need more help.

SchrodingersGat commented 2 months ago

If you are getting a response to your initial command like "can't find any collection named tasks" - this shows that the command is not being run in the right context.

I got a bunch of "Requirement already satisfied" lines.

Please post the entire output here.

LarryJoy commented 2 months ago

This is quite extensive but here I go. To start at the top i ran the following:

larry@larry-MS-7693:~~~~/MyInventory$ docker --version
Docker version 27.0.3, build 7d4bcd8
larry@larry-MS-7693:~~/MyInventory$ docker compose version
Docker Compose version v2.28.1

Thus showing that Docker and Docker Compose are okay.

The following shows that those three files are downloaded to my MyInventory directory

larry@larry-MS-7693:~~~/MyInventory$ ls -la
total 36
drwxrwxr-x  3 larry larry  4096 Jul 27 15:47 .
drwxr-xr-x 52 larry larry 12288 Jul 31 10:33 ..
-rw-rw-r--  1 larry larry  1387 Jul 23 16:40 Caddyfile
-rw-rw-r--  1 larry larry  4735 Jul 23 15:39 docker-compose.yml
-rw-rw-r--  1 larry larry  1422 Jul 27 15:02 .env
drwxr-xr-x  8 root  root   4096 Jul 27 16:03 inventree-data

Next I ran cat .env to check the settings:

larry@larry-MS-7693:~/MyInventory$ cat .env

# InvenTree environment variables for docker compose deployment

# Specify the location of the external data volume
# By default, placed in local directory 'inventree-data'
INVENTREE_EXT_VOLUME=./inventree-data

# 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=
#INVENTREE_ADMIN_PASSWORD=
#INVENTREE_ADMIN_EMAIL=

# Database configuration options
INVENTREE_DB_ENGINE=postgresql
INVENTREE_DB_NAME=inventree
INVENTREE_DB_HOST=inventree-db
INVENTREE_DB_PORT=5432

# Database credentials - These should be changed from the default values!
INVENTREE_DB_USER=pguser
INVENTREE_DB_PASSWORD=pgpassword

# 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=True

# Image tag that should be used
INVENTREE_TAG=stable

# Site URL - update this to match your host
INVENTREE_SITE_URL="http://inventree.localhost"

COMPOSE_PROJECT_NAME=inventree

Do I need to fill in the #INVENTREE _ADMIN_USER=, #INVENTREE-ADMIN_PASSWORD=, and #INVENTREE_ADMIN_EMAIL= listings?

I then ran the initial database setup and note that I had to use sudo:

larry@larry-MS-7693:~/MyInventory$ sudo docker compose run --rm inventree-server invoke update
[sudo] password for larry: 
WARN[0000] /home/larry/MyInventory/docker-compose.yml: `version` is obsolete 
[+] Creating 1/0
 ✔ Container inventree-db  Running                                                                                                                                                                     0.0s 
Loading config file : /home/inventree/data/config.yaml
Installing required python packages from 'src/backend/requirements.txt'
Requirement already satisfied: pip in /usr/local/lib/python3.11/site-packages (24.0)
Collecting pip
  Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: setuptools in /root/.local/lib/python3.11/site-packages (69.5.1)
Collecting setuptools
  Downloading setuptools-72.1.0-py3-none-any.whl.metadata (6.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 707.2 kB/s eta 0:00:00
Downloading setuptools-72.1.0-py3-none-any.whl (2.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 416.5 kB/s eta 0:00:00
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 69.5.1
    Uninstalling setuptools-69.5.1:
      Successfully uninstalled setuptools-69.5.1
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-24.2 setuptools-72.1.0
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.8.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 3)) (3.8.1)
Requirement already satisfied: async-timeout==4.0.3 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 9)) (4.0.3)
Requirement already satisfied: attrs==23.2.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 13)) (23.2.0)
Requirement already satisfied: babel==2.15.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 19)) (2.15.0)
Requirement already satisfied: bleach==6.1.0 in /root/.local/lib/python3.11/site-packages (from bleach[css]==6.1.0->-r src/backend/requirements.txt (line 23)) (6.1.0)
Requirement already satisfied: brotli==1.1.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 27)) (1.1.0)
Requirement already satisfied: certifi==2024.2.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 112)) (2024.2.2)
Requirement already satisfied: cffi==1.16.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 118)) (1.16.0)
Requirement already satisfied: charset-normalizer==3.3.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 174)) (3.3.2)
Requirement already satisfied: coreapi==2.3.3 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 266)) (2.3.3)
Requirement already satisfied: coreschema==0.0.4 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 269)) (0.0.4)
Requirement already satisfied: cryptography==42.0.7 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 273)) (42.0.7)
Requirement already satisfied: cssselect2==0.7.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 309)) (0.7.0)
Requirement already satisfied: defusedxml==0.7.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 313)) (0.7.1)
Requirement already satisfied: deprecated==1.2.14 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 319)) (1.2.14)
Requirement already satisfied: diff-match-patch==20230430 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 326)) (20230430)
Requirement already satisfied: dj-rest-auth==6.0.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 330)) (6.0.0)
Requirement already satisfied: django==4.2.14 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 332)) (4.2.14)
Requirement already satisfied: django-allauth==0.61.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 366)) (0.61.1)
Requirement already satisfied: django-allauth-2fa==0.11.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 369)) (0.11.1)
Requirement already satisfied: django-cleanup==8.1.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 372)) (8.1.0)
Requirement already satisfied: django-cors-headers==4.3.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 375)) (4.3.1)
Requirement already satisfied: django-crispy-forms==1.14.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 378)) (1.14.0)
Requirement already satisfied: django-dbbackup==4.1.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 381)) (4.1.0)
Requirement already satisfied: django-error-report-2==0.4.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 384)) (0.4.2)
Requirement already satisfied: django-filter==24.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 387)) (24.2)
Requirement already satisfied: django-flags==5.0.13 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 390)) (5.0.13)
Requirement already satisfied: django-formtools==2.5.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 393)) (2.5.1)
Requirement already satisfied: django-ical==1.9.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 396)) (1.9.2)
Requirement already satisfied: django-import-export==3.3.7 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 399)) (3.3.7)
Requirement already satisfied: django-js-asset==2.2.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 402)) (2.2.0)
Requirement already satisfied: django-maintenance-mode==0.21.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 406)) (0.21.1)
Requirement already satisfied: django-markdownify==0.9.3 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 409)) (0.9.3)
Requirement already satisfied: django-money==3.2.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 412)) (3.2.0)
Requirement already satisfied: django-mptt==0.16.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 415)) (0.16.0)
Requirement already satisfied: django-otp==1.5.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 418)) (1.5.0)
Requirement already satisfied: django-picklefield==3.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 422)) (3.2)
Requirement already satisfied: django-q-sentry==0.1.6 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 426)) (0.1.6)
Requirement already satisfied: django-q2==1.6.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 428)) (1.6.2)
Requirement already satisfied: django-recurrence==1.11.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 431)) (1.11.1)
Requirement already satisfied: django-redis==5.4.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 435)) (5.4.0)
Requirement already satisfied: django-sesame==3.2.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 438)) (3.2.2)
Requirement already satisfied: django-sql-utils==0.7.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 441)) (0.7.0)
Requirement already satisfied: django-sslserver==0.22 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 444)) (0.22)
Requirement already satisfied: django-stdimage==6.0.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 446)) (6.0.2)
Requirement already satisfied: django-taggit==5.0.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 449)) (5.0.1)
Requirement already satisfied: django-user-sessions==2.0.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 452)) (2.0.0)
Requirement already satisfied: django-weasyprint==2.3.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 455)) (2.3.0)
Requirement already satisfied: django-xforwardedfor-middleware==2.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 458)) (2.0)
Requirement already satisfied: djangorestframework==3.14.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 460)) (3.14.0)
Requirement already satisfied: djangorestframework-simplejwt==5.3.1 in /root/.local/lib/python3.11/site-packages (from djangorestframework-simplejwt[crypto]==5.3.1->-r src/backend/requirements.txt (line 467)) (5.3.1)
Requirement already satisfied: drf-spectacular==0.27.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 470)) (0.27.2)
Requirement already satisfied: dulwich==0.22.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 473)) (0.22.1)
Requirement already satisfied: et-xmlfile==1.1.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 521)) (1.1.0)
Requirement already satisfied: feedparser==6.0.11 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 525)) (6.0.11)
Requirement already satisfied: fonttools==4.51.0 in /root/.local/lib/python3.11/site-packages (from fonttools[woff]==4.51.0->-r src/backend/requirements.txt (line 528)) (4.51.0)
Requirement already satisfied: googleapis-common-protos==1.63.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 572)) (1.63.0)
Requirement already satisfied: grpcio==1.63.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 578)) (1.63.0)
Requirement already satisfied: gunicorn==22.0.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 626)) (22.0.0)
Requirement already satisfied: html5lib==1.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 629)) (1.1)
Requirement already satisfied: icalendar==5.0.12 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 633)) (5.0.12)
Requirement already satisfied: idna==3.7 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 637)) (3.7)
Requirement already satisfied: importlib-metadata==7.0.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 641)) (7.0.0)
Requirement already satisfied: inflection==0.5.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 648)) (0.5.1)
Requirement already satisfied: itypes==1.2.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 652)) (1.2.0)
Requirement already satisfied: jinja2==3.1.4 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 656)) (3.1.4)
Requirement already satisfied: jsonschema==4.22.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 660)) (4.22.0)
Requirement already satisfied: jsonschema-specifications==2023.12.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 664)) (2023.12.1)
Requirement already satisfied: markdown==3.6 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 668)) (3.6)
Requirement already satisfied: markuppy==1.14 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 672)) (1.14)
Requirement already satisfied: markupsafe==2.1.5 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 675)) (2.1.5)
Requirement already satisfied: oauthlib==3.2.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 737)) (3.2.2)
Requirement already satisfied: odfpy==1.4.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 741)) (1.4.1)
Requirement already satisfied: openpyxl==3.1.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 744)) (3.1.2)
Requirement already satisfied: opentelemetry-api==1.24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 748)) (1.24.0)
Requirement already satisfied: opentelemetry-exporter-otlp==1.24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 760)) (1.24.0)
Requirement already satisfied: opentelemetry-exporter-otlp-proto-common==1.24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 763)) (1.24.0)
Requirement already satisfied: opentelemetry-exporter-otlp-proto-grpc==1.24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 769)) (1.24.0)
Requirement already satisfied: opentelemetry-exporter-otlp-proto-http==1.24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 773)) (1.24.0)
Requirement already satisfied: opentelemetry-instrumentation==0.45b0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 777)) (0.45b0)
Requirement already satisfied: opentelemetry-instrumentation-django==0.45b0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 785)) (0.45b0)
Requirement already satisfied: opentelemetry-instrumentation-redis==0.45b0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 788)) (0.45b0)
Requirement already satisfied: opentelemetry-instrumentation-requests==0.45b0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 791)) (0.45b0)
Requirement already satisfied: opentelemetry-instrumentation-wsgi==0.45b0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 794)) (0.45b0)
Requirement already satisfied: opentelemetry-proto==1.24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 798)) (1.24.0)
Requirement already satisfied: opentelemetry-sdk==1.24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 805)) (1.24.0)
Requirement already satisfied: opentelemetry-semantic-conventions==0.45b0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 811)) (0.45b0)
Requirement already satisfied: opentelemetry-util-http==0.45b0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 820)) (0.45b0)
Requirement already satisfied: packaging==24.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 827)) (24.0)
Requirement already satisfied: pdf2image==1.17.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 831)) (1.17.0)
Requirement already satisfied: pillow==10.3.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 834)) (10.3.0)
Requirement already satisfied: pint==0.21 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 910)) (0.21)
Requirement already satisfied: pip-licenses==4.4.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 913)) (4.4.0)
Requirement already satisfied: prettytable==3.10.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 916)) (3.10.0)
Requirement already satisfied: protobuf==4.25.3 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 920)) (4.25.3)
Requirement already satisfied: py-moneyed==3.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 935)) (3.0)
Requirement already satisfied: pycparser==2.22 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 939)) (2.22)
Requirement already satisfied: pydyf==0.10.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 943)) (0.10.0)
Requirement already satisfied: pyjwt==2.8.0 in /root/.local/lib/python3.11/site-packages (from pyjwt[crypto]==2.8.0->-r src/backend/requirements.txt (line 947)) (2.8.0)
Requirement already satisfied: pyphen==0.15.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 953)) (0.15.0)
Requirement already satisfied: pypng==0.20220715.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 957)) (0.20220715.0)
Requirement already satisfied: python-barcode==0.15.1 in /root/.local/lib/python3.11/site-packages (from python-barcode[images]==0.15.1->-r src/backend/requirements.txt (line 961)) (0.15.1)
Requirement already satisfied: python-dateutil==2.9.0.post0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 964)) (2.9.0.post0)
Requirement already satisfied: python-dotenv==1.0.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 970)) (1.0.1)
Requirement already satisfied: python-fsutil==0.14.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 973)) (0.14.1)
Requirement already satisfied: python3-openid==3.2.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 977)) (3.2.0)
Requirement already satisfied: pytz==2024.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 981)) (2024.1)
Requirement already satisfied: pyyaml==6.0.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 988)) (6.0.1)
Requirement already satisfied: qrcode==7.4.2 in /root/.local/lib/python3.11/site-packages (from qrcode[pil]==7.4.2->-r src/backend/requirements.txt (line 1043)) (7.4.2)
Requirement already satisfied: rapidfuzz==3.9.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1047)) (3.9.0)
Requirement already satisfied: redis==5.0.4 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1138)) (5.0.4)
Requirement already satisfied: referencing==0.35.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1142)) (0.35.1)
Requirement already satisfied: regex==2024.4.28 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1148)) (2024.4.28)
Requirement already satisfied: requests==2.31.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1228)) (2.31.0)
Requirement already satisfied: requests-oauthlib==2.0.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1236)) (2.0.0)
Requirement already satisfied: rpds-py==0.18.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1240)) (0.18.1)
Requirement already satisfied: sentry-sdk==2.1.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1343)) (2.1.1)
Collecting setuptools==69.5.1 (from -r src/backend/requirements.txt (line 1347))
  Downloading setuptools-69.5.1-py3-none-any.whl (894 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 894.6/894.6 kB 1.5 MB/s eta 0:00:00
Requirement already satisfied: sgmllib3k==1.0.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1353)) (1.0.0)
Requirement already satisfied: six==1.16.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1356)) (1.16.0)
Requirement already satisfied: sqlparse==0.5.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1363)) (0.5.0)
Requirement already satisfied: tablib==3.5.0 in /root/.local/lib/python3.11/site-packages (from tablib[html,ods,xls,xlsx,yaml]==3.5.0->-r src/backend/requirements.txt (line 1369)) (3.5.0)
Requirement already satisfied: tinycss2==1.2.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1373)) (1.2.1)
Requirement already satisfied: typing-extensions==4.11.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1380)) (4.11.0)
Requirement already satisfied: uritemplate==4.1.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1389)) (4.1.1)
Requirement already satisfied: urllib3==2.2.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1395)) (2.2.1)
Requirement already satisfied: wcwidth==0.2.13 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1402)) (0.2.13)
Requirement already satisfied: weasyprint==61.2 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1406)) (61.2)
Requirement already satisfied: webencodings==0.5.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1410)) (0.5.1)
Requirement already satisfied: whitenoise==6.6.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1418)) (6.6.0)
Requirement already satisfied: wrapt==1.16.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1421)) (1.16.0)
Requirement already satisfied: xlrd==2.0.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1496)) (2.0.1)
Requirement already satisfied: xlwt==1.3.0 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1500)) (1.3.0)
Requirement already satisfied: zipp==3.18.1 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1504)) (3.18.1)
Requirement already satisfied: zopfli==0.2.3 in /root/.local/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1508)) (0.2.3)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 72.1.0
    Uninstalling setuptools-72.1.0:
      Successfully uninstalled setuptools-72.1.0
Successfully installed setuptools-69.5.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
Installing plugin packages from '/home/inventree/data/plugins.txt'
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
Backing up InvenTree database...
Python version 3.11.9 - /usr/local/bin/python3
/root/.local/lib/python3.11/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")
Backing Up Database: inventree
 pg_dump --dbname=postgresql://pguser:pgpassword@inventree-db:5432/inventree --format=custom 
CommandConnectorError: Error running:  pg_dump --dbname=postgresql://pguser:pgpassword@inventree-db:5432/inventree --format=custom 
pg_dump: error: server version: 14.12 (Debian 14.12-1.pgdg120+1); pg_dump version: 13.15
pg_dump: error: aborting because of server version mismatch

  File "/root/.local/lib/python3.11/site-packages/dbbackup/utils.py", line 120, in wrapper
    func(*args, **kwargs)
  File "/root/.local/lib/python3.11/site-packages/dbbackup/management/commands/dbbackup.py", line 93, in handle
    self._save_new_backup(database)
  File "/root/.local/lib/python3.11/site-packages/dbbackup/management/commands/dbbackup.py", line 106, in _save_new_backup
    outputfile = self.connector.create_dump()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/dbbackup/db/base.py", line 92, in create_dump
    return self._create_dump()
           ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/dbbackup/db/postgresql.py", line 112, in _create_dump
    stdout, stderr = self.run_command(cmd, env=self.dump_env)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/dbbackup/db/base.py", line 171, in run_command
    raise exceptions.CommandConnectorError(

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/home/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/root/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/root/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/root/.local/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/root/.local/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/dbbackup/utils.py", line 120, in wrapper
    func(*args, **kwargs)
  File "/root/.local/lib/python3.11/site-packages/dbbackup/management/commands/dbbackup.py", line 93, in handle
    self._save_new_backup(database)
  File "/root/.local/lib/python3.11/site-packages/dbbackup/management/commands/dbbackup.py", line 106, in _save_new_backup
    outputfile = self.connector.create_dump()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/dbbackup/db/base.py", line 92, in create_dump
    return self._create_dump()
           ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/dbbackup/db/postgresql.py", line 112, in _create_dump
    stdout, stderr = self.run_command(cmd, env=self.dump_env)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/dbbackup/db/base.py", line 171, in run_command
    raise exceptions.CommandConnectorError(
dbbackup.db.exceptions.CommandConnectorError: Error running:  pg_dump --dbname=postgresql://pguser:pgpassword@inventree-db:5432/inventree --format=custom 
pg_dump: error: server version: 14.12 (Debian 14.12-1.pgdg120+1); pg_dump version: 13.15
pg_dump: error: aborting because of server version mismatch

Next is Create Administrator Account:

larry@larry-MS-7693:~/MyInventory$ sudo docker compose run inventree-server invoke superuser
WARN[0000] /home/larry/MyInventory/docker-compose.yml: `version` is obsolete 
[+] Creating 1/0
 ✔ Container inventree-db  Running                                                                                                                                                                     0.0s 
Loading config file : /home/inventree/data/config.yaml
Python version 3.11.9 - /usr/local/bin/python3
/root/.local/lib/python3.11/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")

You have 594 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): InvenTree, account, admin, auth, build, common, company, contenttypes, django_q, error_report, exchange, flags, label, machine, order, otp_static, otp_totp, part, plugin, report, socialaccount, stock, taggit, user_sessions, users.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
                                                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/home/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/root/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/root/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/root/.local/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/root/.local/lib/python3.11/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 88, in execute
    return super().execute(*args, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 109, in handle
    default_username = get_default_username(database=database)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/contrib/auth/management/__init__.py", line 168, in get_default_username
    auth_app.User._default_manager.db_manager(database).get(
  File "/root/.local/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 633, in get
    num = len(clone)
          ^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 380, in __len__
    self._fetch_all()
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1881, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 91, in __iter__
    results = compiler.execute_sql(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
Start Docker Containers[¶](https://docs.inventree.org/en/stable/start/docker_install/#start-docker-containers)

Now that the database has been created, migrations applied, and you have created an admin account, we are ready to launch the InvenTree containers:
larry@larry-MS-7693:~/MyInventory$ sudo docker compose up -d
WARN[0000] /home/larry/MyInventory/docker-compose.yml: `version` is obsolete 
[+] Running 5/0
 ✔ Container inventree-cache   Running                                                                                                                                                                 0.0s 
 ✔ Container inventree-db      Running                                                                                                                                                                 0.0s 
 ✔ Container inventree-worker  Running                                                                                                                                                                 0.0s 
 ✔ Container inventree-proxy   Running                                                                                                                                                                 0.0s 
 ✔ Container inventree-server  Started
You should now be able to view the InvenTree login screen at http://inventree.localhost/ (or whatever custom domain you have configured in the .env file).

No!, the only thing I get is an empty screen.

SchrodingersGat commented 2 months ago

Ok, from these logs, there is a mismatch in your postgresql versions.

dbbackup.db.exceptions.CommandConnectorError: Error running:  pg_dump --dbname=postgresql://pguser:pgpassword@inventree-db:5432/inventree --format=custom 
pg_dump: error: server version: 14.12 (Debian 14.12-1.pgdg120+1); pg_dump version: 13.15
pg_dump: error: aborting because of server version mismatch

Can you please dump the contents of your docker-compose.yml file?

LarryJoy commented 2 months ago

Okay Oliver, here it is:

larry@larry-MS-7693:~/MyInventory$ cat docker-compose.yml

version: "3.8"

# Docker compose recipe for a production-ready InvenTree setup, with the following containers:
# - PostgreSQL as the database backend
# - gunicorn as the InvenTree web server
# - django-q as the InvenTree background worker process
# - Caddy as a reverse proxy
# - redis as the cache manager (optional, disabled by default)

# ---------------------
# READ BEFORE STARTING!
# ---------------------

# -----------------------------
# Setting environment variables
# -----------------------------
# Shared environment variables should be stored in the .env file
# Changes made to this file are reflected across all containers!
#
# IMPORTANT NOTE:
# You should not have to change *anything* within this docker-compose.yml file!
# Instead, make any changes in the .env file!

# ------------------------
# InvenTree Image Versions
# ------------------------
# By default, this docker-compose script targets the STABLE version of InvenTree,
# image: inventree/inventree:stable
#
# To run the LATEST (development) version of InvenTree,
# change the INVENTREE_TAG variable (in the .env file) to "latest"
#
# Alternatively, you could target a specific tagged release version with (for example):
# INVENTREE_TAG=0.7.5
#

services:
    # Database service
    # Use PostgreSQL as the database backend
    inventree-db:
        image: postgres:14
        container_name: inventree-db
        expose:
            - ${INVENTREE_DB_PORT:-5432}/tcp
        environment:
            - PGDATA=/var/lib/postgresql/data/pgdb
            - POSTGRES_USER=${INVENTREE_DB_USER:?You must provide the 'INVENTREE_DB_USER' variable in the .env file}
            - POSTGRES_PASSWORD=${INVENTREE_DB_PASSWORD:?You must provide the 'INVENTREE_DB_PASSWORD' variable in the .env file}
            - POSTGRES_DB=${INVENTREE_DB_NAME:?You must provide the 'INVENTREE_DB_NAME' variable in the .env file}
        volumes:
            # Map 'data' volume such that postgres database is stored externally
            - ${INVENTREE_EXT_VOLUME:?You must specify the 'INVENTREE_EXT_VOLUME' variable in the .env file!}:/var/lib/postgresql/data/:z
        restart: unless-stopped

    # redis acts as database cache manager
    inventree-cache:
        image: redis:7.0
        container_name: inventree-cache
        env_file:
            - .env
        expose:
            - ${INVENTREE_CACHE_PORT:-6379}
        restart: always

    # InvenTree web server service
    # Uses gunicorn as the web server
    inventree-server:
        # If you wish to specify a particular InvenTree version, do so here
        image: inventree/inventree:${INVENTREE_TAG:-stable}
        container_name: inventree-server
        # Only change this port if you understand the stack.
        exposelarry@larry-MS-7693:~/MyInventory$ cat docker-compose.yml
version: "3.8"

# Docker compose recipe for a production-ready InvenTree setup, with the following containers:
# - PostgreSQL as the database backend
# - gunicorn as the InvenTree web server
# - django-q as the InvenTree background worker process
# - Caddy as a reverse proxy
# - redis as the cache manager (optional, disabled by default)

# ---------------------
# READ BEFORE STARTING!
# ---------------------

# -----------------------------
# Setting environment variables
# -----------------------------
# Shared environment variables should be stored in the .env file
# Changes made to this file are reflected across all containers!
#
# IMPORTANT NOTE:
# You should not have to change *anything* within this docker-compose.yml file!
# Instead, make any changes in the .env file!

# ------------------------
# InvenTree Image Versions
# ------------------------
# By default, this docker-compose script targets the STABLE version of InvenTree,
# image: inventree/inventree:stable
#
# To run the LATEST (development) version of InvenTree,
# change the INVENTREE_TAG variable (in the .env file) to "latest"
#
# Alternatively, you could target a specific tagged release version with (for example):
# INVENTREE_TAG=0.7.5
#

services:
    # Database service
    # Use PostgreSQL as the database backend
    inventree-db:
        image: postgres:14
        container_name: inventree-db
        expose:
            - ${INVENTREE_DB_PORT:-5432}/tcp
        environment:
            - PGDATA=/var/lib/postgresql/data/pgdb
            - POSTGRES_USER=${INVENTREE_DB_USER:?You must provide the 'INVENTREE_DB_USER' variable in the .env file}
            - POSTGRES_PASSWORD=${INVENTREE_DB_PASSWORD:?You must provide the 'INVENTREE_DB_PASSWORD' variable in the .env file}
            - POSTGRES_DB=${INVENTREE_DB_NAME:?You must provide the 'INVENTREE_DB_NAME' variable in the .env file}
        volumes:
            # Map 'data' volume such that postgres database is stored externally
            - ${INVENTREE_EXT_VOLUME:?You must specify the 'INVENTREE_EXT_VOLUME' variable in the .env file!}:/var/lib/postgresql/data/:z
        restart: unless-stopped

    # redis acts as database cache manager
    inventree-cache:
        image: redis:7.0
        container_name: inventree-cache
        env_file:
            - .env
        expose:
            - ${INVENTREE_CACHE_PORT:-6379}
        restart: always

    # InvenTree web server service
    # Uses gunicorn as the web server
    inventree-server:
        # If you wish to specify a particular InvenTree version, do so here
        image: inventree/inventree:${INVENTREE_TAG:-stable}
        container_name: inventree-server
        # Only change this port if you understand the stack.
        expose:
            - 8000
        depends_on:
            - inventree-db
        env_file:
            - .env
        volumes:
            # Data volume must map to /home/inventree/data
            - ${INVENTREE_EXT_VOLUME}:/home/inventree/data:z
        restart: unless-stopped

    # Background worker process handles long-running or periodic tasks
    inventree-worker:
        # If you wish to specify a particular InvenTree version, do so here
        image: inventree/inventree:${INVENTREE_TAG:-stable}
        container_name: inventree-worker
        command: invoke worker
        depends_on:
            - inventree-server
        env_file:
            - .env
        volumes:
            # Data volume must map to /home/inventree/data
            - ${INVENTREE_EXT_VOLUME}:/home/inventree/data:z
        restart: unless-stopped

    # caddy acts as reverse proxy and static file server
    # https://hub.docker.com/_/caddy
    inventree-proxy:
        container_name: inventree-proxy
        image: caddy:alpine
        restart: always
        depends_on:
            - inventree-server
        ports:
            - ${INVENTREE_WEB_PORT:-80}:80
            - 443:443
        env_file:
            - .env
        volumes:
            - ./Caddyfile:/etc/caddy/Caddyfile:ro,z
            - ${INVENTREE_EXT_VOLUME}/static:/var/www/static:z
            - ${INVENTREE_EXT_VOLUME}/media:/var/www/media:z
            - ${INVENTREE_EXT_VOLUME}:/var/log:z
            - ${INVENTREE_EXT_VOLUME}:/data:z
            - ${INVENTREE_EXT_VOLUME}:/config:z

    # alternative: run nginx as reverse proxy
    # inventree-proxy:
    #     container_name: inventree-proxy
    #     image: nginx:stable
    #     restart: always
    #     depends_on:
    #         - inventree-server
    #     ports:
    #         - ${INVENTREE_WEB_PORT:-80}:80
    #         - 443:443
    #     volumes:
    #         - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro,z
    #         - ${INVENTREE_EXT_VOLUME}:/var/www:z:
            - 8000
        depends_on:
            - inventree-db
        env_file:
            - .env
        volumes:
            # Data volume must map to /home/inventree/data
            - ${INVENTREE_EXT_VOLUME}:/home/inventree/data:z
        restart: unless-stopped

    # Background worker process handles long-running or periodic tasks
    inventree-worker:
        # If you wish to specify a particular InvenTree version, do so here
        image: inventree/inventree:${INVENTREE_TAG:-stable}
        container_name: inventree-worker
        command: invoke worker
        depends_on:
            - inventree-server
        env_file:
            - .env
        volumes:
            # Data volume must map to /home/inventree/data
            - ${INVENTREE_EXT_VOLUME}:/home/inventree/data:z
        restart: unless-stopped

    # caddy acts as reverse proxy and static file server
    # https://hub.docker.com/_/caddy
    inventree-proxy:
        container_name: inventree-proxy
        image: caddy:alpine
        restart: always
        depends_on:
            - inventree-server
        ports:
            - ${INVENTREE_WEB_PORT:-80}:80
            - 443:443
        env_file:
            - .env
        volumes:
            - ./Caddyfile:/etc/caddy/Caddyfile:ro,z
            - ${INVENTREE_EXT_VOLUME}/static:/var/www/static:z
            - ${INVENTREE_EXT_VOLUME}/media:/var/www/media:z
            - ${INVENTREE_EXT_VOLUME}:/var/log:z
            - ${INVENTREE_EXT_VOLUME}:/data:z
            - ${INVENTREE_EXT_VOLUME}:/config:z

    # alternative: run nginx as reverse proxy
    # inventree-proxy:
    #     container_name: inventree-proxy
    #     image: nginx:stable
    #     restart: always
    #     depends_on:
    #         - inventree-server
    #     ports:
    #         - ${INVENTREE_WEB_PORT:-80}:80
    #         - 443:443
    #     volumes:
    #         - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro,z
    #         - ${INVENTREE_EXT_VOLUME}:/var/www:z
SchrodingersGat commented 2 months ago

Ok. please change this line:

        image: postgres:14

to

        image: postgres:13

And then run invoke update again

LarryJoy commented 2 months ago

Ok Oliver, I was able to use nano and change the image: postgres:14 to image: postgres:13 as the following indicates: services:

Database service

# Use PostgreSQL as the database backend
inventree-db:
    image: postgres:13

I then ran 'invoke update' but got the following: larry@larry-MS-7693:~/MyInventory$ invoke update Can't find any collection named 'tasks'!

What next?

SchrodingersGat commented 2 months ago

When presented with this error, refer to the hint from @LarryJoy in a comment above:

"larry@larry-MS-7693:/MyInventory$ sudo invoke update"
"[sudo] password for larry: "
"Can't find any collection named 'tasks'!"
I then executed: "docker compose run --rm inventree-server invoke update"
LarryJoy commented 2 months ago

Sorry Oliver, you lost me. What do you mean by "refer to the hint from (myself) in a comment above. Am I running the commands in the proper order? If not, what commands and in what order?

SchrodingersGat commented 2 months ago

When I say run "invoke update", it is in the context of your docker container. So, (as previously) the exact command to run is:

docker compose run --rm inventree-server invoke update
LarryJoy commented 2 months ago

Here is what I got when I ran the terminal command at my /home/larry/MyInventory directory: larry@larry-MS-7693:~/MyInventory$ sudo docker compose run --rm inventree-server invoke update [sudo] password for larry: WARN[0000] /home/larry/MyInventory/docker-compose.yml: version is obsolete [+] Running 15/15 ✔ inventree-db Pulled 324.8s ✔ efc2b5ad9eec Already exists 0.0s ✔ 8e8135c28017 Pull complete 0.8s ✔ 3be82923cb81 Pull complete 22.6s ✔ d8bb69bfc610 Pull complete 22.7s ✔ f341c31be036 Pull complete 53.5s ✔ 92c033323052 Pull complete 53.7s ✔ 9904701bc6d5 Pull complete 53.7s ✔ df2e91128297 Pull complete 53.8s ✔ 914341ba37e9 Pull complete 322.4s ✔ 8b880ee990a9 Pull complete 322.5s ✔ cb2de3069d69 Pull complete 322.5s ✔ 5bd78d233082 Pull complete 322.6s ✔ eae53aac4f7d Pull complete 322.7s ✔ a19fa965e15f Pull complete 322.7s [+] Creating 0/1 ⠸ Container inventree-db Recreate 14.3s Error response from daemon: cannot stop container: 6ecab652ffe88970dc398ab2533eeba99e97b1dd72c12de312ba2d049bdf8a4e: permission denied

I don't understand the "docker-compose.yml: 'version' is obsolete." And then there is the "Error response from daemon: cannot stop container..." I also ran: larry@larry-MS-7693:~/MyInventory$ cat docker-compose.yml version: "3.8" Of course I don't know if that is the correct version, what it should be, and how to change it?

I ran the "docker-compose.yml a 2nd time, don't know why, but here is what I got: larry@larry-MS-7693:~/MyInventory$ sudo docker compose run --rm inventree-server invoke update WARN[0000] /home/larry/MyInventory/docker-compose.yml: version is obsolete [+] Creating 1/0 ✔ Container 6ecab652ffe8_inventree-db Removed 0.0s ⠋ Container inventree-db Recreate 0.0s Error response from daemon: Conflict. The container name "/6ecab652ffe8_inventree-db" is already in use by container "c4b17044206a8203f6677881e266163a3367c52f00ce91841330e69cef2cac82". You have to remove (or rename) that container to be able to reuse that name.

So what next?

LarryJoy commented 2 months ago

Hello Oliver, I tried the following and maybe this is the problem: larry@larry-MS-7693:~$ sudo apt update && sudo apt upgrade Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:7 https://packages.mozilla.org/apt mozilla InRelease
Get:8 https://dl.packager.io/srv/deb/inventree/InvenTree/stable/ubuntu 20.04 InRelease [1,863 B] Err:8 https://dl.packager.io/srv/deb/inventree/InvenTree/stable/ubuntu 20.04 InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B6D583CCBD33EEB8 Reading package lists... Done W: GPG error: https://dl.packager.io/srv/deb/inventree/InvenTree/stable/ubuntu 20.04 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B6D583CCBD33EEB8 E: The repository 'https://dl.packager.io/srv/deb/inventree/InvenTree/stable/ubuntu 20.04 InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. Note at "Get:8" and "Err:8" it refers to inventree on Ubuntu 20.04. Then there is the "W: (warning)" and the "E: (error)". And I don't know what the "N:" means, but looks like a problem. --Larry

github-actions[bot] commented 2 weeks ago

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

LarryJoy commented 2 weeks ago

I now have InvenTree up and running and I am using it. I got the program running by using JustAnswer, it cost me US $111. I would have donated this much to InvenTree but nobody wanted to work with me one-on-one.