Closed PricelessToolkit closed 22 hours ago
title says missing pics.. this is what I get in the new interface..
yep the same thing, Do you still have access to the old interface?
If you have made such a large update (0.12.x to 0.16.x) please note that our docker setup has changed considerably.
Have you updated your docker-compose.yml
file too?
The UI is not rendering /media/
files which means that the proxy is either not running or not serving files correctly. Our new docker setup uses Caddy as the proxy, whereas the old one uses nginx.
Bare minimum, please share a list of containers that are running, and look for any error messages in the logs for each container.
Also, your browser should be reporting a bunch of network errors when trying to access files under /media/
Okay, thanks. I will try to upgrade it with a new compose, caddy, and .env and report back. Thanks!!
With the new Compose and Caddy, everything is now working perfectly. The only adjustment I made was updating the "domain" in the Caddy configuration. The .env file remains unchanged.
Thank you!!
@PricelessToolkit awesome, glad you got it working :)
After a reboot, the system stopped working.
I took a new approach, and here’s what I observed after updating "0.12.x to 0.16.8"
data
folder is located at /home/inventree/data
, which contains both media
and static
subfolders.Here is the output of my docker ps
command:
CONTAINER ID | IMAGE | COMMAND | CREATED | STATUS | PORTS | NAMES |
---|---|---|---|---|---|---|
9b3dfde1b6a5 | inventree/inventree:stable | /bin/ash ./init.sh … |
41 minutes ago | Up 41 minutes | 8000/tcp | inventree-worker |
0ac86a1966cd | caddy:alpine | caddy run --config … |
41 minutes ago | Up 41 minutes | 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 443/udp, 2019/tcp | inventree-proxy |
511310bbd620 | inventree/inventree:stable | /bin/ash ./init.sh … |
41 minutes ago | Up 41 minutes | 8000/tcp | inventree-server |
6eec5f16b569 | postgres:13 | docker-entrypoint.s… |
41 minutes ago | Up 41 minutes | 5432/tcp | inventree-db |
56a914c4a86a | redis:7.0 | docker-entrypoint.s… |
41 minutes ago | Up 41 minutes | 6379/tcp | inventree-cache |
my Caddyfile PS: the file should be next to docker-compose right?
log {
output file /var/log/caddy/{args[0]}.access.log
}
}
(cors-headers) {
header Allow GET,HEAD,OPTIONS
header Access-Control-Allow-Origin *
header Access-Control-Allow-Methods GET,HEAD,OPTIONS
header Access-Control-Allow-Headers Authorization,Content-Type,User-Agent
@cors_preflight{args[0]} method OPTIONS
handle @cors_preflight{args[0]} {
respond "" 204
}
}
# Change the host to your domain (this will serve at inventree.localhost)
{$INVENTREE_SITE_URL:inventree-new.lab.lan} {
import log_common inventree
encode gzip
request_body {
max_size 100MB
}
handle_path /static/* {
import cors-headers static
root * /var/www/static
file_server
}
handle_path /media/* {
import cors-headers media
root * /var/www/media
file_server
header Content-Disposition attachment
forward_auth {$INVENTREE_SERVER:"http://inventree-server:8000"} {
uri /auth/
}
}
reverse_proxy {$INVENTREE_SERVER:"http://inventree-server:8000"}
}
.env file
# e.g. Linux
INVENTREE_EXT_VOLUME=/home/inventree/data
INVENTREE_SITE_URL="http://inventree-new.lab.lan"
# 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=usr
INVENTREE_ADMIN_PASSWORD=pass
INVENTREE_ADMIN_EMAIL=email
# 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=usr
INVENTREE_DB_PASSWORD=pass
# 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_ENABLED=True
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
COMPOSE_PROJECT_NAME=inventree
docker-compose.yaml is original https://raw.githubusercontent.com/inventree/inventree/stable/contrib/container/docker-compose.yml
I tried several times and couldn't figure out what the problem was, and how it worked the first time is not clear... If you can give me some advice, it would be great.
Thank you!
In the config.yaml file, these two lines are commented out. Is this the correct configuration?
# MEDIA_ROOT is the local filesystem location for storing uploaded files
#media_root: '/home/inventree/data/media'
# STATIC_ROOT is the local filesystem location for storing static files
#static_root: '/home/inventree/data/static'
The media and static root dirs are already defined in the docker container configuration, so it is ok to leave them commented out in your config.yaml
file.
Can you look in the logs for each container, perhaps there is a clue there. If you are making requests to the server which are failing, either the inventree-proxy
or inventree-server
container logs should show errors
inventree-proxy logs "Login attempt to old UI" web page just blnks
docker logs inventree-proxy
{"level":"info","ts":1732155005.2088892,"logger":"http.log.access","msg":"NOP","request":{"remote_ip":"192.168.1.107","remote_port":"61109","client_ip":"192.168.1.107","proto":"HTTP/1.1","method":"GET","host":"inventree-new","uri":"/","headers":{"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Accept-Encoding":["gzip, deflate"],"Accept-Language":["en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7,ru-RU;q=0.6,ru;q=0.5"],"Cookie":["REDACTED"],"Connection":["keep-alive"],"Upgrade-Insecure-Requests":["1"]}},"bytes_read":0,"user_id":"","duration":0.000002508,"size":0,"status":0,"resp_headers":{"Server":["Caddy"]}}
{"level":"info","ts":1732155005.3218799,"logger":"http.log.access","msg":"NOP","request":{"remote_ip":"192.168.1.107","remote_port":"61109","client_ip":"192.168.1.107","proto":"HTTP/1.1","method":"GET","host":"inventree-new","uri":"/favicon.ico","headers":{"Referer":["http://inventree-new/"],"Accept-Encoding":["gzip, deflate"],"Accept-Language":["en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7,ru-RU;q=0.6,ru;q=0.5"],"Cookie":["REDACTED"],"Connection":["keep-alive"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"],"Accept":["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"]}},"bytes_read":0,"user_id":"","duration":0.000002567,"size":0,"status":0,"resp_headers":{"Server":["Caddy"]}}
docker logs inventree-server
192.168.1.125 - - [21/Nov/2024:03:43:06 +0000] "GET / HTTP/1.1" 302 0 "http://inventree-new.lab.lan/accounts/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
192.168.1.125 - - [21/Nov/2024:03:43:06 +0000] "GET /accounts/login/?next=/ HTTP/1.1" 200 8505 "http://inventree-new.lab.lan/accounts/login/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
192.168.1.125 - - [21/Nov/2024:03:46:46 +0000] "POST /accounts/login/ HTTP/1.1" 302 0 "http://inventree-new.lab.lan/accounts/login/?next=/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
192.168.1.125 - - [21/Nov/2024:03:46:46 +0000] "GET / HTTP/1.1" 302 0 "http://inventree-new.lab.lan/accounts/login/?next=/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
192.168.1.125 - - [21/Nov/2024:03:46:46 +0000] "GET /accounts/login/?next=/ HTTP/1.1" 200 8505 "http://inventree-new.lab.lan/accounts/login/?next=/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
PS: If I install InvenTree from scratch, then run docker-compose down, copy the database and media folders, then compose up, will it work?
docker compose down
. media
, pgdb
, plugins
folders, and plugins.txt
from updated version to the new installation’s data folder. docker compose up -d
. This time Everything worked!
Deployment Method
Steps to Reproduce
Describe the problem*
Hi, I have an Inventree "0.12.7" server running on a Proxmox container. I decided to update Inventree to the latest stable version "0.16.8".
I cloned the container, and the new container's domain name is "inventree-new," while the old one is "inventree."
Problem
PS: I also tried the latest dev version, but the result is the same.
Steps to Reproduce
I added the following to the
.env
file because the old setup didn't have this configuration:After updating the .env file, I ran the following commands to update the system and bring the new container online:
Relevant log output