Storage Template Error #4685

Closed
opened 2026-02-05 10:47:24 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @kirantnath on GitHub (Nov 4, 2024).

The bug

Hello
First, thanks the the developer and community for the wonderful software. I have also decided to support the developer and bought a license key!

I have used an inbuilt storage template where the photos from my phone are uploaded to: /library/admin/Month/Photo.
Since yesterday, some of my photos taken are stored in the above directory, and some others are stored at: /upload/ folder.

I tried the template migration task but still the photos in /upload/ are not getting moved to /library/admin/.

Thanks.

The OS that Immich Server is running on

Synology DSM 7.2

Version of Immich Server

1.119.1

Version of Immich Mobile App

1.119.1

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

services:
  immich-redis:
    image: redis
    container_name: Immich-REDIS
    hostname: immich-redis
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    user: 1026:100
    environment:
      - TZ=XXXXXXXXXXXXXXXXXXXXXXXXXXX
    volumes:
      - /volume1/docker/immich/redis:/data:rw
      - /volume1/photo:/usr/src/app/external
    restart: on-failure:5

  immich-db:
    image: tensorchord/pgvecto-rs:pg16-v0.2.0
    container_name: Immich-DB
    hostname: immich-db
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "immich", "-U", "immichuser"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - /volume1/docker/immich/db:/var/lib/postgresql/data:rw
    environment:
      - TZ=XXXXXXXXXXXXXXXXXXXXXXXXXXX
      - POSTGRES_DB=immich
      - POSTGRES_USER=immichuser
      - POSTGRES_PASSWORD=immichpw
    restart: on-failure:5

  immich-server:
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION}
    container_name: Immich-SERVER
    hostname: immich-server
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    ports:
      - 2283:2283
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload:rw
      - ${MY_PHOTOS}:/mnt/media/photos:rw   
    restart: on-failure:5
    depends_on:
      immich-redis:
        condition: service_healthy
      immich-db:
        condition: service_started

  immich-machine-learning:
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION}
    container_name: Immich-LEARNING
    hostname: immich-machine-learning
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload:rw
      - /volume1/docker/immich/cache:/cache:rw
      - /volume1/docker/immich/matplotlib:/matplotlib:rw
    environment:
      - MPLCONFIGDIR=/matplotlib
    restart: on-failure:5
    depends_on:
      immich-db:
        condition: service_started

Your .env content

UPLOAD_LOCATION=/volume1/homes/XXXXXXXXXXXXXXXXXXXXXXXXXXX/Photos/immich/
MY_PHOTOS=/volume1/photo
IMMICH_VERSION=release
TZ=XXXXXXXXXXXXXXXXXXXXXXXXXXX
NODE_ENV=production
DB_HOSTNAME=immich-db
DB_USERNAME=immichuser
DB_PASSWORD=immichpw
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich-redis
LOG_LEVEL=log
JWT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXX
DISABLE_REVERSE_GEOCODING=false
REVERSE_GEOCODING_PRECISION=3
PUBLIC_LOGIN_PAGE_MESSAGE=
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

Reproduction steps

  1. Take new photos in Phone
  2. Wait for background sync to upload them to server
  3. The photos show as uploaded, some of them are in upload folder, some are in library folder. Storage template is enabled, and it should be in library/admin/Month
    ...

Relevant log output

No response

Additional information

No response

