[BUG] Can't get past admin registration #1120

Closed
opened 2026-02-05 00:31:59 +03:00 by OVERLORD · 14 comments
Owner

Originally created by @DanielAndreasen on GitHub (Jul 17, 2023).

The bug

I spin up immich on my debian server with docker-compose up -d without any noticeable problems. When I first visit the endpoint, I'm greeted with the welcome screen and asked to create an admin. However, when I click the "Sign up" button, nothing happens.

Inspired by other issues, I checked some of the logs, and seems to be related to this in the microservice (something similar also present in the database service):

[Nest] 1  - 07/17/2023, 10:53:25 AM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...
QueryFailedError: duplicate key value violates unique constraint "pg_class_relname_nsp_index"
    at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PostgresQueryRunner.executeQueries (/usr/src/app/node_modules/typeorm/query-runner/BaseQueryRunner.js:424:13)
    at async PostgresQueryRunner.createTable (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:410:9)
    at async MigrationExecutor.createMigrationsTableIfNotExist (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:351:13)
    at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:129:9)
    at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:260:35)
    at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:148:17)

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.67.2

Version of Immich Mobile App

NA

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    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:${IMMICH_VERSION:-release}
    command: [ "start.sh", "microservices" ]
    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:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    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-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    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:${IMMICH_VERSION:-release}
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    depends_on:
      - immich-server
      - immich-web
    restart: always

volumes:
  pgdata:
  model-cache:
  tsdata:

networks:
  default:
    external: true
    name: nginxproxymanager_default

Your .env content

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

# NOTE: The following four database variables support Docker secrets by adding a *_FILE suffix to the variable name
# See the docker-compose documentation on secrets for additional details: https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=redacted
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/daniel/data/immich


###################################################################################
# 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://WwogIHsgImhvc3QiOiAidHlwZXNlbnNlLTEuZXhhbXBsZS5uZXQiLCAicG9ydCI6ICI0NDMiLCAicHJvdG9jb2wiOiAiaHR0cHMiIH0sCiAgeyAiaG9zdCI6ICJ0eXBlc2Vuc2UtMi5leGFtcGxlLm5ldCIsICJwb3J0IjogIjQ0MyIsICJwcm90b2NvbCI6ICJodHRwcyIgfSwKICB7ICJob3N0IjogInR5cGVzZW5zZS0zLmV4YW1wbGUubmV0IiwgInBvcnQiOiAiNDQzIiwgInByb3RvY29sIjogImh0dHBzIiB9Cl0=

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

###################################################################################
# Immich Version - Optional
#
# This allows all immich docker images to be pinned to a specific version. By default,
# the version is "release" but could be a specific version, like "v1.59.0".
###################################################################################

#IMMICH_VERSION=

Reproduction steps

1. With attached `.env` and `docker-compose.yml` it should be possible to recreate the problem.

Additional information

No response

