DocumentServer icon indicating copy to clipboard operation
DocumentServer copied to clipboard

ONLYOFFICE cannot be reached. Please contact admin

Open chf0x opened this issue 1 year ago • 2 comments

This issue is unique.

  • [X] I have used the search tool and did not find an issue describing my bug.

Operating System of DocumentServer

Docker

Version information

8.1.3.4

Expected Behavior

I've set up Nextcloud and OnlyOffice, both using Docker, with Traefik as a reverse proxy. This setup has been running smoothly for a few years without any issues

Actual Behavior

After a recent update, something seems to be broken. When I try to open a file with ONLYOFFICE, I get the error message: "ONLYOFFICE cannot be reached. Please contact the admin." I didn't make any changes to my setup, only updated the containers.

image

Interestingly, in the settings, I can see that Nextcloud still detects the ONLYOFFICE instance. When I enter the settings and press "Save," it successfully detects the version. image

Reproduction Steps

I'm not sure how to reproduce this issue. I simply updated the Docker containers, and now it's broken. Please let me know if I can provide any additional logs.

Additional information

I am using Nextcloud Hub 8 (29.0.6)

chf0x avatar Sep 18 '24 22:09 chf0x

Updated to Nextcloud Hub 9 (30.0.0) and OnlyOffice 8.1.3.4. The issue still persists. Is there any temporary workaround available to make it work?

chf0x avatar Oct 10 '24 21:10 chf0x

Hello, I have the same issue.

Nextcloud Server : php occ onlyoffice:documentserver --check -> Document server https://onlyoffice.napo-hub.fr/ version 8.2.0.143 is successfully connected

Web access directly to the onlyoffice welcome page : OK

But if I try to open NextCloud documents with the OnlyOffice integration : ONLYOFFICE cannot be reached. Please contact the admin

Nextcloud Version : 29.0.8 Onlyoffice docker version : 8.2.0.143 Docker version : Docker version 27.1.1, build 6312585

napo789 avatar Oct 17 '24 15:10 napo789

Hello! @chf0x!

Try specifying the address in the "ONLYOFFICE Docs address for internal requests from the server" field the same as in the "ONLYOFFICE Docs address" field. (Ideally, the addresses in these fields should always match).

Is the Document Server opening without any issues on your side? Are you sure you're specifying the Secret Key and Authorization Header correctly?

I tested on clean systems, installed both via packages and Docker. I was unable to reproduce the issue.

Could you describe the scenario for reproducing the problem in more detail?

avdddd1111 avatar Oct 21 '24 15:10 avdddd1111

Hi @avdddd1111,

Thank you for getting back to me. As a test, I set both addresses to onlyoffice, but I'm still seeing the same results.

How can I verify that the document server is opening without issues? From the Docker container network, I can confirm that it's reachable from Nextcloud:

root@8ca92b7643e6:/# curl onlyoffice
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

Regarding the secret key in the header, yes, I'm sure it's correct. As I mentioned, this setup worked flawlessly for over a year until the most recent upgrade.

I'm not sure what additional details would be helpful, but I upgraded both the Nextcloud and OnlyOffice containers, and that's when it stopped working. Could you suggest which logs might help debug this issue? Thanks!

chf0x avatar Oct 22 '24 22:10 chf0x

Hello @chf0x ! Sorry for late reply!

Please update the document server to the latest version. And check if the issue persists.

If the issue persists in the new version, please provide the error logs from Document Server. Could you let us know how it works if you clear the field ONLYOFFICE Docs address for internal requests from the server.

Also, try entering the full HTTPS addresses in the fields for internal requests.

And please provide a detailed curl command for both external and internal requests and a screenshot of the errors from the browser console.

avdddd1111 avatar Dec 04 '24 08:12 avdddd1111

We'd also like to know: you mentioned you're using Docker to deploy it—are you using commands or a Docker Compose file? If you're using Docker Compose, could you please provide the Compose file?

On which port are you running the Document Server ?

avdddd1111 avatar Dec 04 '24 11:12 avdddd1111

Updated to the latest versions, but the issue persists:

Document Server: version 8.2.2.22
Nextcloud: Hub 9 (30.0.3)

Check connection with the Document Server:

