inventree / InvenTree

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

InvenTree cannot be set to be accessed over HTTPS. #7762

Closed zly20129 closed 1 month ago

zly20129 commented 3 months ago

Please verify that this bug has NOT been raised before.

Describe the bug*

For the source of the question, see!7723 InvenTree 0.15.6 can't call the camera from ipad/iphone safari browser in website. I couldn't call the camera by way of a web page, and the developer told me that I had to use HTTPS access in order to do so, so I started setting up HTTPS, but it never worked.

Steps to Reproduce

For more information, please refer to!7744 How do I set up HTTPS web access? I copied the following steps from the responses to the discussion.

For this reply I'll try to change to use HTTPS access and record all actions and logs (usernames and passwords I'll override with question marks).

zly@ubuntu20server:~/inventree/contrib/container$ cat .env
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple

# 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=/home/zly/inventree-data

# Default web port for the InvenTree server
#INVENTREE_WEB_PORT=80

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

# 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"
INVENTREE_SITE_URL="https://1.1.1.12"

# System time-zone (default is UTC)
# Reference: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
INVENTREE_TIMEZONE='Asia/Shanghai'

# Base currency code (or use env var INVENTREE_BASE_CURRENCY)
INVENTREE_BASE_CURRENCY=CNY

COMPOSE_PROJECT_NAME=inventree
zly@ubuntu20server:~/inventree/contrib/container$ docker compose up -d
WARN[0000] /home/zly/inventree/contrib/container/docker-compose.yml: `version` is obsolete 
[+] Running 4/4
 ✔ Container inventree-db      Running                                                          0.0s 
 ✔ Container inventree-server  Started                                                         13.7s 
 ✔ Container inventree-worker  Started                                                         11.1s 
 ✔ Container inventree-proxy   Started                                                         11.1s 
zly@ubuntu20server:~/inventree/contrib/container$ 
zly@ubuntu20server:~/inventree/contrib/container$ docker compose restart
WARN[0000] /home/zly/inventree/contrib/container/docker-compose.yml: `version` is obsolete 
[+] Restarting 4/4
 ✔ Container inventree-db      Started                                                          1.1s 
 ✔ Container inventree-worker  Started                                                         10.5s 
 ✔ Container inventree-proxy   Started                                                          1.2s 
 ✔ Container inventree-server  Started                                                          3.1s 
zly@ubuntu20server:~/inventree/contrib/container$ 
zly@ubuntu20server:~/inventree/contrib/container$ docker compose up -d
WARN[0000] /home/zly/inventree/contrib/container/docker-compose.yml: `version` is obsolete 
[+] Running 4/0
 ✔ Container inventree-db      Running                                                          0.0s 
 ✔ Container inventree-server  Running                                                          0.0s 
 ✔ Container inventree-worker  Running                                                          0.0s 
 ✔ Container inventree-proxy   Running                                                          0.0s 
zly@ubuntu20server:~/inventree/contrib/container$ 

屏幕截图 2024-07-27 213234 屏幕截图 2024-07-27 213333

Expected behaviour

Successfully set up HTTPS access to call the camera.

Deployment Method

Version Information

Version Information:

InvenTree-Version: 0.15.6 Django Version: 4.2.14 Commit Hash: 23a9485 Commit Date: 2024-07-23

Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-5.4.0-190-generic-x86_64-with Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.0.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}, {'name': 'IPNGenerator', 'slug': 'ipngen', 'version': '0.1'}]

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

Relevant log output

