[BUG] 1.9.1 deployment failed #1790

Closed
opened 2026-02-05 03:48:39 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @9k001 on GitHub (Dec 15, 2023).

The bug

The container logs on the microservices side of server show that they are not connected to the database.
It seems that previous environment variables have no effect, such as:
DB_HOSTNAME.
DB_PORT.
DB_USERNAME.
DB_PASSWORD.
DB_DATABASE_NAME.
My PostgreSQL is deployed independently.
I use ansible for standardized deployment.
Confirm that the table has been created: immich.
Confirm that cube,earthdistance,vectors is installed.
Confirm that the container environment has loaded the aforementioned environment variables.
Confirm that there is no problem with v1.89.0 installation and operation.

The OS that Immich Server is running on

docker

Version of Immich Server

v1.91.0

Version of Immich Mobile App

v1.91.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: '3.5'
services:
  immich-server:
    image: ghcr.io/immich-app/immich-server:{{ IMMICH_VERSION }}
    container_name: immich-server
    restart: always
    volumes:
      - ${APP_DATA_HOME}/project/immich/immich-server/upload:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "{{ SERVER_PORT }}:3001"
    env_file:
      - ${WORKSPACE_HOME}/{{ DeployRepo }}/immich/env/server.env
    command: [ "start.sh", "immich" ]
    environment:
      - TZ=Asia/Shanghai

  immich-microservices:
    image: ghcr.io/immich-app/immich-server:{{ IMMICH_VERSION }}
    container_name: immich-microservices
    restart: always
    volumes:
      - ${APP_DATA_HOME}/project/immich/immich-server/upload:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "{{ MICROSERVICES_PORT }}:3002"
    env_file:
      - ${WORKSPACE_HOME}/{{ DeployRepo }}/immich/env/microservices.env
    command: [ "start.sh", "microservices" ]
    environment:
      - TZ=Asia/Shanghai

  immich-machine_learning:
    image: ghcr.io/immich-app/immich-machine-learning:{{ IMMICH_VERSION }}
    container_name: immich-machine_learning
    restart: always
    volumes:
      - ${APP_DATA_HOME}/project/immich/machine_learning/cache:/cache
    ports:
      - "{{ MACHINE_LEARNING_PORT }}:3003"
    env_file:
      - ${WORKSPACE_HOME}/{{ DeployRepo }}/immich/env/machine_learning.env
    environment:
      - TZ=Asia/Shanghai

networks:
  default:
    name: ${MODE_ENV}
    external: true

Your .env content

# 数据库 地址
DB_HOSTNAME={{ SERVICE_DB_HOSTNAME }}

# 数据库 端口
DB_PORT={{ SERVICE_DB_PORT }}

# 数据库 账号
DB_USERNAME={{ SERVICE_DB_USERNAME }}

# 数据库 密码
DB_PASSWORD={{ SERVICE_DB_PASSWORD }}

# 数据库 表名
DB_DATABASE_NAME={{ DB_TABLES }}

# Redis 地址
REDIS_HOSTNAME={{ SERVICE_REDIS_HOSTNAME }}

# Redis 端口
REDIS_PORT={{ SERVICE_REDIS_PORT }}

Reproduction steps

1. Deploy
2. Run
3. Error

Additional information

image
image

Originally created by @9k001 on GitHub (Dec 15, 2023). ### The bug The container logs on the microservices side of server show that they are not connected to the database. It seems that previous environment variables have no effect, such as: DB_HOSTNAME. DB_PORT. DB_USERNAME. DB_PASSWORD. DB_DATABASE_NAME. My PostgreSQL is deployed independently. I use ansible for standardized deployment. Confirm that the table has been created: immich. Confirm that cube,earthdistance,vectors is installed. Confirm that the container environment has loaded the aforementioned environment variables. Confirm that there is no problem with v1.89.0 installation and operation. ### The OS that Immich Server is running on docker ### Version of Immich Server v1.91.0 ### Version of Immich Mobile App v1.91.0 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: '3.5' services: immich-server: image: ghcr.io/immich-app/immich-server:{{ IMMICH_VERSION }} container_name: immich-server restart: always volumes: - ${APP_DATA_HOME}/project/immich/immich-server/upload:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro ports: - "{{ SERVER_PORT }}:3001" env_file: - ${WORKSPACE_HOME}/{{ DeployRepo }}/immich/env/server.env command: [ "start.sh", "immich" ] environment: - TZ=Asia/Shanghai immich-microservices: image: ghcr.io/immich-app/immich-server:{{ IMMICH_VERSION }} container_name: immich-microservices restart: always volumes: - ${APP_DATA_HOME}/project/immich/immich-server/upload:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro ports: - "{{ MICROSERVICES_PORT }}:3002" env_file: - ${WORKSPACE_HOME}/{{ DeployRepo }}/immich/env/microservices.env command: [ "start.sh", "microservices" ] environment: - TZ=Asia/Shanghai immich-machine_learning: image: ghcr.io/immich-app/immich-machine-learning:{{ IMMICH_VERSION }} container_name: immich-machine_learning restart: always volumes: - ${APP_DATA_HOME}/project/immich/machine_learning/cache:/cache ports: - "{{ MACHINE_LEARNING_PORT }}:3003" env_file: - ${WORKSPACE_HOME}/{{ DeployRepo }}/immich/env/machine_learning.env environment: - TZ=Asia/Shanghai networks: default: name: ${MODE_ENV} external: true ``` ### Your .env content ```Shell # 数据库 地址 DB_HOSTNAME={{ SERVICE_DB_HOSTNAME }} # 数据库 端口 DB_PORT={{ SERVICE_DB_PORT }} # 数据库 账号 DB_USERNAME={{ SERVICE_DB_USERNAME }} # 数据库 密码 DB_PASSWORD={{ SERVICE_DB_PASSWORD }} # 数据库 表名 DB_DATABASE_NAME={{ DB_TABLES }} # Redis 地址 REDIS_HOSTNAME={{ SERVICE_REDIS_HOSTNAME }} # Redis 端口 REDIS_PORT={{ SERVICE_REDIS_PORT }} ``` ### Reproduction steps ```bash 1. Deploy 2. Run 3. Error ``` ### Additional information ![image](https://github.com/immich-app/immich/assets/63529476/9e64a9a9-c37e-4dfa-8d15-afd9ceb1a8b9) ![image](https://github.com/immich-app/immich/assets/63529476/d1c297c6-1e4b-4338-8cdd-899e0a61bf1e)
Author
Owner

@bo0tzz commented on GitHub (Dec 15, 2023):

Can you post some detail about your postgres installation? It's complaining that it can't find the pgvecto.rs extension.

@bo0tzz commented on GitHub (Dec 15, 2023): Can you post some detail about your postgres installation? It's complaining that it can't find the pgvecto.rs extension.
Author
Owner

@9k001 commented on GitHub (Dec 15, 2023):

Can you post some detail about your postgres installation? It's complaining that it can't find the pgvecto.rs extension.
My postgres is deployed using docker-compose.
Confirm that it can be used properly. Other applications such as my Gitea RssHub are deployed above.

version: '3.5'
services:
  postgres:
    image: postgres:14.1-alpine
    container_name: db-postgres
    restart: always
    tty: true
    volumes:
      - ${APP_DATA_HOME}/project/db/postgres:/var/lib/postgresql/data
    ports:
      - "{{ DB_POSTGRES_PORT }}:5432"
    env_file:
      - ${WORKSPACE_HOME}/{{ DeployRepo }}/db/env/postgres.env
    environment:
      - TZ=Asia/Shanghai

networks:
  default:
    name: ${MODE_ENV}
    external: true
@9k001 commented on GitHub (Dec 15, 2023): > Can you post some detail about your postgres installation? It's complaining that it can't find the pgvecto.rs extension. My postgres is deployed using docker-compose. Confirm that it can be used properly. Other applications such as my Gitea RssHub are deployed above. ``` version: '3.5' services: postgres: image: postgres:14.1-alpine container_name: db-postgres restart: always tty: true volumes: - ${APP_DATA_HOME}/project/db/postgres:/var/lib/postgresql/data ports: - "{{ DB_POSTGRES_PORT }}:5432" env_file: - ${WORKSPACE_HOME}/{{ DeployRepo }}/db/env/postgres.env environment: - TZ=Asia/Shanghai networks: default: name: ${MODE_ENV} external: true ```
Author
Owner

@bo0tzz commented on GitHub (Dec 15, 2023):

As stated in the release notes, you'll need to use a postgres image that has the pgvecto.rs extension installed.

