-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MongoDB no connection possible #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same isssue and the error was solved when I checkout from |
Hey, read this release notes. https://github.com/overleaf/overleaf/wiki/Release-Notes--4.x.x |
Solved, thanks! But there are some doubts , the latest version and the |
Yes, that's true, I just stumbled upon it by any bit |
Edit the docker-compose file replacing mongo entry with: mongo:
restart: always
image: mongo:4.4
container_name: mongo
command: "--replSet overleaf"
expose:
- 27017
volumes:
- "./mongo_data:/data/db"
healthcheck:
test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
mongoinit:
image: mongo:4.4
# this container will exit after executing the command
restart: "no"
depends_on:
mongo:
condition: service_healthy
entrypoint:
[
"mongo",
"--host",
"mongo:27017",
"--eval",
'rs.initiate({ _id: "overleaf", members: [ { _id: 0, host: "mongo:27017" } ] })',
] the one time container should do the trick |
Another method is to add healthcheck:
test: "mongosh --quiet --eval 'rs.hello().setName ? rs.hello().setName : rs.initiate({_id: \"overleaf\",members:[{_id: 0, host:\"mongo:27017\"}]})'" In this case, you will not need another ephemeral service in your compose file. |
not work, the below error will be produced:
|
Hello, The Overleaf Toolkit is our recommended method for deploying Overleaf Community Edition and Server Pro now. It will automatically create the MongoDB replica set for you. We've also prepared a migration guide in the Toolkit docs. Greetings, |
Wanted to post to give my 2 cents... The docker-compose method is fine for small deployments, but for more rigorous deployments using systemd, quadlets or kubernetes might be required. While the toolkit is nice for testing, simply saying "Use the toolkit" might not help some people. |
Thanks for the feedback @icsy7867! We've prepared an update for the docker-compose setup for bootstrapping the mongodb with a script that creates the replica set. It's already merged in our internal monorepo and will sync here shortly. |
Uh oh!
There was an error while loading. Please reload this page.
Steps to Reproduce
or
Expected Behaviour
Sharelatex/Overleaf starts up and works
Observed Behaviour
No connection to sharelatex possible.
Context
I wanted to update my System and afterwards nothing worked.
Technical Info
Log-File of the Docker-Container with use of Mongo 4.4, looks the same with other versions:
Analysis
For me it looks like there is an Issue with mongo-DB, but every version I try (4.0, 4.1, 4.2, 4.4 or 6.0) has the same Problem.
As it states out for me, sharelatex is starting over and over again, trying to connect to mongodb and after that is not possible, rebooting.
I tried to do a fresh clean install with the docker-compose.yaml, of this repro as well, with the same issue
The text was updated successfully, but these errors were encountered: