NGINX: ONLYOFFICE cannot be reached. Please contact admin

Server configuration(s)

Nextcloud version:12.0.0
Operating system and version: Ubuntu 16.04
Apache or nginx version: Apache 2.4.18
PHP version: 7.0.18
Mysql version: MariaDB 10.1.25

Onlyoffice version:(unsure how to check it)
Operating system and version: Ubuntu 16.04
Apache or nginx version: nginx/1.10.3 (Ubuntu)
SQL version: postgres (PostgreSQL) 9.5.7

Is this the first time you’ve seen this error?:
Yes it is.

Can you reliably replicate it? (If so, please outline steps):
Yes. I have gotten this error message everytime I have been trying to reinstall onlyoffice (Tried different technics everytime (Docker twice and nginx))


The issue you are facing:
When I’m trying to access onlyoffice via Nextcloud I get ONLYOFFICE cannot be reached. Please contact admin as an error message in the browser:

But the thing is that when I’m accessing my nextcloud client with my google account I can access Onlyoffice with no problem (even in incognito mode), but if i’m trying to access it with another browser or another google accout, then I’ll get the “ONLYOFFICE cannot be reached. Please contact admin” error message.

I did try to “remove” the access from my google account with deleting everything on my google account history the past 1 day (except browsing history (but everything else (This is in Google Chrome))). After doing these steps I still had “access” to onlycloud without the error message, but as soon as I deleted the browsing history the access were gone and i did get “ONLYOFFICE cannot be reached. Please contact admin” on my Google account aswell. But while trying to inspect what is going on on the site while pressing f5 I re-gain my “access” to the Onlyoffice client again on my google account. But still no access somewhere else.

While inspecting the site I saw that api.js is failing to respond:

Anyone that got any clue about this?

Thanks in advance
/Rojz

As always: what to the logs say? :wink:

I’m really unsure when it comes to Onlyoffice, is it the log from Nextcloud or Onlyoffice? And if Onlyoffice, where can i find it or what is the name of it?

While you try to access Onlyoffice from the Nextcloud GUI check the NC logs first. I would check every log:
nextcloud.log (in NC data folder by default)
error.log (from NC web server)
syslog (maybe journalctl)

The logs don’t really say anything. no errors or anything

I have been looking in:

NC:
error.log
nextcloud.log
syslog

Onlyoffice:
syslog

While inspecting the site I saw that api.js is failing to respond:

Please make sure that the link to the /web-apps/apps/api/documents/api.js is available under different accounts.
Try opening this link from different browsers. The issue may be in some extra access settings

The whole nextcloud folder is under www-data at the moment.

I got the same problem with Microsoft Edge, Firefox, Opera and Google Chrome (my main browser) and I think that my Co-worker is using Safari and same there.

EDIT:
I’m not sure if I stated that in my first post… But I can access onlyoffice with whatever account I want in my nextcloud IF I’m on my login to my Google account on Google Chrome. I have been trying with 3 nextcloud accounts and all of them have been working. But as soon as I change browser or Google Account. That error message appears.

But as soon as I change browser or Google Account. That error message appears.

It means that you only have access to the .int domain (shown on your screenshot) if you are logged in under you google account. Please try opening the https:///web-apps/apps/api/documents/api.js in the browser (just copy and paste the link to the address bar)

Server not found

Firefox can’t find the server at web-apps.

Check the address for typing errors such as ww.example.com instead of www.example.com
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

I can add now that it seems like the nextcloud / onlyoffice integration works for Google Chrome now somehow, without me doing anything… But still doesn’t work for any browser outside of Chrome…

EDIT:
ONe co-worker did get it to work on Firefox somehow… but no one else get it to work.

Do they have access to https://onlyoffice.xxx.xxx/ ?

They should have it yes. Becasue it’s an internal network, and I’m on the same network as they are.

As I said before. I can access it on chrome but not on Firefox. and with “but no one else get it to work.” I meant get it to work on firefox.

ibnpetr20m
Just ask them to open the link https://onlyoffice.xxx.xxx/web-apps/apps/api/documents/api.js in FF or Edge
This link is not available from my side for example, it means that I cannot use your ONLYOFFICE

This worked and i’m no able to access Onlyoffice with Chrome, Firefox and Edge. Thanks alot! :smiley:

EDIT: Only I had to do it to get it to work for everyone somehome… Not sure if a bug or anything, but if it doesn’t work for everyone when you are doing it… I guess they will have to enter that site too.

Hi rojz,

I have the same inconvenience, and if I can access the link that decides. But when I want to edit or create a new document, I get this message:

I can not save this document. Please check the connection settings or contact the admin.
Clicking accept will ask you to download the document.

I set the https pointing to port 8843, will have something to do?

Thank

The issue is that the DocumentServer cannot access Nextcloud and download the file from the storage.
One of the possible solutions for CentOS and derivatives is the firewall exception:
(do not forget to change the port)
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload

I have it under UBUNTU and the UFW I have it in an inactive state.

Do I have to activate and configure which ports?

Thank

@Martin_Remersaro
Could you please send us log files of the nextcloud (/data/nextcloud.log)

good day

I pass the image of the logs they find on the server, because I can not see any file with the name you indicated.

Thank you very much

onlyoffice logs

Please send the log files from the nextcloud admin>>logging section.
btw please provide any additional information about the environment, i.e. are you using docker version of the document server? what is the address you use in the onlyoffice connector?
Make sure that the nextcloud server is accessible from the document server container/server.

Dear ibnpetr
Here I send the link where I put the problem and which version of onlyoffice I am using to see if that information is useful to see the problem?