overleaf / toolkit

GNU Affero General Public License v3.0
587 stars 144 forks source link

Deploying issues with docker compose file #192

Open Viking-1 opened 1 year ago

Viking-1 commented 1 year ago

I can't run overleaf with a docker compose file (attached): dockercompose.txt

Everything seems fine: overleaf, redis and mongo are running and mongo is also healthy. But:

` Killing all processes... Oct 9 13:50:45 0e458a658ca4 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

I'm pretty sure, that this setup was running a while ago with the attached file. What am I missing here? At this point, I even can't access the launchpad, because something is wrong.

mwelsch commented 12 months ago

As mentioned in Issue #165 :

If you are using the Toolkit check manually-setting-up-mongodb-as-a-replica-set -> you need to run docker-compose exec -it mongo mongo and then the given command to initiate the replica set

Viking-1 commented 8 months ago

As mentioned in Issue #165 :

If you are using the Toolkit check manually-setting-up-mongodb-as-a-replica-set -> you need to run docker-compose exec -it mongo mongo and then the given command to initiate the replica set

Still not working:

*** 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

*** Running /etc/my_init.d/10_delete_old_logs.sh...

*** Running /etc/my_init.d/10_syslog-ng.init...

Feb 5 20:48:58 fe1b971b9680 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

Cannot connect to mongodb

MongooseServerSelectionError: getaddrinfo ENOTFOUND mongo

at Connection.openUri (/overleaf/services/web/node_modules/mongoose/lib/connection.js:825:32)

at /overleaf/services/web/node_modules/mongoose/lib/index.js:414:10

at /overleaf/services/web/node_modules/mongoose/lib/helpers/promiseOrCallback.js:41:5

at new Promise (<anonymous>)

at promiseOrCallback (/overleaf/services/web/node_modules/mongoose/lib/helpers/promiseOrCallback.js:40:10)

at Mongoose._promiseOrCallback (/overleaf/services/web/node_modules/mongoose/lib/index.js:1288:10)

at Mongoose.connect (/overleaf/services/web/node_modules/mongoose/lib/index.js:413:20)

at Object.<anonymous> (/overleaf/services/web/app/src/infrastructure/Mongoose.js:19:36)

at Module._compile (node:internal/modules/cjs/loader:1256:14)

at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) {

reason: TopologyDescription {

type: 'Unknown',

servers: Map(1) { 'mongo:27017' => [ServerDescription] },

stale: false,

compatible: true,

heartbeatFrequencyMS: 10000,

localThresholdMS: 15,

setName: null,

maxElectionId: null,

maxSetVersion: null,

commonWireVersion: 0,

logicalSessionTimeoutMinutes: null

},

code: undefined

}

*** /etc/my_init.d/98_check_db_access.sh failed with status 1

*** Killing all processes...

mwelsch commented 8 months ago

So the reason why overleaf is not starting is this line of your log

Cannot connect to mongodb

I ran into this issue while upgrading the version, maybe you upgrading your version of overleaf is the cause of the same thing I described in #193 ? The docker image version of the sharelatex container is not specified in the docker-compose - file, so I cannot tell what version you're attemting to run

Viking-1 commented 8 months ago

First: I use "image: sharelatex/sharelatex:latest"

I created the whole stack, connected to the mongo instance and added the replica command. After that, I've restarted sharelatex and thats it.

Second: Now I found another issue. Maybe I forget or misunderstood something. Sharelatex gets another external IP with

        networks:
            outside:
                ipv4_address: 192.168.1.35

with:
networks:
    outside:
        external: true
        name: net

That leads to the above log.

So I tried it w/o the external IP I got this:

Feb  7 10:51:48 6c3f5cdcbf5e 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
Mongodb is up.
Using default settings from /overleaf/services/web/config/settings.defaults.js
Using settings from /etc/sharelatex/settings.js
Set UV_THREADPOOL_SIZE=16
Redis is up.
All checks passed
*** Running /etc/my_init.d/99_run_web_migrations.sh...
Running migrations for server-ce
> migrations
> MONGO_SOCKET_TIMEOUT=0 east migrate -t server-ce
Using default settings from /overleaf/services/web/config/settings.defaults.js
Using settings from /etc/sharelatex/settings.js
Set UV_THREADPOOL_SIZE=16
Target migrations:
    20230512100122_ensure_history_migration
    20230817081910_back_fill_gitBridge_feature_server_pro
    20231031164732_drop_redundant_indexes
    20231101153447_partial_last_opened_index
    20231101191643_drop_unused_indexes
Migrate "20230512100122_ensure_history_migration"
Error: Error during migrate "20230512100122_ensure_history_migration": Found 2 projects not migrated to Full Project History
    at exports.migrate (/overleaf/services/web/migrations/20230512100122_ensure_history_migration.js:9:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /overleaf/node_modules/p-map/index.js:57:22
npm ERR! Lifecycle script `migrations` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: @overleaf/web 
npm ERR!   at location: /overleaf/services/web 
*** /etc/my_init.d/99_run_web_migrations.sh failed with status 1
*** Killing all processes...

First I thought "yeah... the IP might be the problem". But now I'm really confused

mwelsch commented 8 months ago

What does your network setup look like?

(You specified external and a name in the network area and assigned a dedicated ipv4_adress; additionally you linked sharelatex to the other containers. I'm kinda confused how/via which way you intend your docker containers to communicate)

Maybe - unless you have (important) projects you cannot access - it is a good idea to use the recommended way to get overleaf up and running?

The error from the last point looks like some upgrade faild (#166 #179 ?) - maybe you can use the latest running version (via image: sharelatex/sharelatex:[your_latest_running_version]) and export/backup your projects from there?

Viking-1 commented 8 months ago

I have a Proxmox server running with several VMs and each VM has its own IP address (like 192.168.1.xxx). On one VM Docker is running with Portainer and there are some containers running like a network monitor, speedtest monitor, CalibreWeb, Heimdall, and more. For tracking, PiHole, parenting controls and router configurations (ASUS GT-AXE16000) every VM and every container has its own external IP address in the network. Using the Docker IP with different ports wasn't really satisfying. FYI: No one IP or Port is exposed to the internet (only one nextcloud port), only access to the network and all services is a VPN with WireGuard.

Is there a way to link sharelatex to mongo and redis with an external IP? I know it was running a long time ago with this configuration (sharelatex external IP 192.xxx.... and mongo and redis with internal IP. Can I add external IPs to mongo and redis? Or can I modify this with the toolkit?

There is no critical need, currently I am the only one using LaTeX and I have a local instance. But it would be nice to have it in the LAN.