Skip to content

In docker environment after few restart admin can't log in #1157

Description

@ignisVeneficus

Hello!
I created sharelatex in the docker:

  sharelatex:
    restart: unless-stopped
    build:
      context: ${SHARELATEX_PATH}
      dockerfile: Dockerfile

    container_name: sharelatex
    depends_on:
      sharelatex-mongo:
        condition: service_healthy
      sharelatex-redis:
        condition: service_started
    links:
      - sharelatex-mongo
      - sharelatex-redis
    volumes:
      - ${SHARELATEX_PATH}/data:/var/lib/sharelatex
    environment:
      SHARELATEX_APP_NAME: Overleaf
      SHARELATEX_MONGO_URL: mongodb://sharelatex-mongo/sharelatex
      SHARELATEX_REDIS_HOST: sharelatex-redis
      REDIS_HOST: sharelatex-redis
      ENABLED_LINKED_FILE_TYPES: 'url,project_file'
      ENABLE_CONVERSIONS: 'true'
      EMAIL_CONFIRMATION_DISABLED: 'true'
      TEXMFVAR: /var/lib/sharelatex/tmp/texmf-var
      SHARELATEX_BEHIND_PROXY: 'true'
      SHARELATEX_SECURE_COOKIE: 'true'
      SHARELATEX_SITE_LANGUAGE: 'en'
      
  sharelatex-mongo:
    restart: unless-stopped
    image: bitnami/mongodb:5.0
    container_name: sharelatex-mongo
    expose:
      - 27017
    volumes:
      - ${SHARELATEX_DB_PATH}/data:/data/db
    healthcheck:
      test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet
      interval: 10s
      timeout: 10s
      retries: 5
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      ALLOW_EMPTY_PASSWORD: 'yes'

  sharelatex-redis:
    restart: unless-stopped
    image: redis:5
    container_name: sharelatex-redis
    expose:
      - 6379
    volumes:
      - ${SHARELATEX_REDIS_PATH}/data:/data

(as it wroten in some tutorial)
in the docker file is not any special, just install the latex packages:

FROM sharelatex/sharelatex
RUN tlmgr install scheme-full

I created an admin user, log in, and everything look like fine.

I did some docker compose down/up cycle
(I added other services, fine tuning the reverse proxy etc..)
And one point I'm not able to log in as admin, it said: unknow user.
I checked the mongoDb and it has 0 users.
I created once again, restarted the sharelatex sometimes, user still there, restarted the mongoDb sometimes, user still there.
But after some time and docker down/up, the user gone, nothing in the mongodb

How can I figure out what happen?
how can I prevent it?

Thanx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions