[GH-ISSUE #354] Error since NC19: Host localhost was not connected to because it violates local access rules #81

Closed
opened 2026-02-26 05:32:54 +03:00 by kerem · 2 comments
Owner

Originally created by @onny on GitHub (Jun 11, 2020).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/354

Hey,
since the update to NC 19 I'm unable to use twofactor_gateway. I'm using Signal as a backend and configured the local gateway (running on localhost).
This is the eror message:

{"reqId":"75QtYFSoklfKToORtR2t","level":2,"time":"2020-06-11T15:37:47+00:00","remoteAddr":"****","user":"onny","app":"no app in context","method":"GET","url":"/index.php/login/challenge/gateway_signal","message":"Host localhost 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/83.0.4103.61 Safari/537.36","version":"19.0.0.12"}
{"reqId":"75QtYFSoklfKToORtR2t","level":3,"time":"2020-06-11T15:37:47+00:00","remoteAddr":"****","user":"onny","app":"index","method":"GET","url":"/index.php/login/challenge/gateway_signal","message":{"Exception":"OCP\\Http\\Client\\LocalServerException","Message":"Host violates local access rules","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/lib/private/Http/Client/Client.php","line":293,"function":"preventLocalAddress","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/twofactor_gateway/lib/Service/Gateway/Signal/Gateway.php","line":70,"function":"post","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/twofactor_gateway/lib/Provider/AProvider.php","line":114,"function":"send","class":"OCA\\TwoFactorGateway\\Service\\Gateway\\Signal\\Gateway","type":"->"},{"file":"/usr/share/webapps/nextcloud/core/Controller/TwoFactorChallengeController.php","line":158,"function":"getTemplate","class":"OCA\\TwoFactorGateway\\Provider\\AProvider","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"showChallenge","class":"OC\\Core\\Controller\\TwoFactorChallengeController","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":1007,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/share/webapps/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/share/webapps/nextcloud/lib/private/Http/Client/Client.php","Line":171,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36","version":"19.0.0.12"}

I'm using the latest version of the app, 0.16.
Best regards
Jonas

Originally created by @onny on GitHub (Jun 11, 2020). Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/354 Hey, since the update to NC 19 I'm unable to use twofactor_gateway. I'm using Signal as a backend and configured the local gateway (running on localhost). This is the eror message: ``` {"reqId":"75QtYFSoklfKToORtR2t","level":2,"time":"2020-06-11T15:37:47+00:00","remoteAddr":"****","user":"onny","app":"no app in context","method":"GET","url":"/index.php/login/challenge/gateway_signal","message":"Host localhost 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/83.0.4103.61 Safari/537.36","version":"19.0.0.12"} {"reqId":"75QtYFSoklfKToORtR2t","level":3,"time":"2020-06-11T15:37:47+00:00","remoteAddr":"****","user":"onny","app":"index","method":"GET","url":"/index.php/login/challenge/gateway_signal","message":{"Exception":"OCP\\Http\\Client\\LocalServerException","Message":"Host violates local access rules","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/lib/private/Http/Client/Client.php","line":293,"function":"preventLocalAddress","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/twofactor_gateway/lib/Service/Gateway/Signal/Gateway.php","line":70,"function":"post","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/twofactor_gateway/lib/Provider/AProvider.php","line":114,"function":"send","class":"OCA\\TwoFactorGateway\\Service\\Gateway\\Signal\\Gateway","type":"->"},{"file":"/usr/share/webapps/nextcloud/core/Controller/TwoFactorChallengeController.php","line":158,"function":"getTemplate","class":"OCA\\TwoFactorGateway\\Provider\\AProvider","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"showChallenge","class":"OC\\Core\\Controller\\TwoFactorChallengeController","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":1007,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/share/webapps/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/share/webapps/nextcloud/lib/private/Http/Client/Client.php","Line":171,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36","version":"19.0.0.12"} ``` I'm using the latest version of the app, 0.16. Best regards Jonas
kerem closed this issue 2026-02-26 05:32:54 +03:00
Author
Owner

@ChristophWurst commented on GitHub (Jun 15, 2020):

You you check related reports? This was also found in other Nextcloud related posts like https://help.nextcloud.com/t/violates-local-access-rules-in-talk-9/84471/2

<!-- gh-comment-id:643932573 --> @ChristophWurst commented on GitHub (Jun 15, 2020): You you check related reports? This was also found in other Nextcloud related posts like https://help.nextcloud.com/t/violates-local-access-rules-in-talk-9/84471/2
Author
Owner

@onny commented on GitHub (Jul 12, 2020):

cool thank you @ChristophWurst, setting 'allow_local_remote_servers' => true, into config.php solved the issue for me :)

<!-- gh-comment-id:657196692 --> @onny commented on GitHub (Jul 12, 2020): cool thank you @ChristophWurst, setting ` 'allow_local_remote_servers' => true,` into config.php solved the issue for me :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/twofactor_gateway-nextcloud#81
No description provided.