toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

Install on Synology DSM 7 fails

Open Tom7320 opened this issue 2 years ago • 6 comments

Steps to Reproduce

Hi everyone!

I tried to install Overleaf on a Synology NAS with DSM 7. I followed the Quick Start Guide and encountered multiple problems:

  1. Data dirs are not created by the script:
root@Syno:~/overleaf-toolkit# bin/up
Starting mongo ...
Starting redis ... error
Starting mongo ... error
ERROR: for redis  Cannot start service redis: Bind mount failed: '/root/overleaf-toolkit/data/redis' does not exists

ERROR: for mongo  Cannot start service mongo: Bind mount failed: '/root/overleaf-toolkit/data/mongo' does not exists

ERROR: for redis  Cannot start service redis: Bind mount failed: '/root/overleaf-toolkit/data/redis' does not exists

ERROR: for mongo  Cannot start service mongo: Bind mount failed: '/root/overleaf-toolkit/data/mongo' does not exists
ERROR: Encountered errors while bringing up the project.`

I created the dirs manually.

  1. Then the containers start as expected. But still I can't reach the launchpad. I get a 502 Bad Gateway error. Variables: SHARELATEX_PORT=8080 SHARELATEX_LISTEN_IP=0.0.0.0

  2. The doctor says:

root@Syno:~/overleaf-toolkit# bin/doctor
====== Overleaf Doctor ======
- Host Information
    - Linux
    - lsb_release not found !
- Dependencies
    - bash
        - status: present
        - version info: 4.4.23(1)-release
    - docker
        - status: present
        - version info: Docker version 20.10.3, build 55f0773
    - docker-compose
        - status: present
        - version info: docker-compose version 1.28.5, build 24fb474e
    - realpath
        - status: present
        - version info: realpath (GNU coreutils) 8.30
    - perl
        - status: MISSING !
    - awk
        - status: present
        - version info: GNU Awk 5.0.0, API: 2.0 (GNU MPFR 4.0.1, GNU MP 6.1.2)
    - openssl
        - status: present
        - version info: OpenSSL 1.1.1o  3 May 2022
- Docker Daemon
    - status: up
====== Configuration ======
- config/version
    - status: present
    - version: 3.3.2
- config/overleaf.rc
    - status: present
    - values
        - SHARELATEX_DATA_PATH: data/sharelatex
        - SERVER_PRO: false
        - SHARELATEX_LISTEN_IP: 0.0.0.0
        - SHARELATEX_PORT: 8080
        - MONGO_ENABLED: true
        - MONGO_IMAGE: mongo:4.4
        - MONGO_DATA_PATH: data/mongo
        - REDIS_ENABLED: true
        - REDIS_DATA_PATH: data/redis
        - NGINX_ENABLED: false
        - NGINX_CONFIG_PATH: config/nginx/nginx.conf
        - TLS_PRIVATE_KEY_PATH: config/nginx/certs/overleaf_key.pem
        - TLS_CERTIFICATE_PATH: config/nginx/certs/overleaf_certificate.pem
        - NGINX_HTTP_LISTEN_IP: 127.0.1.1
        - NGINX_HTTP_PORT: 80
        - NGINX_TLS_LISTEN_IP: 127.0.1.1
        - TLS_PORT: 443
- config/variables.env
    - status: present
====== Warnings ======
! perl not found
====== End ======

Expected Behaviour

Install and run without issues on Synology with DSM 7. Why do I get the Perl warning? Do I need it? Please excuse if this is a stupid question, but I was not able to figure it out myself....

Tom7320 avatar Dec 22 '22 17:12 Tom7320

I had the same issue and I fixed it by simply installing Perl from the Synology Package Center. The doctor will return no warnings about Perl after you do it.

However this seems not to solve the "502 Bad Gateway" error. It looks there still are issues in mongo container.

These are the errors it keeps firing:

mongo       | {"t":{"$date":"2023-01-17T02:07:19.248+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn51","msg":"Connection ended","attr":{"remote":"127.0.0.1:34920","connectionId":51,"connectionCount":12}}
mongo       | {"t":{"$date":"2023-01-17T02:07:29.417+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:34926","connectionId":52,"connectionCount":13}}
mongo       | {"t":{"$date":"2023-01-17T02:07:29.417+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn52","msg":"client metadata","attr":{"remote":"127.0.0.1:34926","client":"conn52","doc":{"application":{"name":"MongoDB Shell"},"driver":{"name":"MongoDB Internal Client","version":"4.4.18"},"os":{"type":"Linux","name":"Ubuntu","architecture":"x86_64","version":"20.04"}}}}

I searched online for how to solve this. I found nothing useful so far...

lmennoia avatar Jan 17 '23 02:01 lmennoia

I searched online for how to solve this. I found nothing useful so far...

Me neither. Why does it need Perl on the host? I thought it was 100% Bash script?

However this seems not to solve the "502 Bad Gateway" error.

I installed the "legacy" way without the toolkit.

Tom7320 avatar Jan 17 '23 05:01 Tom7320

I install overleaf on DSM 7 without the toolkit and use original docker compose file. Though it is not recommended but works well.

qcmiao1998 avatar Feb 02 '23 08:02 qcmiao1998

Yes. I also used the old docker compose file. This still works. But this is not the recommended way. Therefore, I just wanted to report it...

Tom7320 avatar Feb 02 '23 09:02 Tom7320

I also found a way through by using the toolkit. However I find docker compose a much elegant way for doing it. Could you please share your tested working docker compose stacks for Overleaf?

lmennoia avatar Feb 03 '23 08:02 lmennoia

version: '2.2'
services:
    sharelatex:
        restart: always
        # Server Pro users:
        # image: quay.io/sharelatex/sharelatex-pro
        image: sharelatex/sharelatex:with-texlive-full
        container_name: sharelatex
        labels:
            - "com.centurylinklabs.watchtower.enable=false"
        depends_on:
            mongo:
                condition: service_healthy
            redis:
                condition: service_started
        ports:
            - 8080:80
        links:
            - mongo
            - redis
        volumes:
            - /volume1/docker/overleaf/sharelatex_data:/var/lib/sharelatex
            ########################################################################
            ####  Server Pro: Uncomment the following line to mount the docker  ####
            ####             socket, required for Sibling Containers to work    ####
            ########################################################################
            - /var/run/docker.sock:/var/run/docker.sock
        environment:

            SHARELATEX_APP_NAME: Overleaf Community Edition

            SHARELATEX_MONGO_URL: mongodb://mongo/sharelatex

            # Same property, unfortunately with different names in
            # different locations
            SHARELATEX_REDIS_HOST: redis
            REDIS_HOST: redis

            ENABLED_LINKED_FILE_TYPES: 'url,project_file'

            # Enables Thumbnail generation using ImageMagick
            ENABLE_CONVERSIONS: 'true'

            # Disables email confirmation requirement
            EMAIL_CONFIRMATION_DISABLED: 'true'

            # temporary fix for LuaLaTex compiles
            # see https://github.com/overleaf/overleaf/issues/695
            TEXMFVAR: /var/lib/sharelatex/tmp/texmf-var

            ## Set for SSL via nginx-proxy
            #VIRTUAL_HOST: 103.112.212.22

            # SHARELATEX_SITE_URL: http://sharelatex.mydomain.com
            # SHARELATEX_NAV_TITLE: Our ShareLaTeX Instance
            # SHARELATEX_HEADER_IMAGE_URL: http://somewhere.com/mylogo.png
            # SHARELATEX_ADMIN_EMAIL: [email protected]

            # SHARELATEX_LEFT_FOOTER: '[{"text": "Powered by <a href=\"https://www.sharelatex.com\">ShareLaTeX</a> 2016"},{"text": "Another page I want to link to can be found <a href=\"here\">here</a>"} ]'
            # SHARELATEX_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]'

            # SHARELATEX_EMAIL_FROM_ADDRESS: "[email protected]"

            # SHARELATEX_EMAIL_AWS_SES_ACCESS_KEY_ID:
            # SHARELATEX_EMAIL_AWS_SES_SECRET_KEY:

            # SHARELATEX_EMAIL_SMTP_HOST: smtp.mydomain.com
            # SHARELATEX_EMAIL_SMTP_PORT: 587
            # SHARELATEX_EMAIL_SMTP_SECURE: false
            # SHARELATEX_EMAIL_SMTP_USER:
            # SHARELATEX_EMAIL_SMTP_PASS:
            # SHARELATEX_EMAIL_SMTP_TLS_REJECT_UNAUTH: true
            # SHARELATEX_EMAIL_SMTP_IGNORE_TLS: false
            # SHARELATEX_EMAIL_SMTP_NAME: '127.0.0.1'
            # SHARELATEX_EMAIL_SMTP_LOGGER: true
            # SHARELATEX_CUSTOM_EMAIL_FOOTER: "This system is run by department x"

            ################
            ## Server Pro ##
            ################

            # SANDBOXED_COMPILES: 'true'

            # SANDBOXED_COMPILES_SIBLING_CONTAINERS: 'true'
            # SANDBOXED_COMPILES_HOST_DIR: '/var/sharelatex_data/data/compiles'
            # SYNCTEX_BIN_HOST_PATH: '/var/sharelatex_data/bin/synctex'

            # DOCKER_RUNNER: 'false'

            ## Works with test LDAP server shown at bottom of docker compose
            # SHARELATEX_LDAP_URL: 'ldap://ldap:389'
            # SHARELATEX_LDAP_SEARCH_BASE: 'ou=people,dc=planetexpress,dc=com'
            # SHARELATEX_LDAP_SEARCH_FILTER: '(uid={{username}})'
            # SHARELATEX_LDAP_BIND_DN: 'cn=admin,dc=planetexpress,dc=com'
            # SHARELATEX_LDAP_BIND_CREDENTIALS: 'GoodNewsEveryone'
            # SHARELATEX_LDAP_EMAIL_ATT: 'mail'
            # SHARELATEX_LDAP_NAME_ATT: 'cn'
            # SHARELATEX_LDAP_LAST_NAME_ATT: 'sn'
            # SHARELATEX_LDAP_UPDATE_USER_DETAILS_ON_LOGIN: 'true'

            # SHARELATEX_TEMPLATES_USER_ID: "578773160210479700917ee5"
            # SHARELATEX_NEW_PROJECT_TEMPLATE_LINKS: '[ {"name":"All Templates","url":"/templates/all"}]'


            # SHARELATEX_PROXY_LEARN: "true"

    mongo:
        restart: always
        image: mongo:4.0
        container_name: mongo
        expose:
            - 27017
        volumes:
            - /volume1/docker/overleaf/mongo_data:/data/db
        healthcheck:
            test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet
            interval: 10s
            timeout: 10s
            retries: 5

    redis:
        restart: always
        image: redis:5
        container_name: redis
        expose:
            - 6379
        volumes:
            - /volume1/docker/overleaf/redis_data:/data

    # ldap:
    #    restart: always
    #    image: rroemhild/test-openldap
    #    container_name: ldap
    #    expose:
    #        - 389

    # See https://github.com/jwilder/nginx-proxy for documentation on how to configure the nginx-proxy container,
    # and https://github.com/overleaf/overleaf/wiki/HTTPS-reverse-proxy-using-Nginx for an example of some recommended
    # settings. We recommend using a properly managed nginx instance outside of the Overleaf Server Pro setup,
    # but the example here can be used if you'd prefer to run everything with docker-compose

    # nginx-proxy:
    #     image: jwilder/nginx-proxy
    #     container_name: nginx-proxy
    #     ports:
    #       #- "80:80"
    #       - "443:443"
    #     volumes:
    #       - /var/run/docker.sock:/tmp/docker.sock:ro
    #       - /home/sharelatex/tmp:/etc/nginx/certs

Tom7320 avatar Feb 03 '23 08:02 Tom7320