Skip to content

docker-compose.yml does not work out of the box due to mongoDB incompatible version with Sharelatex image #1441

Closed

Description

@AleixMT

Steps to Reproduce

git clone  https://github.com/overleaf/overleaf
cd overleaf
docker compose up

Expected Behaviour

I expected the docker-compose.yml to work out of the box.

Observed Behaviour

Sharelatex complains that it needs mongoDB version 8.0, but the image sets it at 6.0:

sharelatex  | The MongoDB server has version 6.0.27, but Overleaf requires at least version 8.0. Aborting.                                              
mongo       | {"t":{"$date":"2026-01-07T06:55:43.164+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn73","msg":"Connection ended","attr":{"re
mote":"172.18.0.4:42588","uuid":"ad1b7c45-21ea-489f-ae8e-6707ab4c2976","connectionId":73,"connectionCount":6}}                                          
mongo       | {"t":{"$date":"2026-01-07T06:55:43.164+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn72","msg":"Connection ended","attr":{"re
mote":"172.18.0.4:42584","uuid":"7baa7d24-b5a1-453c-822e-d96e0c24c1d2","connectionId":72,"connectionCount":5}}                                          
sharelatex  | *** /etc/my_init.d/500_check_db_access.sh failed with status 1                                                                            
mongo       | {"t":{"$date":"2026-01-07T06:55:43.164+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn71","msg":"Connection ended","attr":{"re
mote":"172.18.0.4:42568","uuid":"eea21325-7b6c-4ba4-ac7a-1093b5c08e96","connectionId":71,"connectionCount":4}}                                          
sharelatex  |                                                                                                                                           
sharelatex  | *** Killing all processes...  

Context

I just wanted to use ShareLatex in my machine.

Technical Info

  • URL:
  • Browser Name and version:
  • Operating System and version (desktop or mobile):
  • Signed in as:
  • Project and/or file: sharelatex, main commit 9be3c3f

Analysis

You could think that you simply need to upgrade the version of mongodb in the docker-compose.yml, like:

    mongo:
        restart: always
        image: mongo:8.0

But then another problem appears and mongoDB does not start:

mongo       | {"t":{"$date":"2026-01-07T07:06:53.648+00:00"},"s":"F",  "c":"CONTROL",  "id":20573,   "ctx":"initandlisten","msg":"Wrong mongod version",
"attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion doc
ument in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"6.0\" }. See https://docs.mongodb.com/master/release-notes/7.0-compati
bility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '6.0'; expected '7.0' or '7.3' or '8.0'. See https://docs.mon
godb.com/master/release-notes/7.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 7.0, see the documentation
 on upgrading at https://docs.mongodb.com/master/release-notes/7.0/#upgrade-procedures."}}

I am not sure how to proceed to just make it work and run the compose file.

Activity

  1. Chuwee commented on Jan 7, 2026

    @Chuwee

    This can be solved by removing the directory "mongo_data" and then rerunning docker compose after switching mongo db version to 8.0

  2. AleixMT commented on Jan 9, 2026

    @AleixMT
    Author

    This can be solved by removing the directory "mongo_data" and then rerunning docker compose after switching mongo db version to 8.0

    I might have tried that but it did not work. Anyway, I see the PR fixing this issue is incoming. I will wait until it is merged. Thank you so much.

  3. mitchirhd commented on Jan 14, 2026

    @mitchirhd

    I had to additionally run the mongodb setup command from mongodb-init-replica-set.js manually using mongoshell inside the docker container.

    First docker exec -it mongo mongosh
    Then rs.initiate({ _id: 'overleaf', members: [{ _id: 0, host: 'mongo:27017' }] })

  4. dc6jn commented on May 14, 2026

    @dc6jn

    Hi there,
    I think this problem is relatet to this Bugreport.
    I found some hints in the very good explanation here

    To make things short: modify lib/docker-compose.mongo.yml and add environment setting:

    expose:
    - 27017
    environment:
    GLIBC_TUNABLES: 'glibc.cpu.hwcaps=-SHSTK'

    healthcheck:

  5. AleixMT commented on May 18, 2026

    @AleixMT
    Author

    I have just tried to replicate my steps that i specified at the top of this issue and it works. The docker compose works out of box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions