ONLYOFFICE cannot be reached. Please contact admin : OnlyOffice + Nextcloud (docker)

Hi all and thanks a lot to anyone reading this (* ˘⌣˘)◞

Some context :

  • ONLYOFFICE cloud: CE docker version 7.0.1.37
  • NC ONLYOFFICE Client App : 7.3.2
  • NC 21.0.9 (for now)
sudo docker exec oo sudo supervisorctl status
ds:converter                     RUNNING   pid 1193, uptime 0:19:10
ds:docservice                    RUNNING   pid 1186, uptime 0:19:13
ds:example                       RUNNING   pid 7415, uptime 0:00:16
ds:metrics                       RUNNING   pid 784, uptime 0:25:27

It seems NC ONLYOFFICE Client app is « working » fine as I don’t have any error message when I configure it, I don’t need to set any external specific domain or https as I wan’t OO working within my local network. I access NC from the Internet though, specific certbot wildcards with nginx reverse proxies do what I need for ssl/https subdomains. I did not configure anything yet to make oo open to the outside.

Screenshot of OO NC App :

Also test server is « working » fine as I tested it in different browsers.

But still, when I’m in ittle red message appears saying ONLYOFFICE cannot be reached. Please contact admin ✖ on Nextcloud.

I made some research but couldn’t find anything and tried to re-create and reinstall different ways to make oo work within nc.

I didn’t want to configure oo to be open to the Internet (except within NC when I’m logged to NC), do you think this would be the problem ? Or anyhting else I did wrong ?

EDIT : I could not find anything relevant in my logs, but if needed I can grep or try looking for whatever you tell me to look at :slight_smile:

Thanks a bunch again,
roz

Hello,
Please try to access the document editor => open the browser Dev Tools (F12 in Chrome/Firefox) => refresh the page and make a screenshot of error messages in Console and Network tab if there are any.

Thanks a lot, I took screenshot of first request as it may contained some interesting infos I guess, others (app.svg & notifications.svg come from other NC apps).

This error from api.js, 172.19.0.5 is my oo container ip, it does same error i use its local network host ip address :

¯\(ツ)

edit : trying to be more specific, typo

Please make a screenshot where I can see the full path to api.js (or copy it here).

If api.js can’t be loaded, the document editor won’t work. Is there any extension that blocks js files in your Firefox? Please try reproducing the issue in any other browser and let me know the result.

http://192.168.XXX.XXX:8018/web-apps/apps/api/documents/api.js

Here is a curl :

curl ‘http://192.168.XXX.XXX:8018/web-apps/apps/api/documents/api.js
-H 'Referer: ’
–compressed

I just tested right now with Version 101.0.4951.64 (Official Build, ungoogled-chromium) (before it was Firefox), extensions : Privacy Badger, HTTPS Everywhere, uBlock Origin, Decentraleyes, Cookie AutoDelete

You have to set an external address of the Document Server in the connector settings. When local DS address is set instead of an external one, users will be able to open documents only when they are in your local network because user’s browser must have access to the api.js script, and it is impossible to access 192.x.x.x address from outside of your network.

It doesn’t even work on LAN, but I’ll try , thanks again

Hi & thanks again @Carl !

I did configure my reverse proxy (nginx) to have external domain on oo, and it improved ! I can now open files but can’t edit them :

The document could not be saved. Please check connection settings or contact your administrator.

I have no specific error logs in Nextcloud or OO :s

Here are some nginx errors from my container (which I use to make oo work on my external domain). This external domain is trusted by nextcloud as I put it in config.php. Now I don’t know what to do ¯\(ツ)/

/var/log/nginx/oo.error_log ─2022/05/22 22:09:31 [info] 2174278#2174278: *319808 epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: 77.198.1│
/var/log/nginx/oo.access_log┌XXX.XXX.XXX.XX - - [22/May/2022:22:09:31 +0200] "GET /7.0.1-37/doc/4081651026/c/info?t=1653250170715 HTTP/1.1" 200 108 "https://oo.XXX.COM/7.0.1-37/web-apps/apps/documenteditor/main/index_loader.html?│
/var/log/nginx/oo.access_log└XXX.XXX.XXX.XX - - [22/May/2022:22:09:31 +0200] "GET /7.0.1-37/sdkjs/common/Images/icons/anchor.png HTTP/1.1" 499 0 "https://oo.XXX.COM/7.0.1-37/web-apps/apps/documenteditor/main/index_loader.html?_dc│
/var/log/nginx/oo.error_log ─2022/05/22 22:09:36 [info] 2174278#2174278: *319831 epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while reading upstream, client: XXX.XXX.XXX.XX, serv│
/var/log/nginx/oo.access_log┌XXX.XXX.XXX.XX - - [22/May/2022:22:09:36 +0200] "GET /cache/files/4081651026/Editor.bin/Editor.bin?md5=JbW4sKjooZW-rQfzXCSNhQ&expires=1655844765&filename=Editor.bin HTTP/1.1" 200 1426 "https://oo.roselove.p│
/var/log/nginx/oo.access_log└XXX.XXX.XXX.XX - - [22/May/2022:22:09:36 +0200] "GET /7.0.1-37/fonts/032 HTTP/1.1" 200 97913 "https://oo.XXX.COM/7.0.1-37/web-apps/apps/documenteditor/main/index_loader.html?_dc=7.0.1-37&lang=en&custo│
/var/log/nginx/oo.error_log ─2022/05/22 22:09:37 [info] 2174278#2174278: *319834 epoll_wait() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: 77.198.1│
/var/log/nginx/oo.access_log┌XXX.XXX.XXX.XX - - [22/May/2022:22:09:37 +0200] "GET /7.0.1-37/plugins.json HTTP/1.1" 304 0 "https://oo.XXX.COM/7.0.1-37/web-apps/apps/documenteditor/main/index_loader.html?_dc=7.0.1-37&lang=en&custom│
/var/log/nginx/oo.access_log│XXX.XXX.XXX.XX - - [22/May/2022:22:09:37 +0200] "GET /7.0.1-37/themes.json HTTP/1.1" 304 0 "https://oo.XXX.COM/7.0.1-37/web-apps/apps/documenteditor/main/index_loader.html?_dc=7.0.1-37&lang=en&custome│
/var/log/nginx/oo.access_log└XXX.XXX.XXX.XX - - [22/May/2022:22:09:37 +0200] "GET /7.0.1-37/sdkjs-plugins/macros/resources/dark/icon.png HTTP/1.1" 499 0 "https://oo.XXX.COM/7.0.1-37/web-apps/apps/documenteditor/main/index_loader.│
/var/log/nginx/oo.error_log ┌2022/05/22 22:09:42 [info] 2174278#2174278: *319837 client closed connection while waiting for request, client: XXX.XXX.XXX.XX, server: 0.0.0.0:443                                                           

Also here are my nextcloud app settings which does work too, I have no errors here ^^

Thanks again !

Hi,
Please send your Document Server logs from /var/log/onlyoffice/documentserver/ (path inside the container)

Here it is, X.XXX for local ip & site.org for domain, thanks a lot again
(´・` ):heart:

https://drop.picasoft.net/r/7xureqFX#NZA0WeB2Qb6cIZdy7pcOawLSQ4uGZaFOFTsC8PBgTmU=

Hello @roz
Could you please run a test? Please go to Nextcloud config.php file and add this line:
‘allow_local_remote_servers’ => true,

After that please reproduce the issue (click Save button on the connector page and try to open any file for editing).
Please let me know the result.

1 Like

Hi,

According to logs the Document Server tries to download files using local IP address instead of the domain name and these attempts fails. The most possible reason is that x-forwarded-host header is missing in the proxy config.

When setting up a proxy server in front of the Document Server, please use our examples:

Hi @Carl & thanks again, I’m pretty sure I would offer you a tea or a beer some day
(* ˘⌣˘)◞

I think we’re very (very) close to it but my nginx skills are very low, I still have the same message « The document could not be saved. Please check connection settings or contact your administrator. »… Sorry… Here is my nginx host conf’ for oo docker container :

upstream docservice {
  server oo.SITE.ORG;
}

map $http_host $this_host {
    "" $host;
    default $http_host;
}

map $http_x_forwarded_proto $the_scheme {
     default $http_x_forwarded_proto;
     "" $scheme;
}

map $http_x_forwarded_host $the_host {
    default $http_x_forwarded_host;
    "" $this_host;
}

map $http_upgrade $proxy_connection {
  default upgrade;
  "" close;
}

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

## Normal HTTP host
server {
  listen 0.0.0.0:8018;
  listen [::]:80 default_server;
  server_name _;
  server_tokens off;

  ## Redirects all traffic to the HTTPS host
  return 301 https://$server_name:443$request_uri;
}

server {
  listen 0.0.0.0:4318 ssl;
  listen [::]:443 ssl default_server;
  server_tokens off;
  root /usr/share/nginx/html;

  access_log /var/log/nginx/oo.SITE.ORG;
  error_log /var/log/nginx/oo.SITE.ORG;

  # ssl on; -> Seems deprecated...
  ssl_certificate /etc/mycerts/SITE.ORG/fullchain.pem;
  ssl_certificate_key /etc/mycerts/SITE.ORG/privkey.pem;
  ssl_verify_client off;

  ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";

  ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
  ssl_session_cache  builtin:1000  shared:SSL:10m;

  ssl_prefer_server_ciphers   on;

  location / {
    proxy_pass http://docservice;
    proxy_http_version 1.1;
  }
}

docker ps from oo :

582bb7637553   onlyoffice/documentserver:7.0.1.37    "/app/ds/run-documen…"   21 hours ago    Up 14 minutes    0.0.0.0:8018->80/tcp, :::8018->80/tcp, 0.0.0.0:4318->443/tcp, :::4318->443/tcp     oo-7.0.1

I have disabled ONLYOFFICE Docs address for internal requests from the server to make all this a little bit messy :

Here are my logs from documentserver folder :
https://drop.picasoft.net/r/0SMmMdjb#3stFjV0/OuIKyHNqBdihAh55jUl3BmBAzuaIKOZbpSs=

Some error I found from these logs are about my IPV4 Gateway (172.19.0.1) that is used between my nextcloud docker & my oo docker. I don’t understand that, somehow I’m trying to think my nginx configuration is ok and maybe my problem is somewhere else.

Thanks again, I think I’ll stop asking after your answer (if you wan’t to) as I took you so much of your time ;\

PS : Sorry @Alexandre I didn’t answer to you ! ‘allow_local_remote_servers’ => true, was already set, also I have set some trusted_domains ^^

Hi, sorry for the delayed reply.

There are now document saving errors in the log. The Document Server receives this response when attempting to save the file:

Error: Error response: statusCode:301; headers:{"server":"nginx/1.18.0","date":"Mon, 23 May 2022 16:43:48 GMT","content-type":"text/html","content-length":"169","connection":"keep-alive","location":"https://nextcould.SITE.ORG/apps/onlyoffice/track?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiJyb3psYXYiLCJmaWxlSWQiOjEzMjEzNCwiZmlsZVBhdGgiOiJcL2pqampqampqai54bHN4Iiwic2hhcmVUb2tlbiI6bnVsbCwiYWN0aW9uIjoidHJhY2sifQ.HoGXGziCuM5UMHMgyJqqZZ8hFph6dWep97ZAQnZL3Q4"}; body:
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>

This looks like some redirect issue in the proxy of your Nextcloud.

I have the same issue using docker
I used this docker command docker run -i -t -d -p 8478:80 --restart=always onlyoffice/documentserver
which the port is using 8478, outside of the docker I have nginx proxy_pass http:127.0.0.1:8478;
issues:
Working on internal network by ip 192.168.1.103:8478
Working on public ip network by ip 232...322:8478
Not working with nginx SSL office.example.com
the document could not be saved. Please check connection setting ot contact your administrator

Hello @weasam
Let’s start from scratch. Please reproduce the issue and provide us with whole Document server logs folder. Also please check out your DNS settings, make sure that your domain name resolves to necessary ip address.

1 Like