Error when trying to connect (Host violates local access rules) - Onlyoffice

Error appeared after upgrading to 22.2.0 this configuration has been working for years and now I cant connect Onlyoffice. Any help to try and fix this would be greatly appreciated.

I tried adding this into my config but when added it breaks everything ‘allow_local_remote_servers’ => true, I have to leave it out as of now. Last thing to note is the fact that I am using a reverse proxy on a separate server.

“app”:“onlyoffice”,“method”:“PUT”,“url”:“/index.php/apps/onlyoffice/ajax/settings/address”,“message”:“HealthcheckRequest on check error”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36”,“version”:“22.2.0.2”,“exception”:{“Exception”:“OCP\Http\Client\LocalServerException”,“Message”:“Host violates local access rules”,“Code”:0,“Trace”:[{“file”:“/srv/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php”,“line”:136,“function”:“ThrowIfLocalIp”,“class”:“OC\Http\Client\LocalAddressChecker”,“type”:“->”},{“file”:“/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php”,“line”:35,“function”:“OC\Http\Client\{closure}”,“class”:“OC\Http\Client\DnsPinMiddleware”,“type”:“->”,“args”:[“*** sensitive parameters replaced “]},{“file”:”/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",“line”:31,“function”:“__invoke”,“class”:“GuzzleHttp\PrepareBodyMiddleware”,“type”:“->”},{“file”:“/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php”,“line”:71,“function”:“GuzzleHttp\{closure}”,“class”:“GuzzleHttp\Middleware”,“type”:“::”,“args”:[" sensitive parameters replaced “]},{“file”:”/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",“line”:63,“function”:“__invoke”,“class”:“GuzzleHttp\RedirectMiddleware”,“type”:“->”},{“file”:“/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php”,“line”:75,“function”:“GuzzleHttp\{closure}”,“class”:“GuzzleHttp\Middleware”,“type”:“::”,“args”:[" sensitive parameters replaced ***”]},{“file”:“/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php”,“line”:331,“function”:“__invoke”,“class”:“GuzzleHttp\HandlerStack”,“type”:“->”},{“file”:“/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php”,“line”:168,“function”:“transfer”,“class”:“GuzzleHttp\Client”,“type”:“->”},{“file”:“/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php”,“line”:187,“function”:“requestAsync”,“class”:“GuzzleHttp\Client”,“type”:“->”},{“file”:“/srv/nextcloud/lib/private/Http/Client/Client.php”,“line”:223,“function”:“request”,“class”:“GuzzleHttp\Client”,“type”:“->”},{“file”:“/srv/nextcloud/apps/onlyoffice/lib/documentservice.php”,“line”:364,“function”:“get”,“class”:“OC\Http\Client\Client”,“type”:“->”},{“file”:“/srv/nextcloud/apps/onlyoffice/lib/documentservice.php”,“line”:253,“function”:“Request”,“class”:“OCA\Onlyoffice\DocumentService”,“type”:“->”},{“file”:“/srv/nextcloud/apps/onlyoffice/lib/documentservice.php”,“line”:396,“function”:“HealthcheckRequest”,“class”:“OCA\Onlyoffice\DocumentService”,“type”:“->”},{“file”:“/srv/nextcloud/apps/onlyoffice/controller/settingscontroller.php”,“line”:172,“function”:“checkDocServiceUrl”,“class”:“OCA\Onlyoffice\DocumentService”,“type”:“->”},{“file”:“/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:217,“function”:“SaveAddress”,“class”:“OCA\Onlyoffice\Controller\SettingsController”,“type”:“->”},{“file”:“/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:126,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/srv/nextcloud/lib/private/AppFramework/App.php”,“line”:156,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/srv/nextcloud/lib/private/Route/Router.php”,“line”:301,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/srv/nextcloud/lib/base.php”,“line”:1000,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/srv/nextcloud/index.php”,“line”:36,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/srv/nextcloud/lib/private/Http/Client/LocalAddressChecker.php”,“Line”:42,“CustomMessage”:“HealthcheckRequest on check error”}}

The same thing with me. I updated to onlyoffice 7.2.0 with the minor version there was no problem!?

Hello,
I have the same problem after a complete reinstallation.
Errors in my nextcloud log is the following:

{"reqId":"YiDfyWWW36ejAkly2znRjwAAAAE","level":2,"time":"2022-03-03T15:33:29+00:00","remoteAddr":"192.168.10.250","user":"damien","app":"no app in context","method":"PUT","url":"/index.php/apps/onlyoffice/ajax/settings/address","message":"Host 192.168.10.240 was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.121 Safari/537.36","version":"23.0.2.1"}
{"reqId":"YiDfyWWW36ejAkly2znRjwAAAAE","level":3,"time":"2022-03-03T15:33:29+00:00","remoteAddr":"192.168.10.250","user":"damien","app":"onlyoffice","method":"PUT","url":"/index.php/apps/onlyoffice/ajax/settings/address","message":"HealthcheckRequest on check error","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.121 Safari/537.36","version":"23.0.2.1","exception":{"Exception":"OCP\\Http\\Client\\LocalServerException","Message":"Host violates local access rules","Code":0,"Trace":[{"file":"/var/www/nextcloudHome/lib/private/Http/Client/DnsPinMiddleware.php","line":136,"function":"ThrowIfLocalIp","class":"OC\\Http\\Client\\LocalAddressChecker","type":"->"},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/var/www/nextcloudHome/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/var/www/nextcloudHome/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/var/www/nextcloudHome/apps/onlyoffice/lib/documentservice.php","line":364,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/var/www/nextcloudHome/apps/onlyoffice/lib/documentservice.php","line":253,"function":"Request","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/nextcloudHome/apps/onlyoffice/lib/documentservice.php","line":396,"function":"HealthcheckRequest","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/nextcloudHome/apps/onlyoffice/controller/settingscontroller.php","line":172,"function":"checkDocServiceUrl","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/nextcloudHome/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"SaveAddress","class":"OCA\\Onlyoffice\\Controller\\SettingsController","type":"->"},{"file":"/var/www/nextcloudHome/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloudHome/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloudHome/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloudHome/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloudHome/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloudHome/lib/private/Http/Client/LocalAddressChecker.php","Line":42,"CustomMessage":"HealthcheckRequest on check error"}}

I have verified and already tried to add in my config/config.php file:

‘onlyoffice’ =>
array (
‘verify_peer_off’ => false,
),
‘allow_local_remote_servers’ => true,

OR

‘allow_local_remote_servers’ => true,

I have also tried the following command:

sudo -u www-data php ./nextcloudHome/occ config:system:set allow_local_remote_servers --value true --type bool

I have read many support topics and tried many suggested solutions but it always failed. I have no other idea, please help me my friends

1 Like

Solution is given in below Link