I’m trying to follow the guide here https://join-lemmy.org/docs/administration/install_docker.html

I get an error when I run docker compose up -d. It happens after docker outputs ⠹ Container lemmy-postgres-1 Starting

Error response from daemon: failed to create task for container: failed to create shim task: OCI
runtime create failed: runc create failed: unable to start container process: error during container
init: error mounting "/home/user/lemmy/volumes/postgres" to rootfs at "/var/lib/postgresql/data":
change mount propagation through procfd: open o_path procfd: open /var/lib/docker/
overlay2/238f1ac3ed9eac5f9c1fdc9ee1851634765c83da087baccc4dfbf4fcc4316b32/merged/
var/lib/postgresql/data: no such file or directory: unknown

I’m not really sure what this means, and trying all of AIs suggestions didn’t fix it.

I’m kinda new to all of this, so any help would be appreciated.

  • jivandabeast@lemmy.browntown.dev
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    4 hours ago

    This is the solution to your problem

    Change your config to mount the data directory to /var/lib/postgresql instead of /var/lib/postgresql/data

    My advice though, if your debugging skills are primarily comprised of asking AI for help, you’re in for a bit of a learning curve. The software is absolutely amazing (I’ve been running an instance since 2023), but weird things pop up and because this is so niche quick google searches are very limited and you gotta be willing to dive into github issues (this for example, I’ve also had to do it for pictrs to debug something a while ago).

    Don’t feel discouraged though, this is probably the most rewarding thing I host (more than plex, immich, or any of the other “mainstream” things people talk about)

    Editing to add, i know this is the fix because I had to reinstall lemmy from the ground up (long story) a few weeks ago and had the same issue :)

    • revoirwinery@ttrpg.networkOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 hours ago

      Wow, thank you so much. This solved it.

      I’m honestly not that familiar with docker or lemmy, so I was just trying to follow the guide and look up issues as they arose.

      I simply could not figure this out after hours of trying, so I decided to call in the cavalry. I was not disappointed.

  • 0_o7@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 hours ago

    Out of the topic but, If you really want to install lemmy, I’d suggest you wait until version 1.0 or a couple bugfix release after it.

    It’ll likely be more stable and you won’t have to deal with breaking changes. Might save yourself some headaches.

  • asudox@lemmy.asudox.dev
    link
    fedilink
    English
    arrow-up
    8
    ·
    14 hours ago

    Are you using postgresql 18? I tried upgrading yesterday from 17.6 and got an identical error message.

    • revoirwinery@ttrpg.networkOP
      link
      fedilink
      English
      arrow-up
      8
      ·
      13 hours ago

      Yes, it looks like the supplied docker-compose.yml points to pgautoupgrade/pgautoupgrade:18-alpine for the postgres image.

    • poVoq@slrpnk.net
      link
      fedilink
      English
      arrow-up
      8
      ·
      13 hours ago

      Indeed, Postgres 18 introduced some breaking changes and AFAIK Lemmy isn’t compatible with them yet. This will probably be fixed in the next release.

      • revoirwinery@ttrpg.networkOP
        link
        fedilink
        English
        arrow-up
        5
        ·
        13 hours ago

        That’d be a relief if that’s the case.

        I’ve been getting a bit demoralized trying to figure this out.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    14 hours ago

    Post your compose file with the password removed. There my be an error in the file after you edited it.

    • revoirwinery@ttrpg.networkOP
      link
      fedilink
      English
      arrow-up
      6
      ·
      14 hours ago

      Thank you, here it is.

      x-logging: &default-logging
        driver: "json-file"
        options:
          max-size: "50m"
          max-file: "4"
      
      services:
        proxy:
          image: nginx:1-alpine
          ports:
            # Listen for outside connections on port 10633. You can freely change the left-side
            # number to a different port, eg using port 80 if you don't need a reverse proxy.
            - "10633:8536"
          volumes:
            - ./nginx_internal.conf:/etc/nginx/nginx.conf:ro,Z
            - ./proxy_params:/etc/nginx/proxy_params:ro,Z
          restart: always
          logging: *default-logging
          depends_on:
            - pictrs
            - lemmy-ui
      
        lemmy:
          image: dessalines/lemmy:0.19.13
          hostname: lemmy
          restart: always
          logging: *default-logging
          environment:
            - RUST_LOG="warn"
          volumes:
            - ./lemmy.hjson:/config/config.hjson:Z
          depends_on:
            - postgres
            - pictrs
      
        lemmy-ui:
          image: dessalines/lemmy-ui:0.19.13
          environment:
            - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
            - LEMMY_UI_LEMMY_EXTERNAL_HOST=mylemmysite.com
            - LEMMY_UI_HTTPS=true
          volumes:
            - ./volumes/lemmy-ui/extra_themes:/app/extra_themes
          depends_on:
            - lemmy
          restart: always
          logging: *default-logging
      
        pictrs:
          image: asonix/pictrs:0.5.19
          # this needs to match the pictrs url in lemmy.hjson
          hostname: pictrs
          # we can set options to pictrs like this, here we set max. image size and forced format for conversion
          # entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
          environment:
            - PICTRS_OPENTELEMETRY_URL=http://otel:4137/
            - PICTRS__SERVER__API_KEY=passwordgoeshere
            - RUST_BACKTRACE=full
            - PICTRS__MEDIA__VIDEO__VIDEO_CODEC=vp9
            - PICTRS__MEDIA__ANIMATION__MAX_WIDTH=256
            - PICTRS__MEDIA__ANIMATION__MAX_HEIGHT=256
            - PICTRS__MEDIA__ANIMATION__MAX_FRAME_COUNT=400
          user: 991:991
          volumes:
            - ./volumes/pictrs:/mnt:Z
          restart: always
          logging: *default-logging
      
        postgres:
          image: pgautoupgrade/pgautoupgrade:18-alpine
          hostname: postgres
          environment:
            - POSTGRES_USER=lemmy
            - POSTGRES_PASSWORD=passwordgoeshere
            - POSTGRES_DB=lemmy
          shm_size: 1g
          volumes:
            - ./volumes/postgres:/var/lib/postgresql/data:Z
            - ./customPostgresql.conf:/etc/postgresql.conf
          restart: always
          logging: *default-logging
      
        postfix:
          image: mwader/postfix-relay
          environment:
            - POSTFIX_myhostname=mylemmysite.com
          restart: "always"
          logging: *default-logging