server:/# docker exec --user www-data nextcloud_fpm php occ onlyoffice:documentserver --check
Document server https://<document_server_domain>/ version 8.2.2.22 is successfully connected

Switching to HTTPS did not resolve the issue, which was expected since HTTPS is not configured for internal communication. However, leaving the field for the ONLYOFFICE Docs address for internal requests from the server blank caused Nextcloud to stop detecting the ONLYOFFICE instance.

Relevant error log from ONLYOFFICE (But I doubt it is related to this issue). Also I would like to mention that is the only log I have, all others are completely empty:

6:/# cat /var/log/onlyoffice/documentserver/nginx.error.log 
2024/12/07 12:33:40 [error] 784#784: *1 connect() failed (111: Unknown error) while connecting to upstream, client: 172.23.0.5, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice"
2024/12/07 12:33:41 [error] 784#784: *4 connect() failed (111: Unknown error) while connecting to upstream, client: 172.23.0.5, server: , request: "GET /healthcheck HTTP/1.1", upstream: "http://127.0.0.1:8000/healthcheck", host: "onlyoffice"
docker logs nextcloud_onlyoffice
sed: couldn't open temporary file /var/www/onlyoffice/documentserver-example/welcome/sedURNZth: Read-only file system
 * Starting PostgreSQL 14 database server                                [ OK ] 
 * Starting RabbitMQ Messaging Server rabbitmq-server                    [ OK ] 
Starting supervisor: supervisord.
 * Starting periodic command scheduler cron                              [ OK ] 
 * Starting nginx nginx                                                  [ OK ] 
Generating AllFonts.js, please wait...Done
Generating presentation themes, please wait...Done
Generating js caches, please wait...Done
ds:docservice: stopped
ds:docservice: started
ds:converter: stopped
ds:converter: started
 * Reloading nginx configuration nginx                                   [ OK ] 
Installing plugins, please wait...Done
 * Reloading nginx configuration nginx                                   [ OK ] 

==> /var/log/onlyoffice/documentserver/converter/err.log <==

==> /var/log/onlyoffice/documentserver/converter/out.log <==
[2024-12-07T15:41:26.159] [WARN] [localhost] [docId] [userId] nodeJS - num of CPUs: 6; availableParallelism: undefined
[2024-12-07T15:41:26.161] [WARN] [localhost] [docId] [userId] nodeJS - update cluster with 1 workers
[2024-12-07T15:41:26.177] [WARN] [localhost] [docId] [userId] nodeJS - worker 799 started.
[2024-12-07T15:41:26.178] [WARN] [localhost] [docId] [userId] nodeJS - num of CPUs: 6; availableParallelism: undefined
[2024-12-07T15:41:26.178] [WARN] [localhost] [docId] [userId] nodeJS - update cluster with 1 workers
[2024-12-07T15:41:57.182] [WARN] [localhost] [docId] [userId] nodeJS - num of CPUs: 6; availableParallelism: undefined
[2024-12-07T15:41:57.184] [WARN] [localhost] [docId] [userId] nodeJS - update cluster with 1 workers
[2024-12-07T15:41:57.198] [WARN] [localhost] [docId] [userId] nodeJS - worker 938 started.
[2024-12-07T15:41:57.199] [WARN] [localhost] [docId] [userId] nodeJS - num of CPUs: 6; availableParallelism: undefined
[2024-12-07T15:41:57.199] [WARN] [localhost] [docId] [userId] nodeJS - update cluster with 1 workers

==> /var/log/onlyoffice/documentserver/docservice/err.log <==

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2024-12-07T15:41:02.746] [WARN] [localhost] [docId] [userId] nodeJS - active connections: 0
[2024-12-07T15:41:02.747] [WARN] [localhost] [docId] [userId] nodeJS - end shutdown
[2024-12-07T15:41:26.497] [WARN] [localhost] [docId] [userId] nodeJS - Express server starting...
[2024-12-07T15:41:26.503] [WARN] [localhost] [docId] [userId] nodeJS - notifyLicenseExpiration(): expiration date is not defined
[2024-12-07T15:41:26.503] [WARN] [localhost] [docId] [userId] nodeJS - notifyLicenseExpiration(): expiration date is not defined
[2024-12-07T15:41:26.668] [WARN] [localhost] [docId] [userId] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 8.2.2. Build: 22
[2024-12-07T15:41:55.368] [WARN] [localhost] [docId] [userId] nodeJS - Express server starting...
[2024-12-07T15:41:55.375] [WARN] [localhost] [docId] [userId] nodeJS - notifyLicenseExpiration(): expiration date is not defined
[2024-12-07T15:41:55.375] [WARN] [localhost] [docId] [userId] nodeJS - notifyLicenseExpiration(): expiration date is not defined
[2024-12-07T15:41:55.516] [WARN] [localhost] [docId] [userId] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 8.2.2. Build: 22

