immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
53.39k stars 2.82k forks source link

[BUG] <title> a error when i deploy the server #2247

Closed zwpride closed 1 year ago

zwpride commented 1 year ago

The bug

when i try to bash install.sh just like this,

xxx@xxx:~/scriptim$ sudo bash install.sh
[sudo] password for xxx:
Starting Immich installation...
Creating Immich directory...
Downloading docker-compose.yml...
Downloading .env file...
Populating default UPLOAD_LOCATION value...
Starting Immich's docker containers
[+] Running 12/12
 ⠿ Network immich-app_default         Created                                                    0.3s
 ⠿ Volume "immich-app_tsdata"         Created                                                    0.0s
 ⠿ Volume "immich-app_pgdata"         Created                                                    0.0s
 ⠿ Volume "immich-app_model-cache"    Created                                                    0.0s
 ⠿ Container immich_postgres          Started                                                    7.0s
 ⠿ Container immich_machine_learning  Started                                                    7.4s
 ⠿ Container immich_typesense         Started                                                    6.1s
 ⠿ Container immich_web               Started                                                    6.2s
 ⠿ Container immich_redis             Started                                                    7.5s
 ⠿ Container immich_server            Started                                                   12.2s
 ⠿ Container immich_microservices     Started                                                   11.6s
 ⠿ Container immich_proxy             Started                                                   16.4s
Succesfully deployed Immich!
You can access the website at http://192.168.0.113:2283 and the server URL for the mobile app is http://192.168.0.113:2283/api
The library location is /home/zwpride/scriptim/immich-app/immich-data
---------------------------------------------------
If you want to configure custom information of the server, including the database, Redis information, or the backup (or upload) location, etc.

  1. First bring down the containers with the command 'docker-compose down' in the immich-app directory,

  2. Then change the information that fits your needs in the '.env' file,

  3. Finally, bring the containers back up with the command 'docker-compose up --remove-orphans -d' in the immich-app directory

howerver, when i enter http://192.168.0.113:2283 in my browser

500 connect ECONNREFUSED 172.23.0.7:3001

image

The OS that Immich Server is running on

Ubuntu 22.10

Version of Immich Server

lastest

Version of Immich Mobile App

lastet

