Endless error loop of rabbitmq connection issue

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Install together with traefik 2 within the same docker compose file. postgresql and rabbitmq work fine without any error. However, the document server raise endless error loop of rabbitmq connection issue when it starts compeletly. The error message is shown below. I changed the AMQP_URI from rabbitmq hostname to IP address, but it would won’t solve the problem. The error ouptup shows that the document server is still trying to connect to the IP of 127.0.0.1.

image

“[ERROR] [localhost] [docId] [userId] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672”
2023-07-23T05:20:33.393944694Z at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Use the latest docker compose file with minor changes to setup traefik together.

What is the expected behavior?
Is the error by design? and actually there is no negative impact with it at all?

Did this work in previous versions of DocumentServer?
N/A

DocumentServer Docker tag:
Latest

Host Operating System:
Debian 11 LXC container in PVE7.4

BTW, I believe it’s a bug instead of by design. Since I encountered 520 bad gateway error when I accessed the healthcheck webpage. Therefore I can’t integrate it with nextcloud.

Looks like that’s the root casue of the issue, why the document server try to connect to localhost(127.0.0.1) as MQ service endpoint?
image

Hello @pop4ever

Please share some more info about the issue.

What changes are you referring to? If you can provide a YML file itself, we can test it out to see what is causing the issue.

In general, did you check if RabbitMQ service was up and running in the Docker container with Document Server? All in all, please reproduce the issue and check all statuses with service --status-all and provide an output please.

here is the docker compose file:
version: '2'
services:
  onlyoffice-documentserver:
    #build:
      #context: .
    image: onlyoffice/documentserver:latest
    container_name: onlyoffice-documentserver
    depends_on:
      - onlyoffice-postgresql
      - onlyoffice-rabbitmq
    environment:
      - TZ=Asia/Shanghai
      - DB_TYPE=postgres
      - DB_HOST=onlyoffice-postgresql
      - DB_PORT=5432
      - DB_NAME=onlyoffice
      - DB_USER=onlyoffice
      - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq:5672
      # Uncomment strings below to enable the JSON Web Token validation.
      - JWT_ENABLED=true
      - JWT_SECRET=jwtpassword
      - JWT_HEADER=Authorization
      - JWT_IN_BODY=true
    #ports:
      #- '80:80'
      #- '443:443'
    stdin_open: true
    tty: true
    restart: always
    stop_grace_period: 60s
    volumes:
      - /zfs/docker/data/onlyoffice/data:/var/www/onlyoffice/Data
      - /zfs/docker/data/onlyoffice/logs:/var/log/onlyoffice
      - /zfs/docker/data/onlyoffice/lib:/var/lib/onlyoffice/documentserver/App_Data/cache/files
      - /zfs/docker/data/onlyoffice/public:/var/www/onlyoffice/documentserver-example/public/files
      - /zfs/docker/data/onlyoffice/fonts:/usr/share/fonts
      - /zfs/docker/data/onlyoffice/local.json:/etc/onlyoffice/documentserver/local.json
    networks:
      - traefik
      - onlyoffice
      #- nextcloud
    labels:
      - traefik.enable=true
      - traefik.http.routers.onlyoffice.rule=Host(`onlyoffice.xyz.com`)
      - traefik.http.routers.onlyoffice.entrypoints=https
      - traefik.http.routers.onlyoffice.service=onlyoffice
      - traefik.http.services.onlyoffice.loadbalancer.server.port=80
      - traefik.http.services.onlyoffice.loadbalancer.passhostheader=true
      - traefik.http.routers.onlyoffice.middlewares=traefik-bouncer@file,onlyoffice-headers@docker
      - traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https
      - traefik.http.middlewares.onlyoffice-headers.headers.accesscontrolalloworiginlist=*
       
  onlyoffice-rabbitmq:
    container_name: onlyoffice-rabbitmq
    image: rabbitmq
    environment:
      - TZ=Asia/Shanghai
    restart: always
    expose:
      - '5672'
    networks:
      - onlyoffice
    volumes:
      - /zfs/docker/data/onlyoffice-rabbitmq:/var/lib/rabbitmq
    

  onlyoffice-postgresql:
    container_name: onlyoffice-postgresql
    image: postgres:9.5
    environment:
      - TZ=Asia/Shanghai
      - POSTGRES_DB=onlyoffice
      - POSTGRES_USER=onlyoffice
      - POSTGRES_HOST_AUTH_METHOD=trust
    restart: always
    expose:
      - '5432'
    volumes:
      - /zfs/docker/data/onlyoffice-postgresql:/var/lib/postgresql
    networks:
      - onlyoffice

networks:
  traefik:
    external: true
  onlyoffice:
    external: true
  nextcloud:
    external: true

And here is the output of service --status-all on the docker of documentserver, rabbitmq, and postsql. From the output shown below, looks like rabbitmq service is not running on rabbitmq host, but it’s running on documentserver host? It’s weired…

documentserver:
[ - ] dbus
[ ? ] hwclock.sh
[ + ] nginx
[ - ] postgresql
[ - ] procps
[ - ] rabbitmq-server
[ - ] redis-server
[ + ] supervisor
[ - ] sysstat
[ - ] unattended-upgrades
[ - ] x11-common

rabbitmq:
[ ? ] hwclock.sh
[ - ] procps

postgresql:

[ ? ] hwclock.sh
[ - ] postgresql

Please check if all required ports are opened on the host machine. The list of all ports that Document Server uses can be found here:
https://helpcenter.onlyoffice.com/installation/docs-community-open-ports.aspx

In general, can you share a link where did you obtain original .yml file? What was the point of commenting out ports section in it? Have you tried using this guide?

I installed as windows service and I am getting same error.

Hello @Harishkumar
I believe we have to start from scratch:

  • please point me to the guide which you used for Document server installation (let us know your OS as well)
  • reproduce the situation and record a video file\make screenshots
  • provide us with whole Document server logs folder (when the situation is reproduced). For Windows, it’s located here: Program Files (x86)\Ascensio System SIA\DocumentServer\Log