==> /var/log/onlyoffice/documentserver/nginx.error.log <==

Health check response within container just to confirm that now health-check is positive:

6:/# curl http://127.0.0.1:8000/healthcheck
true

Environment details:

  • Docker-compose + Traefik setup
  • Document Server port: 80

Docker-compose Configuration:

services:
  web:
    image: nginx
    container_name: nextcloud_webserver
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - app
    volumes_from:
      - app
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.nextcloud.rule=Host(`<nextcloud_domain>`)"      
      - "traefik.http.routers.nextcloud.entrypoints=websecure"
      - "traefik.http.routers.nextcloud.tls.certresolver=myresolver"
      - "traefik.http.routers.nextcloud.middlewares=web-compress@file"
      - "traefik.http.services.nextcloud.loadbalancer.server.port=80"
      - "traefik.docker.network=webproxy"
    networks:
      - nextcloud
      - nextcloud-local
    restart: always

  app:
    image: nextcloud:fpm
    container_name: nextcloud_fpm
    links:
      - db
      - redis
    volumes:
      - ./apps:/var/www/html/apps
      - ./custom_apps:/var/www/html/custom_apps
      - ./config:/var/www/html/config
      - ./data:/var/www/html/data
    environment:
      - TRUSTED_PROXIES=<proxy_ip_range>
    restart: always
    networks:
      - nextcloud-local

  onlyoffice:
    image: onlyoffice/documentserver
    container_name: nextcloud_onlyoffice
    stdin_open: true
    tty: true
    volumes:
      - ./disablewelcome:/var/www/onlyoffice/documentserver-example/welcome:ro
      - ./onlyoffice/data:/var/lib/onlyoffice/documentserver/App_Data
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.onlyoffice.rule=Host(`<document_server_domain>`)"
      - "traefik.http.routers.onlyoffice.entrypoints=websecure"
      - "traefik.http.routers.onlyoffice.tls.certresolver=myresolver"
      - "traefik.http.middlewares.onlyoffice-headers.headers.accesscontrolalloworiginlist=*"
      - "traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
      - "traefik.http.routers.onlyoffice.middlewares=onlyoffice-headers,web-compress@file"
      - "traefik.http.services.onlyoffice.loadbalancer.server.port=80"
      - "traefik.docker.network=webproxy"
    environment:
      - JWT_ENABLED=true
      - JWT_SECRET=<jwt_secret>
      - JWT_HEADER=Authorization
    networks:
      - nextcloud
      - nextcloud-local
    restart: always 

  db:
    image: mariadb:11.4
    container_name: nextcloud_db
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=<db_root_password>
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=<db_user_password>
    networks:
      - nextcloud-local
    restart: always

  redis:
    image: redis
    container_name: nextcloud_redis
    volumes:
      - ./redis:/data
    entrypoint: redis-server --appendonly yes
    networks:
      - nextcloud-local
    restart: always

networks:
  nextcloud:
      name: webproxy
      external: true
  nextcloud-local:
    driver: bridge

You can find the detailed curl command and log in the prev message. For external request it is just curl onlyoffice.domain. But getting just timeout there

chf0x avatar Dec 07 '24 14:12 chf0x

I resolved the issue, though I'm not sure what caused it. Having no ideas anymore, I changed the port to 8000, which obviously didn't work since another service is running on that port. However, I did confirm that traffic was properly routed to port 8000. After switching back to port 80, everything suddenly started working properly

      - "traefik.http.services.onlyoffice.loadbalancer.server.port=8000" // and then changed it back to 80

chf0x avatar Dec 07 '24 16:12 chf0x