Platform with the issue

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:release
    entrypoint: ["/bin/sh", "./start-server.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:release
    entrypoint: ["/bin/sh", "./start-microservices.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:release
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    env_file:
      - .env
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.0
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
    logging:
      driver: none
    volumes:
      - tsdata:/data
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:release
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always

volumes:
  pgdata:
  model-cache:
  tsdata:

Your .env content

###################################################################################
# Database
###################################################################################

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich

# Optional Database settings:
# DB_PORT=5432

###################################################################################
# Redis
###################################################################################

REDIS_HOSTNAME=immich_redis

# REDIS_URL will be used to pass custom options to ioredis.
# Example for Sentinel
# {"sentinels":[{"host":"redis-sentinel-node-0","port":26379},{"host":"redis-sentinel-node-1","port":26379},{"host":"redis-sentinel-node-2","port":26379}],"name":"redis-sentinel"}
# REDIS_URL=ioredis://eyJzZW50aW5lbHMiOlt7Imhvc3QiOiJyZWRpcy1zZW50aW5lbDEiLCJwb3J0IjoyNjM3OX0seyJob3N0IjoicmVkaXMtc2VudGluZWwyIiwicG9ydCI6MjYzNzl9XSwibmFtZSI6Im15bWFzdGVyIn0=

# Optional Redis settings:

# Note: these parameters are not automatically passed to the Redis Container
# to do so, please edit the docker-compose.yml file as well. Redis is not configured
# via environment variables, only redis.conf or the command line

# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_USERNAME=
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Upload File Location
#
# This is the location where uploaded files are stored.
###################################################################################

UPLOAD_LOCATION=/home/zwpride/scriptim/immich-app/immich-data

###################################################################################
# Typesense
###################################################################################
TYPESENSE_API_KEY=some-random-text
# TYPESENSE_ENABLED=false
# TYPESENSE_URL uses base64 encoding for the nodes json.
# Example JSON that was used:
# [
#      { 'host': 'typesense-1.example.net', 'port': '443', 'protocol': 'https' },
#      { 'host': 'typesense-2.example.net', 'port': '443', 'protocol': 'https' },
#      { 'host': 'typesense-3.example.net', 'port': '443', 'protocol': 'https' },
#  ]
# TYPESENSE_URL=ha://WwogICAgeyAnaG9zdCc6ICd0eXBlc2Vuc2UtMS5leGFtcGxlLm5ldCcsICdwb3J0JzogJzQ0MycsICdwcm90b2NvbCc6ICdodHRwcycgfSwKICAgIHsgJ2hvc3QnOiAndHlwZXNlbnNlLTIuZXhhbXBsZS5uZXQnLCAncG9ydCc6ICc0NDMnLCAncHJvdG9jb2wnOiAnaHR0cHMnIH0sCiAgICB7ICdob3N0JzogJ3R5cGVzZW5zZS0zLmV4YW1wbGUubmV0JywgJ3BvcnQnOiAnNDQzJywgJ3Byb3RvY29sJzogJ2h0dHBzJyB9LApd

###################################################################################
# Reverse Geocoding
#
# Reverse geocoding is done locally which has a small impact on memory usage
# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable
# This ranges from 0-3 with 3 being the most precise
# 3 - Cities > 500 population: ~200MB RAM
# 2 - Cities > 1000 population: ~150MB RAM
# 1 - Cities > 5000 population: ~80MB RAM
# 0 - Cities > 15000 population: ~40MB RAM
####################################################################################

# DISABLE_REVERSE_GEOCODING=false
# REVERSE_GEOCODING_PRECISION=3

####################################################################################
# WEB - Optional
#
# Custom message on the login page, should be written in HTML form.
# For example:
# PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>"
####################################################################################

PUBLIC_LOGIN_PAGE_MESSAGE=

####################################################################################
# Alternative Service Addresses - Optional
#
# This is an advanced feature for users who may be running their immich services on different hosts.
# It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers.
# Note: immich-microservices is bound to 3002, but no references are made
####################################################################################

IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

####################################################################################
# Alternative API's External Address - Optional
#
# This is an advanced feature used to control the public server endpoint returned to clients during Well-known discovery.
# You should only use this if you want mobile apps to access the immich API over a custom URL. Do not include trailing slash.
# NOTE: At this time, the web app will not be affected by this setting and will continue to use the relative path: /api
# Examples: http://localhost:3001, http://immich-api.example.com, etc
####################################################################################

#IMMICH_API_URL_EXTERNAL=http://localhost:3001

Reproduction steps

wget install.sh
sudo bash install.sh
the error happen

Additional information

none

alextran1502 commented 1 year ago

I don't think you should use sudo to run the install script. Can you check the server log? What is your machine architecture?

zwpride commented 1 year ago

docker need sudo.

i do not known the log of the server

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         36 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  2
  On-line CPU(s) list:   0,1
Vendor ID:               AuthenticAMD
  Model name:            AMD E-450 APU with Radeon(tm) HD Graphics
    CPU family:          20
    Model:               2
    Thread(s) per core:  1
    Core(s) per socket:  2
    Socket(s):           1
    Stepping:            0
    CPU max MHz:         1650.0000
    CPU min MHz:         825.0000
    BogoMIPS:            3293.06
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc
                          cpuid extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt hw_pstate vmmcall arat npt lbrv
                          svm_lock nrip_save pausefilter
Virtualization features:
  Virtualization:        AMD-V
Caches (sum of all):
  L1d:                   64 KiB (2 instances)
  L1i:                   64 KiB (2 instances)
  L2:                    1 MiB (2 instances)
NUMA:
  NUMA node(s):          1
  NUMA node0 CPU(s):     0,1
Vulnerabilities:
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec store bypass:     Vulnerable
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Not affected
  Tsx async abort:       Not affected

although i do not know what happened , but i think it will helps you to locate the problem.

immich_typesense         | I20230414 08:13:17.638414     1 typesense_server_utils.cpp:357] Starting Typesense 0.24.0
immich_typesense         | I20230414 08:13:17.638654     1 typesense_server_utils.cpp:360] Typesense is using jemalloc.
immich_typesense         | I20230414 08:13:17.640018     1 typesense_server_utils.cpp:409] Thread pool size: 16
immich_typesense         | I20230414 08:13:17.650410     1 store.h:63] Initializing DB by opening state dir: /data/db
immich_typesense         | I20230414 08:13:18.973608     1 store.h:63] Initializing DB by opening state dir: /data/meta
immich_typesense         | I20230414 08:13:20.458003     1 ratelimit_manager.cpp:475] Loaded 0 rate limit rules.
immich_typesense         | I20230414 08:13:20.458070     1 ratelimit_manager.cpp:476] Loaded 0 rate limit bans.
immich_typesense         | I20230414 08:13:20.458292     1 typesense_server_utils.cpp:504] Starting API service...
immich_typesense         | I20230414 08:13:20.459201     1 http_server.cpp:178] Typesense has started listening on port 8108
immich_typesense         | I20230414 08:13:20.459908   119 typesense_server_utils.cpp:255] Since no --nodes argument is provided, starting a single node Typesense cluster.
immich_typesense         | I20230414 08:13:20.459975   120 batched_indexer.cpp:124] Starting batch indexer with 16 threads.
immich_typesense         | I20230414 08:13:20.463430   120 batched_indexer.cpp:129] BatchedIndexer skip_index: -9999
immich_typesense         | I20230414 08:13:20.530608   119 server.cpp:1045] Server[braft::RaftStatImpl+braft::FileServiceImpl+braft::RaftServiceImpl+braft::CliServiceImpl] is serving on port=8107.
immich_typesense         | I20230414 08:13:20.530815   119 server.cpp:1048] Check out http://15225a480af3:8107 in web browser.
immich_typesense         | I20230414 08:13:20.655813   119 raft_server.cpp:65] Nodes configuration: 172.18.0.6:8107:8108
immich_typesense         | I20230414 08:13:20.730566   119 raft_server.cpp:106] Snapshot does not exist. We will remove db dir and init db fresh.
immich_typesense         | I20230414 08:13:20.735563   119 store.h:298] rm /data/db success
immich_typesense         | I20230414 08:13:20.736900   119 store.h:63] Initializing DB by opening state dir: /data/db
immich_typesense         | I20230414 08:13:21.481458   119 store.h:322] DB open success!
immich_typesense         | I20230414 08:13:21.482623   119 raft_server.cpp:490] Loading collections from disk...
immich_typesense         | I20230414 08:13:21.522084   119 collection_manager.cpp:159] CollectionManager::load()
immich_typesense         | I20230414 08:13:21.523252   119 auth_manager.cpp:34] Indexing 0 API key(s) found on disk.
immich_typesense         | I20230414 08:13:21.523641   119 collection_manager.cpp:179] Loading upto 8 collections in parallel, 1000 documents at a time.
immich_typesense         | I20230414 08:13:21.524497   119 collection_manager.cpp:188] Found 0 collection(s) on disk.
immich_typesense         | I20230414 08:13:21.526494   119 collection_manager.cpp:278] Loaded 0 collection(s).
immich_typesense         | I20230414 08:13:21.528663   119 collection_manager.cpp:282] Initializing batched indexer from snapshot state...
immich_typesense         | I20230414 08:13:21.528767   119 raft_server.cpp:497] Finished loading collections from disk.
immich_typesense         | I20230414 08:13:21.530104   119 log.cpp:677] Use murmurhash32 as the checksum type of appending entries
immich_typesense         | I20230414 08:13:21.652644   119 log.cpp:1158] log load_meta /data/state/log/log_meta first_log_index: 1 time: 122456
immich_typesense         | I20230414 08:13:21.653941   119 log.cpp:1098] load open segment, path: /data/state/log first_index: 1
immich_typesense         | I20230414 08:13:21.697124   119 raft_meta.cpp:521] Loaded single stable meta, path /data/state/meta term 2 votedfor 172.23.0.8:8107:8108 time: 41344
immich_typesense         | I20230414 08:13:21.697595   119 raft_meta.cpp:521] Loaded single stable meta, path /data/state/meta term 2 votedfor 172.23.0.8:8107:8108 time: 61
immich_typesense         | I20230414 08:13:21.697824   119 node.cpp:576] node default_group:172.18.0.6:8107:8108 init, term: 2 last_log_id: (index=1,term=2) conf: 172.23.0.8:8107:8108 old_conf:
immich_typesense         | I20230414 08:13:21.698684   119 raft_server.cpp:129] Node last_index: 1
immich_typesense         | I20230414 08:13:21.698813   119 typesense_server_utils.cpp:306] Typesense peering service is running on 172.18.0.6:8107
immich_typesense         | I20230414 08:13:21.698927   119 typesense_server_utils.cpp:307] Snapshot interval configured as: 3600s
immich_typesense         | I20230414 08:13:21.699030   119 typesense_server_utils.cpp:308] Snapshot max byte count configured as: 4194304
immich_typesense         | W20230414 08:13:21.699169   119 controller.cpp:1454] SIGINT was installed with 1
immich_typesense         | I20230414 08:13:21.699319   119 raft_server.cpp:545] Term: 2, last_index index: 1, committed_index: 0, known_applied_index: 0, applying_index: 0, queued_writes: 0, pending_queue_size: 0, local_sequence: 0
immich_typesense         | W20230414 08:13:21.700541   119 raft_server.cpp:569] Single-node with no leader. Resetting peers.
immich_typesense         | W20230414 08:13:21.700656   119 node.cpp:894] node default_group:172.18.0.6:8107:8108 set_peer from 172.23.0.8:8107:8108 to 172.18.0.6:8107:8108
immich_typesense         | I20230414 08:13:21.794957   119 raft_meta.cpp:546] Saved single stable meta, path /data/state/meta term 3 votedfor 0.0.0.0:0:0 time: 94130
immich_typesense exited with code 132
immich_typesense exited with code 132
immich_typesense exited with code 132
immich_typesense exited with code 132

