this post was submitted on 18 Jun 2024
18 points (90.9% liked)

Selfhosted

39966 readers
515 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hello,

I've noticed that when I restart my docker compose stack, the app seems to think that the server doesn't have copies of the latest files and re-uploads them.

The files can be seen in the filesystem of the host, but not through the web interface until they have been re-uploaded. The app uploads duplicates of all the files, at which point the web can see them again, and the fs has duplicates of everything.

This happens when I restart the stack, no upgrades to the system, just docker compose down and docker compose up -d

My set up is using an unmodified compose file from the docs. Any ideas what I could be doing wrong?

you are viewing a single comment's thread
view the rest of the comments
[–] MangoPenguin@lemmy.blahaj.zone 1 points 4 months ago* (last edited 4 months ago) (1 children)

Like, could there be a duplicate dB volume and when the stack gets restarted, docker picks one or the other?

I'm not sure that is possible. Once a service has a volume defined it'll use that unless you manually change it.

But if you don't have a volume defined, data won't persist when the service is updated.

If you're just using the compose stack given by Immich, then everything should be set up properly though.

[–] anytimesoon@feddit.uk 1 points 4 months ago (1 children)

The volume is defined like this at the end of the compose file

database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:
[–] MangoPenguin@lemmy.blahaj.zone 1 points 4 months ago (2 children)

Yeah that looks fine, odd.

I assume this is a pretty normal install of Ubuntu, and /var/lib/docker hasn't been messed with at all?

[–] anytimesoon@feddit.uk 1 points 4 months ago* (last edited 4 months ago)

That's correct. Ubuntu is basically just a platform to run docker, haven't really touched it. Docker is the same. Just using it to run my containers. Haven't ventured at all into /var/lib/docker

The weird thing is that it's intermittent. It's only happened twice since I started using immich. I've been restarting the containers repeatedly for a few days now and it hasnt happened again.

[–] anytimesoon@feddit.uk 1 points 4 months ago* (last edited 4 months ago)

It's really weird. I think there are somehow two database volumes on my system.

The reason I think this is because:

  1. I am the only user
  2. there is only one user in the user table
  3. there are two folders in the upload folders. Both have a uuid as their name and one of the uuids matches with the user id in the database
  4. the user_token table has tokens no tokens from before this happened to me a couple days ago

So, where did this other user come from? Why have none of my log ins been tracked in the database before the incident?