Skip to content

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

Closed
minnten opened this issue Jun 2, 2023 · 10 comments
Closed

MongoDB no connection possible #1120

minnten opened this issue Jun 2, 2023 · 10 comments

Comments

@minnten
Copy link

minnten commented Jun 2, 2023

Steps to Reproduce

  1. Try to install a new Environment from Docker CE
    or
  2. Update to sharelatex:latest

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:

MongoServerError: Transaction numbers are only allowed on a replica set member or mongos
    at Connection.onMessage (/overleaf/services/web/node_modules/mongodb/lib/cmap/connection.js:227:30)
    at MessageStream.<anonymous> (/overleaf/services/web/node_modules/mongodb/lib/cmap/connection.js:60:60)
    at MessageStream.emit (node:events:513:28)
    at processIncomingData (/overleaf/services/web/node_modules/mongodb/lib/cmap/message_stream.js:125:16)
    at MessageStream._write (/overleaf/services/web/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at MessageStream.Writable.write (node:internal/streams/writable:336:10)
    at Socket.ondata (node:internal/streams/readable:754:22)
    at Socket.emit (node:events:513:28) {
  ok: 0,
  code: 20,
  codeName: 'IllegalOperation',
  [Symbol(errorLabels)]: Set(0) {}
}
*** /etc/my_init.d/98_check_db_access.sh failed with status 1
*** Killing all processes...
Jun  2 09:05:15 fb8aaf0b4ea5 syslog-ng[60]: syslog-ng shutting down; version='3.25.1'
*** Running /etc/my_init.d/00_make_sharelatex_data_dirs.sh...
*** Running /etc/my_init.d/00_regen_sharelatex_secrets.sh...
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/00_restore_site_status...
*** Running /etc/my_init.d/00_set_docker_host_ipaddress.sh...
*** Running /etc/my_init.d/01_nginx_config_template.sh...
Nginx: generating config file from template
Nginx: reloading config
 * Reloading nginx configuration nginx
   ...done.
*** Running /etc/my_init.d/10_delete_old_logs.sh...
*** Running /etc/my_init.d/10_syslog-ng.init...
Jun  2 09:05:19 fb8aaf0b4ea5 syslog-ng[60]: syslog-ng starting up; version='3.25.1'
*** Running /etc/my_init.d/98_check_db_access.sh...
Checking can connect to mongo and redis
Using default settings from /overleaf/services/web/config/settings.defaults.js
Using settings from /etc/sharelatex/settings.js
Set UV_THREADPOOL_SIZE=16
2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 msg=mongoose default connection open 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 2023-06-02T09:05:20.647Z 2023-06-02T09:05:20.647Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 msg=mongoose default connection open v=0
Mongo instance doesn't support transactions
MongoServerError: Transaction numbers are only allowed on a replica set member or mongos
    at Connection.onMessage (/overleaf/services/web/node_modules/mongodb/lib/cmap/connection.js:227:30)
    at MessageStream.<anonymous> (/overleaf/services/web/node_modules/mongodb/lib/cmap/connection.js:60:60)
    at MessageStream.emit (node:events:513:28)
    at processIncomingData (/overleaf/services/web/node_modules/mongodb/lib/cmap/message_stream.js:125:16)
    at MessageStream._write (/overleaf/services/web/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at MessageStream.Writable.write (node:internal/streams/writable:336:10)
    at Socket.ondata (node:internal/streams/readable:754:22)
    at Socket.emit (node:events:513:28) {
  ok: 0,
  code: 20,
  codeName: 'IllegalOperation',
  [Symbol(errorLabels)]: Set(0) {}
}
*** /etc/my_init.d/98_check_db_access.sh failed with status 1
*** Killing all processes...
Jun  2 09:05:20 fb8aaf0b4ea5 syslog-ng[60]: syslog-ng shutting down; version='3.25.1'
*** Running /etc/my_init.d/00_make_sharelatex_data_dirs.sh...
*** Running /etc/my_init.d/00_regen_sharelatex_secrets.sh...
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/00_restore_site_status...
*** Running /etc/my_init.d/00_set_docker_host_ipaddress.sh...
*** Running /etc/my_init.d/01_nginx_config_template.sh...
Nginx: generating config file from template
Nginx: reloading config
 * Reloading nginx configuration nginx
   ...done.
*** Running /etc/my_init.d/10_delete_old_logs.sh...
*** Running /etc/my_init.d/10_syslog-ng.init...
Jun  2 09:05:27 fb8aaf0b4ea5 syslog-ng[60]: syslog-ng starting up; version='3.25.1'
*** Running /etc/my_init.d/98_check_db_access.sh...
Checking can connect to mongo and redis
Using default settings from /overleaf/services/web/config/settings.defaults.js
Using settings from /etc/sharelatex/settings.js
Set UV_THREADPOOL_SIZE=16
2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 msg=mongoose default connection open 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 2023-06-02T09:05:28.997Z 2023-06-02T09:05:28.997Z 20 name=default-sharelatex hostname=fb8aaf0b4ea5 pid=69 msg=mongoose default connection open v=0
Mongo instance doesn't support transactions
MongoServerError: Transaction numbers are only allowed on a replica set member or mongos
    at Connection.onMessage (/overleaf/services/web/node_modules/mongodb/lib/cmap/connection.js:227:30)
    at MessageStream.<anonymous> (/overleaf/services/web/node_modules/mongodb/lib/cmap/connection.js:60:60)
    at MessageStream.emit (node:events:513:28)
    at processIncomingData (/overleaf/services/web/node_modules/mongodb/lib/cmap/message_stream.js:125:16)
    at MessageStream._write (/overleaf/services/web/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at MessageStream.Writable.write (node:internal/streams/writable:336:10)
    at Socket.ondata (node:internal/streams/readable:754:22)
    at Socket.emit (node:events:513:28) {
  ok: 0,
  code: 20,
  codeName: 'IllegalOperation',
  [Symbol(errorLabels)]: Set(0) {}
}
*** /etc/my_init.d/98_check_db_access.sh failed with status 1
*** Killing all processes...
Jun  2 09:05:29 fb8aaf0b4ea5 syslog-ng[60]: syslog-ng shutting down; version='3.25.1'

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

@yzx9
Copy link

yzx9 commented Jun 3, 2023

Same isssue and the error was solved when I checkout from sharelatex/sharelatex:4.0.1 or sharelatex/sharelatex:4.0.0 to sharelatex/sharelatex:3.5.7.

@ghost
Copy link

ghost commented Jun 3, 2023

Hey, read this release notes.

https://github.com/overleaf/overleaf/wiki/Release-Notes--4.x.x

@yzx9
Copy link

yzx9 commented Jun 3, 2023

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 docker-compose.yaml provided in this repo cannot be paired, and there are no warning in the README.md, which seems a bit trange

@ghost
Copy link

ghost commented Jun 3, 2023

Yes, that's true, I just stumbled upon it by any bit

@stockmind
Copy link

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

@aadityabhatia
Copy link

aadityabhatia commented Sep 11, 2023

Another method is to add rs.initiate() to your healthcheck as follows. Use mongo or mongosh command depending on the version of your mongo image.

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.

@Cufoon
Copy link

Cufoon commented Aug 9, 2024

Another method is to add rs.initiate() to your healthcheck as follows. Use mongo or mongosh command depending on the version of your mongo image.

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:

mongo     | {"t":{"$date":"2024-08-09T02:31:08.353+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"ReadConcernMajorityNotAvailableYet: Read concern majority reads are currently not possible.","nextWakeupMillis":1200}}

@das7pad
Copy link
Member

das7pad commented Aug 29, 2024

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,
Jakob

@das7pad das7pad closed this as completed Aug 29, 2024
@icsy7867
Copy link

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.

@das7pad
Copy link
Member

das7pad commented Oct 10, 2024

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.
This will only apply to new deployments though, existing databases need to be converted using rs.init manually as per the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants