ONLYOFFICE cannot be reached. Please contact admin

Bought a linux shared hosting service on a cloud provider to host my wordpress site.

Did a fresh of NC 18, followed by the Community Document Server (the timeout issue solved) and then the ONLYOFFICE conector app.

NC works just fine.

When I try to open/edit a new document, the result is “ONLYOFFICE cannot be reached. Please contact admin”.

Server configuration detail

Operating system: Linux 3.10.0-962.3.2.lve1.5.28.el7.x86_64
Webserver: Apache (litespeed)
Database: mysql 5.7.29
PHP version: 7.3.16
Nextcloud version: 18.0.3 -

“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“dbtype”: “mysql”,
“version”: “”,
“overwrite.cli.url”: “https://mydomain/nextcloud”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“installed”: true,
“mail_smtpmode”: “smtp”,
“mail_smtpsecure”: “ssl”,
“mail_sendmailmode”: “smtp”,
“mail_from_address”: “REMOVED SENSITIVE VALUE”,
“mail_smtpauthtype”: “PLAIN”,
“mail_smtpauth”: 1,
“mail_smtphost”: “REMOVED SENSITIVE VALUE”,
“mail_smtpport”: “465”,
“mail_smtpname”: “REMOVED SENSITIVE VALUE”,
“mail_smtppassword”: “REMOVED SENSITIVE VALUE”,
“maintenance”: false

My ONLYOFFICE automatic configuration is:

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 try to open/edit a OO document.

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.

I’ve tryed with FF, IE and EDGE with admin user and a regular user. Same error result.
The browser is trying to access:

While inspecting the site I saw that api.js is blocked due to a mime tpe discrepancy (!?):
SEC7112: The https://mydomain/nextcloud/index.php/apps/documentserver_community/web-apps/apps/api/documents/api.js script has been blocked due
to a mime type discrepancy

I can also see this while inspecting the site:
div id=“app”
div id=“iframeEditor”
data-inframe="" /div
src=“https://mydomain/nextcloud/index.php/apps/documentserver_community/web-apps/apps/api/documents/api.js” type=“text/javascript” /script

My NC 18 Logging states:
Exception: fclose() expects parameter 1 to be resource, null given at <>

  1. /mydomain/nextcloud/lib/private/AppFramework/App.php line 125
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\DocumentServ … {}, “webApps”)
  2. /mydomain/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main(“OCA\DocumentSe … r”, “webApps”, OC\AppFramework\ … {}, {path: "apps/api … "})
  3. <>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({path: "apps/api … "})
  4. /mydomain/nextcloud/lib/private/Route/Router.php line 299
    call_user_func(OC\AppFramework\ … {}, {path: "apps/api … "})
  5. /mydomain/nextcloud/lib/base.php line 1008
    OC\Route\Router->match("/apps/documents … s")
  6. /mydomain/nextcloud/index.php line 38

Caused by TypeError: fclose() expects parameter 1 to be resource, null given
0. /mydomain/nextcloud/apps/documentserver_community/lib/Document/ConverterBinary.php - line 53:

  1. /mydomain/nextcloud/apps/documentserver_community/lib/Document/ConverterBinary.php - line 72:
  2. /mydomain/nextcloud/apps/documentserver_community/lib/SetupCheck.php - line 34:
  3. /mydomain/nextcloud/apps/documentserver_community/lib/Controller/StaticController.php - line 89:
  4. /mydomain/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 170:
  5. /mydomain/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 99:
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Document … {}, “webApps”)
  6. /mydomain/nextcloud/lib/private/AppFramework/App.php - line 125:
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Document … {}, “webApps”)
  7. /mydomain/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:
    OC\AppFramework\App::main(“OCA\Docume … r”, “webApps”, OC\AppFramew … {}, { path: "app … "})
  8. <>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({ path: "app … "})
  9. /mydomain/nextcloud/lib/private/Route/Router.php - line 299:
    call_user_func(OC\AppFramew … {}, { path: "app … "})
  10. /mydomain/nextcloud/lib/base.php - line 1008:
    OC\Route\Router->match("/apps/docum … s")
  11. /mydomain/nextcloud/index.php - line 38:

[PHP] Error: proc_open() has been disabled for security reasons at /mydomain/nextcloud/apps/documentserver_community/lib/Document/ConverterBinary.php#51

Anyone that got any clue about this?
Thanks in advance

I just encountered the same error after onlyoffice ran well for a couple of weeks. Is there a starting point where to look for logging as I cannot find anything in …/data/nextcloud.log, syslog or apache/error.log !

just found MY root-cause: I changed the FQDN to my server but onlyoffice does only accept original FQDN, because I configured it in the server-settings. Though nextcloud can bea reached via multiple FQDNs, Onlyoffice does work togther with NC only if you use the FQDN specified in the settings… But my question remains: where do logs exist?

I think I have a solution, if you are using a self-signed SSL certificate like me.

You’ll most likely need to have " ‘allow_local_remote_servers’=>true" in your config.php. The URL you enter to the settings in the Nextcloud->settings->ONLYOFFICE section needs to be an address that is reachable from both the nextcloud server and your browser. I also struggled when the Onlyoffice configuration seemed to go well, but when I tried to use the editor the same message popped up. Then I navigated to the URL in the settings on my browser, accepted the certificate, and voila, it started working.

I guess since the Onlyoffice editor is Javascript and runs in your browser instead of the server, the connection gets bounced because of the unsigned certificate. But when you accept the cert first, everything works. There might be a setting for the editor to accept self-signed certificates, but I couldn’t find one.

Hope this helps.