@bo0tzz commented on GitHub (Dec 15, 2023): As stated in the release notes, you'll need to use a postgres image that has the pgvecto.rs extension installed.
Author
Owner

@9k001 commented on GitHub (Dec 15, 2023):

As stated in the release notes, you'll need to use a postgres image that has the pgvecto.rs extension installed.

Thank you. I'll study it.

@9k001 commented on GitHub (Dec 15, 2023): > As stated in the release notes, you'll need to use a postgres image that has the pgvecto.rs extension installed. Thank you. I'll study it.
Author
Owner

@mooglestiltzkin commented on GitHub (Dec 16, 2023):

*update

i checked and apparently it did say the extension already exists, so i don't have to do anything. but i'll explain how to do this.

assuming you use portainer to manage your docker containers, go to the the exec consol in the portainer ui for the posgres used by immich container.

then select bash, click the toggle then type bash.

then type

psql -d [database-name] -U [username] -W

u get the database name and username from the following as you set it (u find this in either docker compose or the env file where u set this)

DB_USERNAME= ...........

DB_PASSWORD= ..........

once done, then you can finally enter the command to create the extension.

in this case it's
CREATE EXTENSION vectors;

hope that helped anyone having issue with this.

@mooglestiltzkin commented on GitHub (Dec 16, 2023): *update i checked and apparently it did say the extension already exists, so i don't have to do anything. but i'll explain how to do this. assuming you use portainer to manage your docker containers, go to the the exec consol in the portainer ui for the posgres used by immich container. then select bash, click the toggle then type bash. then type `psql -d [database-name] -U [username] -W` u get the database name and username from the following as you set it (u find this in either docker compose or the env file where u set this) DB_USERNAME= ........... DB_PASSWORD= .......... once done, then you can finally enter the command to create the extension. in this case it's `CREATE EXTENSION vectors;` hope that helped anyone having issue with this.
Author
Owner

@9k001 commented on GitHub (Dec 16, 2023):

*update

i checked and apparently it did say the extension already exists, so i don't have to do anything. but i'll explain how to do this.

assuming you use portainer to manage your docker containers, go to the the exec consol in the portainer ui for the posgres used by immich container.

then select bash, click the toggle then type bash.

then type

psql -d [database-name] -U [username] -W

u get the database name and username from the following as you set it (u find this in either docker compose or the env file where u set this)

DB_USERNAME= ...........

DB_PASSWORD= ..........

once done, then you can finally enter the command to create the extension.

in this case it's CREATE EXTENSION vectors;

hope that helped anyone having issue with this.

I redeployed a separate set of postgres for immich to solve this problem.
Is to use the postgres with pgvecto.rs in the official docker-compose

@9k001 commented on GitHub (Dec 16, 2023): > *update > > i checked and apparently it did say the extension already exists, so i don't have to do anything. but i'll explain how to do this. > > assuming you use portainer to manage your docker containers, go to the the exec consol in the portainer ui for the posgres used by immich container. > > then select bash, click the toggle then type bash. > > then type > > `psql -d [database-name] -U [username] -W` > > u get the database name and username from the following as you set it (u find this in either docker compose or the env file where u set this) > > DB_USERNAME= ........... > > DB_PASSWORD= .......... > > once done, then you can finally enter the command to create the extension. > > in this case it's `CREATE EXTENSION vectors;` > > hope that helped anyone having issue with this. I redeployed a separate set of postgres for immich to solve this problem. Is to use the postgres with pgvecto.rs in the official docker-compose
Author
Owner

@mooglestiltzkin commented on GitHub (Dec 16, 2023):

basically ya, the updated docker compose and env file

https://github.com/immich-app/immich/blob/main/docker/docker-compose.prod.yml

https://github.com/immich-app/immich/blob/main/docker/example.env

also before the env had typesense but since the update u just remove them from env since no longer used, according to the updated files and instructions

notes what changed in the docker compose
https://github.com/immich-app/immich/releases/tag/v1.91.0

@mooglestiltzkin commented on GitHub (Dec 16, 2023): basically ya, the updated docker compose and env file https://github.com/immich-app/immich/blob/main/docker/docker-compose.prod.yml https://github.com/immich-app/immich/blob/main/docker/example.env also before the env had typesense but since the update u just remove them from env since no longer used, according to the updated files and instructions notes what changed in the docker compose https://github.com/immich-app/immich/releases/tag/v1.91.0
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1790