Originally created by @DanielAndreasen on GitHub (Jul 17, 2023). ### The bug I spin up immich on my debian server with `docker-compose up -d` without any noticeable problems. When I first visit the endpoint, I'm greeted with the welcome screen and asked to create an admin. However, when I click the "Sign up" button, nothing happens. Inspired by other issues, I checked some of the logs, and seems to be related to this in the microservice (something similar also present in the database service): ``` [Nest] 1 - 07/17/2023, 10:53:25 AM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... QueryFailedError: duplicate key value violates unique constraint "pg_class_relname_nsp_index" at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async PostgresQueryRunner.executeQueries (/usr/src/app/node_modules/typeorm/query-runner/BaseQueryRunner.js:424:13) at async PostgresQueryRunner.createTable (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:410:9) at async MigrationExecutor.createMigrationsTableIfNotExist (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:351:13) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:129:9) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:260:35) at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:148:17) ``` ### The OS that Immich Server is running on Debian ### Version of Immich Server v1.67.2 ### Version of Immich Mobile App NA ### Platform with the issue - [X] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] 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:${IMMICH_VERSION:-release} command: [ "start.sh", "microservices" ] 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:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: always immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env restart: always typesense: container_name: immich_typesense image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd 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-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always database: container_name: immich_postgres image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 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:${IMMICH_VERSION:-release} environment: # Make sure these values get passed through from the env file - IMMICH_SERVER_URL - IMMICH_WEB_URL ports: - 2283:8080 depends_on: - immich-server - immich-web restart: always volumes: pgdata: model-cache: tsdata: networks: default: external: true name: nginxproxymanager_default ``` ### Your .env content ```Shell ################################################################################### # Database ################################################################################### # NOTE: The following four database variables support Docker secrets by adding a *_FILE suffix to the variable name # See the docker-compose documentation on secrets for additional details: https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_PASSWORD=redacted 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/daniel/data/immich ################################################################################### # 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://WwogIHsgImhvc3QiOiAidHlwZXNlbnNlLTEuZXhhbXBsZS5uZXQiLCAicG9ydCI6ICI0NDMiLCAicHJvdG9jb2wiOiAiaHR0cHMiIH0sCiAgeyAiaG9zdCI6ICJ0eXBlc2Vuc2UtMi5leGFtcGxlLm5ldCIsICJwb3J0IjogIjQ0MyIsICJwcm90b2NvbCI6ICJodHRwcyIgfSwKICB7ICJob3N0IjogInR5cGVzZW5zZS0zLmV4YW1wbGUubmV0IiwgInBvcnQiOiAiNDQzIiwgInByb3RvY29sIjogImh0dHBzIiB9Cl0= ################################################################################### # 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 ################################################################################### # Immich Version - Optional # # This allows all immich docker images to be pinned to a specific version. By default, # the version is "release" but could be a specific version, like "v1.59.0". ################################################################################### #IMMICH_VERSION= ``` ### Reproduction steps ```bash 1. With attached `.env` and `docker-compose.yml` it should be possible to recreate the problem. ``` ### Additional information _No response_
Author
Owner

@jrasm91 commented on GitHub (Jul 17, 2023):

Does the error persist if you restart the immich-microservices container? (or all of the containers)

@jrasm91 commented on GitHub (Jul 17, 2023): Does the error persist if you restart the immich-microservices container? (or all of the containers)
Author
Owner

@DanielAndreasen commented on GitHub (Jul 17, 2023):

I tried docker-compose stop followed by docker-compose up -d with the same result. The error seems to be gone in the log, but I am still not able to create an admin user.
I'm not sure which log to look in, to give more information

@DanielAndreasen commented on GitHub (Jul 17, 2023): I tried `docker-compose stop` followed by `docker-compose up -d` with the same result. The error seems to be gone in the log, but I am still not able to create an admin user. I'm not sure which log to look in, to give more information
Author
Owner

@jrasm91 commented on GitHub (Jul 17, 2023):

Anything in the immich-server or immich-web logs?

@jrasm91 commented on GitHub (Jul 17, 2023): Anything in the immich-server or immich-web logs?
Author
Owner

@alextran1502 commented on GitHub (Jul 17, 2023):

I tried docker-compose stop followed by docker-compose up -d with the same result. The error seems to be gone in the log, but I am still not able to create an admin user. I'm not sure which log to look in, to give more information

I think the correct command is docker-compose down to properly bring down the containers. Regardless, you can try to bring down the containers, then remove the pg_data volume and then bring up all the containers again.

@alextran1502 commented on GitHub (Jul 17, 2023): > I tried `docker-compose stop` followed by `docker-compose up -d` with the same result. The error seems to be gone in the log, but I am still not able to create an admin user. I'm not sure which log to look in, to give more information I think the correct command is `docker-compose down` to properly bring down the containers. Regardless, you can try to bring down the containers, then remove the pg_data volume and then bring up all the containers again.
Author
Owner

@DanielAndreasen commented on GitHub (Jul 17, 2023):

I tried docker-compose stop followed by docker-compose up -d with the same result. The error seems to be gone in the log, but I am still not able to create an admin user. I'm not sure which log to look in, to give more information

I think the correct command is docker-compose down to properly bring down the containers. Regardless, you can try to bring down the containers, then remove the pg_data volume and then bring up all the containers again.

How do I remove the pgdata? Do I need to enter with docker -it immich_database sh and then remove /var/lib/postgresql/data?

@DanielAndreasen commented on GitHub (Jul 17, 2023): > > I tried `docker-compose stop` followed by `docker-compose up -d` with the same result. The error seems to be gone in the log, but I am still not able to create an admin user. I'm not sure which log to look in, to give more information > > I think the correct command is `docker-compose down` to properly bring down the containers. Regardless, you can try to bring down the containers, then remove the pg_data volume and then bring up all the containers again. How do I remove the `pgdata`? Do I need to enter with `docker -it immich_database sh` and then remove `/var/lib/postgresql/data`?
Author
Owner

@alextran1502 commented on GitHub (Jul 17, 2023):

You can perform docker volume ls and then find the name of associated pgdata, if you don't have it grouped under a different name then it would be docker_pgdata

then you can perform docker volume rm docker_pgdata to remove the database volume

@alextran1502 commented on GitHub (Jul 17, 2023): You can perform `docker volume ls` and then find the name of associated pgdata, if you don't have it grouped under a different name then it would be `docker_pgdata` then you can perform `docker volume rm docker_pgdata` to remove the database volume
Author
Owner

@DanielAndreasen commented on GitHub (Jul 17, 2023):

I also had to do docker rm <ID> before I could do docker volume rm immich_pgdata. After starting again, this is the log from immich_postgres:

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2023-07-17 19:56:00.008 UTC [31] WARNING:  no usable system locales were found
performing post-bootstrap initialization ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
syncing data to disk ... ok


Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2023-07-17 19:56:10.852 UTC [37] LOG:  starting PostgreSQL 14.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
2023-07-17 19:56:10.911 UTC [37] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-07-17 19:56:11.159 UTC [38] LOG:  database system was shut down at 2023-07-17 19:56:01 UTC
2023-07-17 19:56:11.241 UTC [37] LOG:  database system is ready to accept connections
 done
server started
CREATE DATABASE


/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