and this

immich_server            | [Nest] 1  - 04/14/2023, 8:14:05 AM     LOG [SearchService] Running bootstrap
immich_typesense exited with code 132
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_server            | Request #1681460045078: Request to Node 0 failed due to "ECONNREFUSED connect ECONNREFUSED 172.18.0.6:8108"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_typesense exited with code 132
immich_machine_learning  | [2023-04-14 08:14:15 +0000] [1] [INFO] Starting gunicorn 20.1.0
immich_machine_learning  | [2023-04-14 08:14:15 +0000] [1] [INFO] Listening at: http://0.0.0.0:3003 (1)
immich_machine_learning  | [2023-04-14 08:14:15 +0000] [1] [INFO] Using worker: gthread
immich_machine_learning  | [2023-04-14 08:14:15 +0000] [9] [INFO] Booting worker with pid: 9
immich_machine_learning  | [2023-04-14 08:14:15 +0000] [10] [INFO] Booting worker with pid: 10
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_typesense         | I20230414 08:14:28.655442     1 store.h:63] Initializing DB by opening state dir: /data/db
immich_typesense         | E20230414 08:14:28.845432     7 backward.hpp:4199] Stack trace (most recent call last) in thread 7:
immich_typesense         | E20230414 08:14:28.845860     7 backward.hpp:4199] #7    Object "", at 0xffffffffffffffff, in

immich_typesense         | E20230414 08:14:28.845944     7 backward.hpp:4199] #6    Object "/usr/lib/x86_64-linux-gnu/libc-2.31.so", at 0x7eff0e3bb132, in __clone
immich_typesense         | E20230414 08:14:28.846024     7 backward.hpp:4199] #5    Object "/usr/lib/x86_64-linux-gnu/libpthread-2.31.so", at 0x7eff0e5f7608, in start_thread
immich_typesense         | E20230414 08:14:28.846469     7 backward.hpp:4199] #4    Object "/opt/typesense-server", at 0x84d328, in bvar::detail::SamplerCollector::sampling_thread(void*)
immich_typesense         | E20230414 08:14:28.847002     7 backward.hpp:4199] #3    Object "/opt/typesense-server", at 0x84b818, in bvar::detail::SamplerCollector::run()
immich_typesense         | E20230414 08:14:28.847091     7 backward.hpp:4199] #2  | Source "/usr/local/include/bvar/passive_status.h", line 62, in get_value
immich_typesense         | E20230414 08:14:28.847821     7 backward.hpp:4199]       Source "/usr/local/include/bvar/passive_status.h", line 140, in take_sample [0x7a4323]
immich_typesense         | E20230414 08:14:28.847965     7 backward.hpp:4199] #1    Source "/opt/braft-80d97b2475b3c0afca79c19b64d46bb665d704f4/src/braft/util.cpp", line 215, in counter_percentile [0x7e17df]
immich_typesense         | E20230414 08:14:28.848042     7 backward.hpp:4199] #0    Source "/usr/local/include/bvar/detail/percentile.h", line 294, in snprintf [0x7e51e5]
immich_typesense         | Illegal instruction (Illegal operand [0x7e51e5])
immich_typesense         | I20230414 08:14:28.883960     1 store.h:63] Initializing DB by opening state dir: /data/meta
immich_typesense         | E20230414 08:14:29.053434     7 typesense_server.cpp:102] Typesense 0.24.0 is terminating abruptly.
immich_typesense exited with code 1
immich_server            | Request #1681460045078: Request to Node 0 failed due to "ECONNABORTED timeout of 10000ms exceeded"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_microservices     | [Nest] 1  - 04/14/2023, 8:14:45 AM     LOG [MetadataExtractionProcessor] Reverse Geocoding Initialized
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_typesense exited with code 132
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
immich_server            | Request #1681460045078: Request to Node 0 failed due to "EAI_AGAIN getaddrinfo EAI_AGAIN typesense"
immich_server            | Request #1681460045078: Sleeping for 4s and then retrying request...
bo0tzz commented 1 year ago

The cpu you're using doesn't support some instructions that are required by typesense. You can remove it from the docker-compose.yml and disable it for Immich by setting TYPESENSE_ENABLED=false in the .env file.

zwpride commented 1 year ago

amzing!!!!!!!!!!!!!!!!

The cpu you're using doesn't support some instructions that are required by typesense. You can remove it from the docker-compose.yml and disable it for Immich by setting TYPESENSE_ENABLED=false in the .env file.