Originally created by @kirantnath on GitHub (Nov 4, 2024). ### The bug Hello First, thanks the the developer and community for the wonderful software. I have also decided to support the developer and bought a license key! I have used an inbuilt storage template where the photos from my phone are uploaded to: /library/admin/Month/Photo. Since yesterday, some of my photos taken are stored in the above directory, and some others are stored at: /upload/ folder. I tried the template migration task but still the photos in /upload/ are not getting moved to /library/admin/. Thanks. ### The OS that Immich Server is running on Synology DSM 7.2 ### Version of Immich Server 1.119.1 ### Version of Immich Mobile App 1.119.1 ### Platform with the issue - [X] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML services: immich-redis: image: redis container_name: Immich-REDIS hostname: immich-redis security_opt: - no-new-privileges:true healthcheck: test: ["CMD-SHELL", "redis-cli ping || exit 1"] user: 1026:100 environment: - TZ=XXXXXXXXXXXXXXXXXXXXXXXXXXX volumes: - /volume1/docker/immich/redis:/data:rw - /volume1/photo:/usr/src/app/external restart: on-failure:5 immich-db: image: tensorchord/pgvecto-rs:pg16-v0.2.0 container_name: Immich-DB hostname: immich-db security_opt: - no-new-privileges:true healthcheck: test: ["CMD", "pg_isready", "-q", "-d", "immich", "-U", "immichuser"] interval: 10s timeout: 5s retries: 5 volumes: - /volume1/docker/immich/db:/var/lib/postgresql/data:rw environment: - TZ=XXXXXXXXXXXXXXXXXXXXXXXXXXX - POSTGRES_DB=immich - POSTGRES_USER=immichuser - POSTGRES_PASSWORD=immichpw restart: on-failure:5 immich-server: image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION} container_name: Immich-SERVER hostname: immich-server user: 1026:100 security_opt: - no-new-privileges:true env_file: - stack.env ports: - 2283:2283 volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload:rw - ${MY_PHOTOS}:/mnt/media/photos:rw restart: on-failure:5 depends_on: immich-redis: condition: service_healthy immich-db: condition: service_started immich-machine-learning: image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION} container_name: Immich-LEARNING hostname: immich-machine-learning user: 1026:100 security_opt: - no-new-privileges:true env_file: - stack.env volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload:rw - /volume1/docker/immich/cache:/cache:rw - /volume1/docker/immich/matplotlib:/matplotlib:rw environment: - MPLCONFIGDIR=/matplotlib restart: on-failure:5 depends_on: immich-db: condition: service_started ``` ### Your .env content ```Shell UPLOAD_LOCATION=/volume1/homes/XXXXXXXXXXXXXXXXXXXXXXXXXXX/Photos/immich/ MY_PHOTOS=/volume1/photo IMMICH_VERSION=release TZ=XXXXXXXXXXXXXXXXXXXXXXXXXXX NODE_ENV=production DB_HOSTNAME=immich-db DB_USERNAME=immichuser DB_PASSWORD=immichpw DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich-redis LOG_LEVEL=log JWT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXX DISABLE_REVERSE_GEOCODING=false REVERSE_GEOCODING_PRECISION=3 PUBLIC_LOGIN_PAGE_MESSAGE= IMMICH_WEB_URL=http://immich-web:3000 IMMICH_SERVER_URL=http://immich-server:3001 IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003 ``` ### Reproduction steps 1. Take new photos in Phone 2. Wait for background sync to upload them to server 3. The photos show as uploaded, some of them are in upload folder, some are in library folder. Storage template is enabled, and it should be in library/admin/Month ... ### Relevant log output _No response_ ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Nov 4, 2024):

When you run the job, are there any errors in the logs?

@bo0tzz commented on GitHub (Nov 4, 2024): When you run the job, are there any errors in the logs?
Author
Owner

@kirantnath commented on GitHub (Nov 4, 2024):

Yes it's coming as follows

[Nest] 7 - 11/04/2024, 7:24:47 PM LOG [Microservices:StorageTemplateService] Starting storage template migration

[Nest] 7 - 11/04/2024, 7:24:57 PM ERROR [Microservices:JobService] Unable to run job handler (storageTemplateMigration/storage-template-migration): Error: Connection terminated due to connection timeout

[Nest] 7 - 11/04/2024, 7:24:57 PM ERROR [Microservices:JobService] Error: Connection terminated due to connection timeout

at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:131:73)

at Object.onceWrapper (node:events:633:28)

at Connection.emit (node:events:519:28)

at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:62:12)

at Socket.emit (node:events:519:28)

at TCP.<anonymous> (node:net:339:12)

[Nest] 7 - 11/04/2024, 7:24:57 PM ERROR [Microservices:JobService] Object:

@kirantnath commented on GitHub (Nov 4, 2024): Yes it's coming as follows [Nest] 7 - 11/04/2024, 7:24:47 PM LOG [Microservices:StorageTemplateService] Starting storage template migration [Nest] 7 - 11/04/2024, 7:24:57 PM ERROR [Microservices:JobService] Unable to run job handler (storageTemplateMigration/storage-template-migration): Error: Connection terminated due to connection timeout [Nest] 7 - 11/04/2024, 7:24:57 PM ERROR [Microservices:JobService] Error: Connection terminated due to connection timeout at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:131:73) at Object.onceWrapper (node:events:633:28) at Connection.emit (node:events:519:28) at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:62:12) at Socket.emit (node:events:519:28) at TCP.<anonymous> (node:net:339:12) [Nest] 7 - 11/04/2024, 7:24:57 PM ERROR [Microservices:JobService] Object:
Author
Owner

@bo0tzz commented on GitHub (Nov 4, 2024):

That means it's losing connection to the postgres database. Does postgres have any errors? What sort of disk is /volume1, and how many resources does your system have?

@bo0tzz commented on GitHub (Nov 4, 2024): That means it's losing connection to the postgres database. Does postgres have any errors? What sort of disk is /volume1, and how many resources does your system have?
Author
Owner

@kirantnath commented on GitHub (Nov 5, 2024):

Hi, the volume1 is a 4tb seagate hdd on my synology NAS. Before I could get the logs of db,
I restarted the containers server and db a few times and this issue seemed to have corrected itself. Thanks again for your help. This software is amazing.

@kirantnath commented on GitHub (Nov 5, 2024): Hi, the volume1 is a 4tb seagate hdd on my synology NAS. Before I could get the logs of db, I restarted the containers server and db a few times and this issue seemed to have corrected itself. Thanks again for your help. This software is amazing.
Author
Owner

@kirantnath commented on GitHub (Nov 5, 2024):

Thank you.

@kirantnath commented on GitHub (Nov 5, 2024): Thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#4685