immich-app / immich

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

[BUG] Storage size does not match between menu panel and settings page #1928

Closed easez88 closed 1 year ago

easez88 commented 1 year ago

The bug

image

The server storage panel does not match the listed storage under server stats. In my case I believe it is because I was testing background storage and deleted the photos and started uploading again to see if background storage was working. The storage under server stats is correct. However, I believe the storage in the menu bar and IOS backup page, show the size of everything that has been uploaded, but does not update when photos are deleted.

Let me know if you need anything to confirm.

The OS that Immich Server is running on

Fedora 32

Version of Immich Server

v1.50.1

Version of Immich Mobile App

v1/50/0

Platform with the issue

Your docker-compose.yml content

version: "3.8"

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

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

  immich-machine-learning:
    container_name: immich_machine_learning
    image: altran1502/immich-machine-learning:release
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - model-cache:/cache
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    restart: always

  immich-web:
    container_name: immich_web
    image: altran1502/immich-web:release
    entrypoint: [ "/bin/sh", "./entrypoint.sh" ]
    env_file:
      - .env
    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: altran1502/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:

Your .env content

immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION="/mnt/data"
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. Upload photos from IOS app.
2. Ensure storage size matches everywhere.
3. Erase photos from the server.
4. Ensure storage size updates in server stats. 
5. View website and IOS app to notice storage incorrect.

Additional information

No response

zackpollard commented 1 year ago

Hey,

The server storage usage under the admin panel is specific usage for Immich. The storage in the bottom left of the main pages is total disk usage for the mountpoint that Immich is using, not just storage space inside Immich.

We might change this behaviour with some upcoming features, but this is not considered a bug right now :smile:

Cheers!

easez88 commented 1 year ago

Gotcha! One question when I run du -h I'm getting 14G for that mount, but Immich is reporting 20G. Why is there such a large discrepency?

alextran1502 commented 1 year ago

Gotcha! One question when I run du -h I'm getting 14G for that mount, but Immich is reporting 20G. Why is there such a large discrepency?

Hmm unsure, is that just a plan disk mount of the disk that runs the OS as well?

jrasm91 commented 1 year ago

Probably the difference between GiB and GB will explain some of the discrepancy.

Chacsam commented 1 year ago

In a similar context I have noted discrepencies in the evolution after a batch upload in CLI. Note that I initially synchronized from the iOS app and then "batch uploaded" an old backup from synology app. So they were duplicate pictures which seemed to have been nicely handled (no duplicate in my photo view).

The issue is on "storage size" where:

Server storage seems to increase twice as fast as user storage. (I'll soon end up with shortage :-( ) Is it due to thumbnails?

Additional information:

Command used: sudo docker run -it --rm -v "$(pwd):/import" ghcr.io/immich-app/immich-cli:latest upload --key XXX --recursive --server http://192.168.11.215:2283/api

Feedback:

Checking connectivity with Immich instance...
Server status: OK
Checking credentials...
Login status: OK
Successful authentication for user xxx@xxx.com
Indexing local assets...
Indexing complete, found 2955 local assets
Comparing local assets with those on the Immich instance...
A total of 2955 assets will be uploaded to the server
Do you want to start upload now? (y/n) y
Start uploading...
Upload Progress | ████████████████████████████████████████ | 100% || 2955/2955 || Current file [/import/Travaux_salon/f55]
Failed to upload 0 files  []

Screenshots

Before: image

After: image

masterashu commented 1 year ago

For me its showing way too high, i chose the data disk to a external 2Tb ssd. image

easez88 commented 1 year ago

Yeah, I'm still seeing this. Immich is now say I've used185.7Gb, but du says 168.