waiting for server to shut down...2023-07-17 19:56:14.816 UTC [37] LOG:  received fast shutdown request
.2023-07-17 19:56:14.834 UTC [37] LOG:  aborting any active transactions
2023-07-17 19:56:14.836 UTC [37] LOG:  background worker "logical replication launcher" (PID 44) exited with exit code 1
2023-07-17 19:56:14.838 UTC [39] LOG:  shutting down
2023-07-17 19:56:15.219 UTC [37] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2023-07-17 19:56:15.483 UTC [1] LOG:  starting PostgreSQL 14.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
2023-07-17 19:56:15.483 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-07-17 19:56:15.483 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2023-07-17 19:56:15.606 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-07-17 19:56:15.709 UTC [52] LOG:  database system was shut down at 2023-07-17 19:56:15 UTC
2023-07-17 19:56:15.734 UTC [1] LOG:  database system is ready to accept connections
2023-07-17 19:56:26.357 UTC [60] ERROR:  duplicate key value violates unique constraint "pg_class_relname_nsp_index"
2023-07-17 19:56:26.357 UTC [60] DETAIL:  Key (relname, relnamespace)=(migrations_id_seq, 2200) already exists.
2023-07-17 19:56:26.357 UTC [60] STATEMENT:  CREATE TABLE "migrations" ("id" SERIAL NOT NULL, "timestamp" bigint NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_8c82d7f526340ab734260ea46be" PRIMARY KEY ("id"))
2023-07-17 19:56:32.455 UTC [61] ERROR:  duplicate key value violates unique constraint "pg_type_typname_nsp_index"
2023-07-17 19:56:32.455 UTC [61] DETAIL:  Key (typname, typnamespace)=(users, 2200) already exists.
2023-07-17 19:56:32.455 UTC [61] STATEMENT:
	        create table if not exists users
	        (
	            id          uuid      default uuid_generate_v4() not null
	                constraint "PK_a3ffb1c0c8416b9fc6f907b7433"
	                    primary key,
	            email       varchar                              not null,
	            password    varchar                              not null,
	            salt        varchar                              not null,
	            "createdAt" timestamp default now()              not null
	        );

There seems to still be some errors

@DanielAndreasen commented on GitHub (Jul 17, 2023): I also had to do `docker rm <ID>` before I could do `docker volume rm immich_pgdata`. After starting again, this is the log from `immich_postgres`: ``` The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.utf8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /var/lib/postgresql/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... UTC creating configuration files ... ok running bootstrap script ... ok sh: locale: not found 2023-07-17 19:56:00.008 UTC [31] WARNING: no usable system locales were found performing post-bootstrap initialization ... ok initdb: warning: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. syncing data to disk ... ok Success. You can now start the database server using: pg_ctl -D /var/lib/postgresql/data -l logfile start waiting for server to start....2023-07-17 19:56:10.852 UTC [37] LOG: starting PostgreSQL 14.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit 2023-07-17 19:56:10.911 UTC [37] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2023-07-17 19:56:11.159 UTC [38] LOG: database system was shut down at 2023-07-17 19:56:01 UTC 2023-07-17 19:56:11.241 UTC [37] LOG: database system is ready to accept connections done server started CREATE DATABASE /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/* waiting for server to shut down...2023-07-17 19:56:14.816 UTC [37] LOG: received fast shutdown request .2023-07-17 19:56:14.834 UTC [37] LOG: aborting any active transactions 2023-07-17 19:56:14.836 UTC [37] LOG: background worker "logical replication launcher" (PID 44) exited with exit code 1 2023-07-17 19:56:14.838 UTC [39] LOG: shutting down 2023-07-17 19:56:15.219 UTC [37] LOG: database system is shut down done server stopped PostgreSQL init process complete; ready for start up. 2023-07-17 19:56:15.483 UTC [1] LOG: starting PostgreSQL 14.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit 2023-07-17 19:56:15.483 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2023-07-17 19:56:15.483 UTC [1] LOG: listening on IPv6 address "::", port 5432 2023-07-17 19:56:15.606 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2023-07-17 19:56:15.709 UTC [52] LOG: database system was shut down at 2023-07-17 19:56:15 UTC 2023-07-17 19:56:15.734 UTC [1] LOG: database system is ready to accept connections 2023-07-17 19:56:26.357 UTC [60] ERROR: duplicate key value violates unique constraint "pg_class_relname_nsp_index" 2023-07-17 19:56:26.357 UTC [60] DETAIL: Key (relname, relnamespace)=(migrations_id_seq, 2200) already exists. 2023-07-17 19:56:26.357 UTC [60] STATEMENT: CREATE TABLE "migrations" ("id" SERIAL NOT NULL, "timestamp" bigint NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_8c82d7f526340ab734260ea46be" PRIMARY KEY ("id")) 2023-07-17 19:56:32.455 UTC [61] ERROR: duplicate key value violates unique constraint "pg_type_typname_nsp_index" 2023-07-17 19:56:32.455 UTC [61] DETAIL: Key (typname, typnamespace)=(users, 2200) already exists. 2023-07-17 19:56:32.455 UTC [61] STATEMENT: create table if not exists users ( id uuid default uuid_generate_v4() not null constraint "PK_a3ffb1c0c8416b9fc6f907b7433" primary key, email varchar not null, password varchar not null, salt varchar not null, "createdAt" timestamp default now() not null ); ``` There seems to still be some errors
Author
Owner

@alextran1502 commented on GitHub (Jul 17, 2023):

What is the log of server and microservices now?

@alextran1502 commented on GitHub (Jul 17, 2023): What is the log of server and microservices now?
Author
Owner

@DanielAndreasen commented on GitHub (Jul 18, 2023):

I still have this in the server log:

[Nest] 1  - 07/17/2023, 7:56:26 PM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...
QueryFailedError: duplicate key value violates unique constraint "pg_class_relname_nsp_index"
    at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PostgresQueryRunner.executeQueries (/usr/src/app/node_modules/typeorm/query-runner/BaseQueryRunner.js:424:13)
    at async PostgresQueryRunner.createTable (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:410:9)
    at async MigrationExecutor.createMigrationsTableIfNotExist (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:351:13)
    at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:129:9)
    at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:260:35)
    at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:148:17)
[Nest] 1  - 07/17/2023, 7:56:32 PM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)...
QueryFailedError: duplicate key value violates unique constraint "pg_type_typname_nsp_index"
    at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async CreateUserTable1645130759468.up (/usr/src/app/dist/infra/migrations/1645130759468-CreateUserTable.js:6:9)
    at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17)
    at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:260:35)
    at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:148:17)
[Nest] 1  - 07/17/2023, 7:56:35 PM     LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +3102ms
[Nest] 1  - 07/17/2023, 7:56:35 PM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 1  - 07/17/2023, 7:56:35 PM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 1  - 07/17/2023, 7:56:35 PM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms

The microservice log:

[Nest] 1  - 07/17/2023, 7:56:32 PM     LOG [InstanceLoader] InfraModule dependencies initialized +17ms
[Nest] 1  - 07/17/2023, 7:56:32 PM     LOG [InstanceLoader] DomainModule dependencies initialized +0ms
[Nest] 1  - 07/17/2023, 7:56:32 PM     LOG [InstanceLoader] MicroservicesModule dependencies initialized +1ms
[Nest] 1  - 07/17/2023, 7:56:32 PM    WARN [MetadataExtractionProcessor] Reverse geocoding is enabled
[Nest] 1  - 07/17/2023, 7:56:32 PM     LOG [MetadataExtractionProcessor] Initializing Reverse Geocoding
Error: connect ETIMEDOUT
    at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)
    at Object.onceWrapper (node:events:627:28)
    at Socket.emit (node:events:513:28)
    at Socket._onTimeout (node:net:570:8)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  errorno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect'
}
Error: connect ETIMEDOUT
    at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)
    at Object.onceWrapper (node:events:627:28)
    at Socket.emit (node:events:513:28)
    at Socket._onTimeout (node:net:570:8)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  errorno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect'
}
Error: connect ETIMEDOUT
    at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)
    at Object.onceWrapper (node:events:627:28)
    at Socket.emit (node:events:513:28)
    at Socket._onTimeout (node:net:570:8)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7) {
  errorno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect'
}

which just goes on for some time.

I use nginx for reverse-proxy, which means I'm going to photo.mydomain.com. Does that mean I have to change IMMICH_WEB_URL which is not literally: http://immich-web:3000 in my .env file.

I also see this error in my browser:
image