zly@ubuntu20server:~/inventree/contrib/container$ docker logs inventree-server 
Loading config file : /home/inventree/data/config.yaml
Python version 3.11.9 - /usr/local/bin/python
/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")
Loading config file : /home/inventree/data/config.yaml
Python version 3.11.9 - /usr/local/bin/python
/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")
zly@ubuntu20server:~/inventree/contrib/container$ 
zly@ubuntu20server:~/inventree/contrib/container$ docker logs inventree-db

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-24 04:10:01.023 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-24 04:10:01.023 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 04:10:01.023 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 04:10:01.024 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 04:10:01.028 UTC [27] LOG:  database system was shut down at 2024-07-24 04:08:03 UTC
2024-07-24 04:10:01.036 UTC [1] LOG:  database system is ready to accept connections
2024-07-24 04:54:04.285 UTC [1] LOG:  received fast shutdown request
2024-07-24 04:54:04.288 UTC [1] LOG:  aborting any active transactions
2024-07-24 04:54:04.288 UTC [2343] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.288 UTC [2335] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.289 UTC [2334] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.291 UTC [2296] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.292 UTC [2332] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.294 UTC [120] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.299 UTC [2333] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.301 UTC [2354] FATAL:  terminating connection due to administrator command
2024-07-24 04:54:04.305 UTC [1] LOG:  background worker "logical replication launcher" (PID 33) exited with exit code 1
2024-07-24 04:54:04.312 UTC [28] LOG:  shutting down
2024-07-24 04:54:04.356 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-24 04:54:30.854 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-24 04:54:30.856 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 04:54:30.863 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 04:54:30.870 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 04:54:30.878 UTC [27] LOG:  database system was shut down at 2024-07-24 04:54:04 UTC
2024-07-24 04:54:30.900 UTC [1] LOG:  database system is ready to accept connections
2024-07-24 05:22:28.290 UTC [1] LOG:  received fast shutdown request
2024-07-24 05:22:28.291 UTC [1] LOG:  aborting any active transactions
2024-07-24 05:22:28.291 UTC [1296] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.291 UTC [1294] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.295 UTC [1069] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.295 UTC [56] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.301 UTC [614] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.303 UTC [838] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.312 UTC [1] LOG:  background worker "logical replication launcher" (PID 33) exited with exit code 1
2024-07-24 05:22:28.313 UTC [1432] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.315 UTC [1435] FATAL:  terminating connection due to administrator command
2024-07-24 05:22:28.329 UTC [28] LOG:  shutting down
2024-07-24 05:22:28.345 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-24 05:22:54.035 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-24 05:22:54.037 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 05:22:54.038 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 05:22:54.039 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 05:22:54.058 UTC [27] LOG:  database system was shut down at 2024-07-24 05:22:28 UTC
2024-07-24 05:22:54.115 UTC [1] LOG:  database system is ready to accept connections
2024-07-24 05:47:07.130 UTC [1] LOG:  received fast shutdown request
2024-07-24 05:47:07.131 UTC [1] LOG:  aborting any active transactions
2024-07-24 05:47:07.132 UTC [1244] FATAL:  terminating connection due to administrator command
2024-07-24 05:47:07.132 UTC [1242] FATAL:  terminating connection due to administrator command
2024-07-24 05:47:07.132 UTC [1212] FATAL:  terminating connection due to administrator command
2024-07-24 05:47:07.135 UTC [1236] FATAL:  terminating connection due to administrator command
2024-07-24 05:47:07.135 UTC [1157] FATAL:  terminating connection due to administrator command
2024-07-24 05:47:07.137 UTC [1214] FATAL:  terminating connection due to administrator command
2024-07-24 05:47:07.141 UTC [1] LOG:  background worker "logical replication launcher" (PID 33) exited with exit code 1
2024-07-24 05:47:07.145 UTC [1278] FATAL:  terminating connection due to administrator command
2024-07-24 05:47:07.149 UTC [28] LOG:  shutting down
2024-07-24 05:47:07.170 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-24 05:47:33.509 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-24 05:47:33.510 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 05:47:33.511 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 05:47:33.513 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 05:47:33.519 UTC [27] LOG:  database system was shut down at 2024-07-24 05:47:07 UTC
2024-07-24 05:47:33.558 UTC [1] LOG:  database system is ready to accept connections
2024-07-24 05:48:22.982 UTC [1] LOG:  received fast shutdown request
2024-07-24 05:48:22.985 UTC [1] LOG:  aborting any active transactions
2024-07-24 05:48:22.985 UTC [113] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:22.986 UTC [194] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:22.987 UTC [107] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:22.988 UTC [115] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:22.989 UTC [86] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:22.993 UTC [54] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:22.993 UTC [199] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:22.997 UTC [83] FATAL:  terminating connection due to administrator command
2024-07-24 05:48:23.007 UTC [1] LOG:  background worker "logical replication launcher" (PID 33) exited with exit code 1
2024-07-24 05:48:23.014 UTC [28] LOG:  shutting down
2024-07-24 05:48:23.037 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-24 05:48:49.477 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-24 05:48:49.482 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 05:48:49.483 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 05:48:49.487 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 05:48:49.495 UTC [27] LOG:  database system was shut down at 2024-07-24 05:48:23 UTC
2024-07-24 05:48:49.533 UTC [1] LOG:  database system is ready to accept connections
2024-07-24 08:41:05.667 UTC [1] LOG:  received fast shutdown request
2024-07-24 08:41:05.668 UTC [1] LOG:  aborting any active transactions
2024-07-24 08:41:05.679 UTC [1] LOG:  background worker "logical replication launcher" (PID 33) exited with exit code 1
2024-07-24 08:41:05.681 UTC [8170] FATAL:  terminating connection due to administrator command
2024-07-24 08:41:05.687 UTC [8169] FATAL:  terminating connection due to administrator command
2024-07-24 08:41:05.708 UTC [28] LOG:  shutting down
2024-07-24 08:41:05.735 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-24 08:41:33.185 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-24 08:41:33.186 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 08:41:33.186 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 08:41:33.190 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 08:41:33.203 UTC [26] LOG:  database system was shut down at 2024-07-24 08:41:05 UTC
2024-07-24 08:41:33.227 UTC [1] LOG:  database system is ready to accept connections
2024-07-24 08:42:53.591 UTC [1] LOG:  received fast shutdown request
2024-07-24 08:42:53.592 UTC [1] LOG:  aborting any active transactions
2024-07-24 08:42:53.592 UTC [198] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.592 UTC [156] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.592 UTC [140] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.595 UTC [142] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.595 UTC [53] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.598 UTC [151] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.598 UTC [204] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.598 UTC [1] LOG:  background worker "logical replication launcher" (PID 32) exited with exit code 1
2024-07-24 08:42:53.600 UTC [152] FATAL:  terminating connection due to administrator command
2024-07-24 08:42:53.606 UTC [27] LOG:  shutting down
2024-07-24 08:42:53.621 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-24 08:42:55.019 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-24 08:42:55.020 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-24 08:42:55.021 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-24 08:42:55.022 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-24 08:42:55.026 UTC [27] LOG:  database system was shut down at 2024-07-24 08:42:53 UTC
2024-07-24 08:42:55.032 UTC [1] LOG:  database system is ready to accept connections
2024-07-24 13:58:33.082 UTC [1] LOG:  received fast shutdown request
2024-07-24 13:58:33.083 UTC [1] LOG:  aborting any active transactions
2024-07-24 13:58:33.083 UTC [14060] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.083 UTC [14235] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.086 UTC [13834] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.087 UTC [13610] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.093 UTC [14058] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.095 UTC [13385] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.100 UTC [58] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.106 UTC [1] LOG:  background worker "logical replication launcher" (PID 33) exited with exit code 1
2024-07-24 13:58:33.106 UTC [14252] FATAL:  terminating connection due to administrator command
2024-07-24 13:58:33.118 UTC [28] LOG:  shutting down
2024-07-24 13:58:33.136 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-25 04:09:48.691 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-25 04:09:48.696 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-25 04:09:48.696 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-25 04:09:48.700 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-25 04:09:48.710 UTC [28] LOG:  database system was shut down at 2024-07-24 13:58:33 UTC
2024-07-25 04:09:48.754 UTC [1] LOG:  database system is ready to accept connections
2024-07-26 06:40:27.100 UTC [1] LOG:  received fast shutdown request
2024-07-26 06:40:27.108 UTC [1] LOG:  aborting any active transactions
2024-07-26 06:40:27.108 UTC [36641] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.108 UTC [36643] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.108 UTC [36461] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.109 UTC [36637] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.115 UTC [36236] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.115 UTC [36012] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.120 UTC [36659] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.123 UTC [1] LOG:  background worker "logical replication launcher" (PID 34) exited with exit code 1
2024-07-26 06:40:27.130 UTC [55] FATAL:  terminating connection due to administrator command
2024-07-26 06:40:27.147 UTC [29] LOG:  shutting down
2024-07-26 06:40:27.192 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-26 06:41:30.463 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-26 06:41:30.464 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-26 06:41:30.465 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-26 06:41:30.466 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-26 06:41:30.474 UTC [26] LOG:  database system was shut down at 2024-07-26 06:40:27 UTC
2024-07-26 06:41:30.494 UTC [1] LOG:  database system is ready to accept connections
2024-07-26 06:42:14.804 UTC [1] LOG:  received fast shutdown request
2024-07-26 06:42:14.805 UTC [1] LOG:  aborting any active transactions
2024-07-26 06:42:14.805 UTC [158] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.805 UTC [112] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.808 UTC [106] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.808 UTC [53] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.810 UTC [85] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.811 UTC [114] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.812 UTC [84] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.818 UTC [1] LOG:  background worker "logical replication launcher" (PID 32) exited with exit code 1
2024-07-26 06:42:14.819 UTC [160] FATAL:  terminating connection due to administrator command
2024-07-26 06:42:14.822 UTC [27] LOG:  shutting down
2024-07-26 06:42:14.843 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-26 15:20:00.211 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-26 15:20:00.212 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-26 15:20:00.213 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-26 15:20:00.214 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-26 15:20:00.224 UTC [26] LOG:  database system was shut down at 2024-07-26 06:42:14 UTC
2024-07-26 15:20:00.273 UTC [1] LOG:  database system is ready to accept connections
2024-07-26 15:23:11.449 UTC [1] LOG:  received fast shutdown request
2024-07-26 15:23:11.450 UTC [1] LOG:  aborting any active transactions
2024-07-26 15:23:11.450 UTC [362] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.450 UTC [308] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.450 UTC [306] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.453 UTC [248] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.454 UTC [53] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.460 UTC [257] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.465 UTC [249] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.469 UTC [1] LOG:  background worker "logical replication launcher" (PID 32) exited with exit code 1
2024-07-26 15:23:11.490 UTC [385] FATAL:  terminating connection due to administrator command
2024-07-26 15:23:11.494 UTC [27] LOG:  shutting down
2024-07-26 15:23:11.517 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-27 04:50:40.817 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-27 04:50:40.822 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-27 04:50:40.822 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-27 04:50:40.826 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-27 04:50:40.837 UTC [28] LOG:  database system was shut down at 2024-07-26 15:23:11 UTC
2024-07-27 04:50:40.888 UTC [1] LOG:  database system is ready to accept connections
2024-07-27 04:57:43.454 UTC [1] LOG:  received fast shutdown request
2024-07-27 04:57:43.455 UTC [1] LOG:  aborting any active transactions
2024-07-27 04:57:43.455 UTC [470] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.455 UTC [468] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.455 UTC [506] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.458 UTC [341] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.458 UTC [433] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.459 UTC [55] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.461 UTC [273] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.467 UTC [518] FATAL:  terminating connection due to administrator command
2024-07-27 04:57:43.475 UTC [1] LOG:  background worker "logical replication launcher" (PID 34) exited with exit code 1
2024-07-27 04:57:43.477 UTC [519] FATAL:  the database system is shutting down
2024-07-27 04:57:43.477 UTC [29] LOG:  shutting down
2024-07-27 04:57:43.520 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-27 12:58:57.931 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-27 12:58:57.933 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-27 12:58:57.933 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-27 12:58:57.937 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-27 12:58:58.058 UTC [28] LOG:  database system was shut down at 2024-07-27 04:57:43 UTC
2024-07-27 12:58:58.213 UTC [1] LOG:  database system is ready to accept connections
2024-07-27 13:30:18.070 UTC [1] LOG:  received fast shutdown request
2024-07-27 13:30:18.071 UTC [1] LOG:  aborting any active transactions
2024-07-27 13:30:18.071 UTC [1628] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.074 UTC [1580] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.077 UTC [1551] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.078 UTC [1518] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.078 UTC [1574] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.079 UTC [1630] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.087 UTC [1673] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.088 UTC [1] LOG:  background worker "logical replication launcher" (PID 34) exited with exit code 1
2024-07-27 13:30:18.089 UTC [1676] FATAL:  terminating connection due to administrator command
2024-07-27 13:30:18.092 UTC [29] LOG:  shutting down
2024-07-27 13:30:18.109 UTC [1] LOG:  database system is shut down

PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-07-27 13:30:19.347 UTC [1] LOG:  starting PostgreSQL 13.15 (Debian 13.15-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-07-27 13:30:19.353 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-07-27 13:30:19.353 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-07-27 13:30:19.354 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-07-27 13:30:19.359 UTC [28] LOG:  database system was shut down at 2024-07-27 13:30:18 UTC
2024-07-27 13:30:19.372 UTC [1] LOG:  database system is ready to accept connections
zly@ubuntu20server:~/inventree/contrib/container$ 
ly@ubuntu20server:~/inventree/contrib/container$ docker logs inventree-worker 
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")
Waiting for database...
Database connection successful!
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")
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")
Waiting for database...
Database connection successful!
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")
zly@ubuntu20server:~/inventree/contrib/container$ 
zly@ubuntu20server:~/inventree/contrib/container$ docker logs inventree-proxy
{"level":"info","ts":1722086878.3168325,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
{"level":"info","ts":1722086878.320103,"msg":"adapted config to JSON","adapter":"caddyfile"}
{"level":"info","ts":1722086878.322405,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"info","ts":1722086878.322855,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
{"level":"info","ts":1722086878.322929,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1722086878.3237162,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000406100"}
{"level":"info","ts":1722086878.3249052,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
{"level":"info","ts":1722086878.32717,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/data/caddy","instance":"4b7827e0-d02c-43b1-9a6e-82ad057471ab","try_again":1722173278.3271663,"try_again_in":86399.999998971}
{"level":"info","ts":1722086878.3273058,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":1722086878.3459175,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
{"level":"info","ts":1722086878.3461735,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"info","ts":1722086878.3462963,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
{"level":"info","ts":1722086878.3463058,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["1.1.1.12"]}
{"level":"info","ts":1722086878.3472302,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
{"level":"info","ts":1722086878.3472738,"msg":"serving initial configuration"}
{"level":"info","ts":1722086878.3477387,"logger":"tls.obtain","msg":"acquiring lock","identifier":"1.1.1.12"}
{"level":"info","ts":1722086878.3490047,"logger":"tls.obtain","msg":"lock acquired","identifier":"1.1.1.12"}
{"level":"info","ts":1722086878.3493028,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"1.1.1.12"}
{"level":"error","ts":1722086878.35111,"logger":"tls.obtain","msg":"will retry","error":"[1.1.1.12] Obtain: subject '1.1.1.12' cannot have public IP certificate from https://acme-v02.api.letsencrypt.org/directory (if CA's policy has changed, please notify the developers in an issue)","attempt":1,"retrying_in":60,"elapsed":0.001911873,"max_duration":2592000}
{"level":"info","ts":1722086938.3518393,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"1.1.1.12"}
{"level":"error","ts":1722086938.352284,"logger":"tls.obtain","msg":"will retry","error":"[1.1.1.12] Obtain: subject '1.1.1.12' cannot have public IP certificate from https://acme-v02.api.letsencrypt.org/directory (if CA's policy has changed, please notify the developers in an issue)","attempt":2,"retrying_in":120,"elapsed":60.003095825,"max_duration":2592000}
{"level":"info","ts":1722087018.074757,"msg":"shutting down apps, then terminating","signal":"SIGTERM"}
{"level":"warn","ts":1722087018.074812,"msg":"exiting; byeee!! 👋","signal":"SIGTERM"}
{"level":"info","ts":1722087018.074876,"logger":"http","msg":"servers shutting down with eternal grace period"}
{"level":"info","ts":1722087018.0755029,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
{"level":"info","ts":1722087018.0755348,"msg":"shutdown complete","signal":"SIGTERM","exit_code":0}
{"level":"info","ts":1722087019.4731226,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
{"level":"info","ts":1722087019.4761958,"msg":"adapted config to JSON","adapter":"caddyfile"}
{"level":"info","ts":1722087019.4832501,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"info","ts":1722087019.4836795,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
{"level":"info","ts":1722087019.4837186,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1722087019.4839768,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000305d00"}
{"level":"info","ts":1722087019.4853885,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
{"level":"info","ts":1722087019.4857075,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
{"level":"info","ts":1722087019.4878008,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"info","ts":1722087019.4882147,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
{"level":"info","ts":1722087019.488271,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["1.1.1.12"]}
{"level":"info","ts":1722087019.488704,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/data/caddy","instance":"4b7827e0-d02c-43b1-9a6e-82ad057471ab","try_again":1722173419.488702,"try_again_in":86399.999999263}
{"level":"info","ts":1722087019.4889474,"logger":"tls.obtain","msg":"acquiring lock","identifier":"1.1.1.12"}
{"level":"info","ts":1722087019.488959,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":1722087019.488711,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
{"level":"info","ts":1722087019.489179,"msg":"serving initial configuration"}
{"level":"info","ts":1722087019.4987252,"logger":"tls.obtain","msg":"lock acquired","identifier":"1.1.1.12"}
{"level":"info","ts":1722087019.498894,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"1.1.1.12"}
{"level":"error","ts":1722087019.4993927,"logger":"tls.obtain","msg":"will retry","error":"[1.1.1.12] Obtain: subject '1.1.1.12' cannot have public IP certificate from https://acme-v02.api.letsencrypt.org/directory (if CA's policy has changed, please notify the developers in an issue)","attempt":1,"retrying_in":60,"elapsed":0.000605262,"max_duration":2592000}
{"level":"info","ts":1722087079.499669,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"1.1.1.12"}
{"level":"error","ts":1722087079.500149,"logger":"tls.obtain","msg":"will retry","error":"[1.1.1.12] Obtain: subject '1.1.1.12' cannot have public IP certificate from https://acme-v02.api.letsencrypt.org/directory (if CA's policy has changed, please notify the developers in an issue)","attempt":2,"retrying_in":120,"elapsed":60.001356058,"max_duration":2592000}
zly@ubuntu20server:~/inventree/contrib/container$ 
zly20129 commented 3 months ago

My InvenTree is deployed in Ubuntu 20.04 on a VMware 15.0 workstation platform, so I can package the whole system and send it to you if you gents want to know the exact problem.

SchrodingersGat commented 3 months ago

@zly20129 two questions to get started here:

1 - Does the system work when you return to using http? Or is it broken once you attempt https? 2 - You also change the IP address. Does it work if you use https://inventree.localhost?

zly20129 commented 3 months ago

@zly20129 two questions to get started here:

1 - Does the system work when you return to using http? Or is it broken once you attempt https? 2 - You also change the IP address. Does it work if you use https://inventree.localhost?

  1. Everything works fine using HTTP, no problems with the system, except for the camera.
  2. In follow:
    • On my current machine, which is using a server version of the system with no GUI, I'm not sure if I can access it via this HTTPS domain.
    • I tried installing InvenTree on another Ubuntu 20.04 desktop VM and it was accessible via this domain, but after setting the ip, neither the ip address nor 127.0.0.1 was accessible via HTTPS, although setting it to an HTTP IP was fine.
    • The IP address is mandatory to change as it cannot be accessed over the LAN without changing it.
SchrodingersGat commented 3 months ago

Understood to access via another computer you'll need to specify an IP. But, please try (on the same system where http://inventree.localhost is accessible) if the https://inventree.localhost works. Trying to eliminate potential differences.

zly20129 commented 3 months ago

Understood to access via another computer you'll need to specify an IP. But, please try (on the same system where http://inventree.localhost is accessible) if the https://inventree.localhost works. Trying to eliminate potential differences.

This domain name you provided is accessible via HTTPS on the computer running the server.

zly20129 commented 3 months ago

Understood to access via another computer you'll need to specify an IP. But, please try (on the same system where http://inventree.localhost is accessible) if the https://inventree.localhost works. Trying to eliminate potential differences.

This pitiful translation software, it causes some ambiguity. What this sentence was supposed to mean: I just, tried to install InvenTree on another Ubuntu 20.04 desktop system (running on a VM virtual machine), and in the Firefox browser it came with, it was possible to access it via https://inventree.localhost这个域名访问. However, after setting it to HTTPS:// IP, neither the HTTPS:// IP address nor HTTPS://127.0.0.1 are accessible via HTTPS. But setting it to HTTP://IP doesn't have this problem. ----"I tried installing InvenTree on another Ubuntu 20.04 desktop VM and it was accessible via this domain, but after setting the ip, neither the ip address nor 127.0.0.1 was accessible via HTTPS, although setting it to an HTTP IP was fine."

SchrodingersGat commented 3 months ago

@zly20129 this might be a limitation of the HTTPS certificates when running against a bare IP, rather than a hostname.

Apparently letsencrypt (which is what we use for certs, via our caddy container) doesn't issue certificates for bare IP addresses (whereas they will for a domain name, even if it is self-signed).

So.. that may be the reason that your browser is throwing an error, and is not something that we can address on our end. The combination of "bare" IP address and HTTPS is maybe not possible.

zly20129 commented 3 months ago

@zly20129 this might be a limitation of the HTTPS certificates when running against a bare IP, rather than a hostname.

Apparently letsencrypt (which is what we use for certs, via our caddy container) doesn't issue certificates for bare IP addresses (whereas they will for a domain name, even if it is self-signed).

So.. that may be the reason that your browser is throwing an error, and is not something that we can address on our end. The combination of "bare" IP address and HTTPS is maybe not possible.

Is there any way, then, to avoid the problem of using a bare IP setup that prevents the browser from opening? 那有没有什么方式,可以避免采用裸IP设置导致浏览器无法打开的问题? I don't think the point of this issue is the bare IP address, the heart of the issue is how to make it possible for a server to serve devices on a LAN via HTTPS. 我认为这个问题的重点并非是裸IP地址,问题的核心在于如何让服务器可以通过HTTPS的方式为局域网的设备提供服务。 This is because if you don't set it up in the IP way and use the domain name setting. 因为如果不用IP的方式设置,使用域名设置的话。 This means that the server's web interface can only be opened on the machine on which it is deployed, and all devices on the LAN cannot access the web management interface over the network. 这就意味着服务器的网络界面只能在部署它的那台机器上打开,局域网中的所有设备都无法通过网络访问网络管理界面。

github-actions[bot] commented 1 month ago

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