@DanielAndreasen commented on GitHub (Jul 18, 2023): I still have this in the server log: ``` [Nest] 1 - 07/17/2023, 7:56:26 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... QueryFailedError: duplicate key value violates unique constraint "pg_class_relname_nsp_index" at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async PostgresQueryRunner.executeQueries (/usr/src/app/node_modules/typeorm/query-runner/BaseQueryRunner.js:424:13) at async PostgresQueryRunner.createTable (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:410:9) at async MigrationExecutor.createMigrationsTableIfNotExist (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:351:13) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:129:9) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:260:35) at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:148:17) [Nest] 1 - 07/17/2023, 7:56:32 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)... QueryFailedError: duplicate key value violates unique constraint "pg_type_typname_nsp_index" at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async CreateUserTable1645130759468.up (/usr/src/app/dist/infra/migrations/1645130759468-CreateUserTable.js:6:9) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:260:35) at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:148:17) [Nest] 1 - 07/17/2023, 7:56:35 PM LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +3102ms [Nest] 1 - 07/17/2023, 7:56:35 PM LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms [Nest] 1 - 07/17/2023, 7:56:35 PM LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms [Nest] 1 - 07/17/2023, 7:56:35 PM LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms ``` The microservice log: ``` [Nest] 1 - 07/17/2023, 7:56:32 PM LOG [InstanceLoader] InfraModule dependencies initialized +17ms [Nest] 1 - 07/17/2023, 7:56:32 PM LOG [InstanceLoader] DomainModule dependencies initialized +0ms [Nest] 1 - 07/17/2023, 7:56:32 PM LOG [InstanceLoader] MicroservicesModule dependencies initialized +1ms [Nest] 1 - 07/17/2023, 7:56:32 PM WARN [MetadataExtractionProcessor] Reverse geocoding is enabled [Nest] 1 - 07/17/2023, 7:56:32 PM LOG [MetadataExtractionProcessor] Initializing Reverse Geocoding Error: connect ETIMEDOUT at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41) at Object.onceWrapper (node:events:627:28) at Socket.emit (node:events:513:28) at Socket._onTimeout (node:net:570:8) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) { errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' } Error: connect ETIMEDOUT at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41) at Object.onceWrapper (node:events:627:28) at Socket.emit (node:events:513:28) at Socket._onTimeout (node:net:570:8) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) { errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' } Error: connect ETIMEDOUT at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41) at Object.onceWrapper (node:events:627:28) at Socket.emit (node:events:513:28) at Socket._onTimeout (node:net:570:8) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7) { errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' } ``` which just goes on for some time. I use nginx for reverse-proxy, which means I'm going to `photo.mydomain.com`. Does that mean I have to change `IMMICH_WEB_URL` which is not literally: `http://immich-web:3000` in my `.env` file. I also see this error in my browser: ![image](https://github.com/immich-app/immich/assets/4519017/ae84c27b-1dea-45be-90e8-3ac29aa576b2)
Author
Owner

@jrasm91 commented on GitHub (Jul 18, 2023):

What value are you using for the upstream server in your npm entry for immich?

@jrasm91 commented on GitHub (Jul 18, 2023): What value are you using for the upstream server in your npm entry for immich?
Author
Owner

@DanielAndreasen commented on GitHub (Jul 18, 2023):

What value are you using for the upstream server in your npm entry for immich?

I'm not sure I understand your question. Where would I find this information?

@DanielAndreasen commented on GitHub (Jul 18, 2023): > What value are you using for the upstream server in your npm entry for immich? I'm not sure I understand your question. Where would I find this information?
Author
Owner

@jrasm91 commented on GitHub (Jul 18, 2023):

In Nginx proxy manager (npm) where are you sending requests that go to photos.yourdomain.com? Presumably one of the containers. It should be immich-proxy:8080 I believe.

@jrasm91 commented on GitHub (Jul 18, 2023): In Nginx proxy manager (npm) where are you sending requests that go to photos.yourdomain.com? Presumably one of the containers. It should be immich-proxy:8080 I believe.
Author
Owner

@DanielAndreasen commented on GitHub (Jul 18, 2023):

Ah, nginx proxy manager...
I can't check it right now, as I'm at work, and NPM is only accessable from my home network. But I actually think I use immich_web. I'll check it in a couple of hours

@DanielAndreasen commented on GitHub (Jul 18, 2023): Ah, nginx proxy manager... I can't check it right now, as I'm at work, and NPM is only accessable from my home network. But I actually think I use `immich_web`. I'll check it in a couple of hours
Author
Owner

@DanielAndreasen commented on GitHub (Jul 18, 2023):

This solved it! Changing to immich_proxy using port 8080. Thank you so much for the help!

@DanielAndreasen commented on GitHub (Jul 18, 2023): This solved it! Changing to `immich_proxy` using port 8080. Thank you so much for the help!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1120