Nextcloud instance unreachable from Android client without VPN

Support intro

Sorry to hear youā€™re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If youā€™re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isnā€™t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 20.0.7
Operating system and version: Ubuntu 18.04 on Linux 4.15.0-135-generic x86_64
Apache or nginx version: can't find it
PHP version (eg, 7.4): 7.4.15

The issue you are facing:
My NC instance is unreachable from the Android app, which only happens without an active VPN connection.
My setup has NC and Traefik v2 in a two docker containers in the same network. Traefik is handling reverse proxying to and from Nextcloud.
Everything works fine on my desktop, regardless of being connected to a VPN.

I have a feeling this has to do with my phoneā€™s DNS settings, so I changed them from Cloudflare to Quad9, no luck. I tried disconnecting from my VPN and using cellular data, it times out (guessing its unreachable due to IPv6 issues). I monitored Traefikā€™s requests through docker logs --follow traefik | grep nextcloud and none came (besides the ones when vpn enabled).
Iā€™m really not sure whatā€™s going on and Iā€™ve been scratching my head for a few days.

Is this the first time youā€™ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Log into NC instance on Android app with an active VPN connection. Everything works
  2. Disconnect from VPN
  3. ā€œServer not availableā€ above directory listing

The output of your Nextcloud log in Admin > Logging:

{"reqId":"WmnjokZAh400FJrtnGEs","level":2,"time":"2021-02-16T03:49:48+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"WmnjokZAh400FJrtnGEs","level":2,"time":"2021-02-16T03:49:48+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"IND36nO3kJBKxJhyQFaq","level":2,"time":"2021-02-16T03:49:48+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"IND36nO3kJBKxJhyQFaq","level":2,"time":"2021-02-16T03:49:48+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"ZeXVgfWr97XPS7Ss3wIi","level":2,"time":"2021-02-16T03:49:49+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"ZeXVgfWr97XPS7Ss3wIi","level":2,"time":"2021-02-16T03:49:49+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"trrdUQ80gekYpj78Jqsb","level":3,"time":"2021-02-16T03:50:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":653,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1091,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":42,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":283,"CustomMessage":"--"},"userAgent":"--","version":""}
{"reqId":"eNPZ38lM8M1xrzhbQoUN","level":2,"time":"2021-02-16T03:50:17+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"eNPZ38lM8M1xrzhbQoUN","level":2,"time":"2021-02-16T03:50:17+00:00","remoteAddr":"8.45.41.211","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":""}
{"reqId":"9Fp2Dr6kL3aFB2KtPl9C","level":3,"time":"2021-02-16T03:52:56+00:00","remoteAddr":"8.45.41.211","user":"justin","app":"index","method":"GET","url":"/apps/theming/icon/files?v=0","message":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/private/Files/AppData/AppData.php","line":157,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":155,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/ImageManager.php","line":170,"function":"getCacheFolder","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":164,"function":"getCachedImage","class":"OCA\\Theming\\ImageManager","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"getTouchIcon","class":"OCA\\Theming\\Controller\\IconController","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Files/Node/Folder.php","Line":167,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":"20.0.7.1"}
{"reqId":"Y5fZp5Dreyk292A4ERKn","level":3,"time":"2021-02-20T04:43:59+00:00","remoteAddr":"8.45.41.211","user":"justin","app":"PHP","method":"POST","url":"/apps/support/generateSystemReport","message":{"Exception":"Error","Message":"Undefined index: readonly at /config/www/nextcloud/apps/support/lib/Sections/ServerSection.php#268","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/support/lib/Sections/ServerSection.php","line":268,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"function":"OCA\\Support\\Sections\\{closure}","class":"OCA\\Support\\Sections\\ServerSection","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/apps/support/lib/Sections/ServerSection.php","line":257,"function":"array_map"},{"file":"/config/www/nextcloud/apps/support/lib/Sections/ServerSection.php","line":84,"function":"getExternalStorageInfo","class":"OCA\\Support\\Sections\\ServerSection","type":"->"},{"function":"__construct","class":"OCA\\Support\\Sections\\ServerSection","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":101,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":109,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":455,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":427,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":101,"function":"array_map"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":109,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":455,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":427,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":139,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":"20.0.7.1"}
{"reqId":"Y5fZp5Dreyk292A4ERKn","level":3,"time":"2021-02-20T04:43:59+00:00","remoteAddr":"8.45.41.211","user":"justin","app":"PHP","method":"POST","url":"/apps/support/generateSystemReport","message":{"Exception":"Error","Message":"Undefined index: readonly at /config/www/nextcloud/apps/support/lib/Sections/ServerSection.php#268","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/support/lib/Sections/ServerSection.php","line":268,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"function":"OCA\\Support\\Sections\\{closure}","class":"OCA\\Support\\Sections\\ServerSection","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/apps/support/lib/Sections/ServerSection.php","line":257,"function":"array_map"},{"file":"/config/www/nextcloud/apps/support/lib/Sections/ServerSection.php","line":84,"function":"getExternalStorageInfo","class":"OCA\\Support\\Sections\\ServerSection","type":"->"},{"function":"__construct","class":"OCA\\Support\\Sections\\ServerSection","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":101,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":109,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":455,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":427,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":101,"function":"array_map"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":109,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":455,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":427,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/AppFramework/App.php","line":139,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/config/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/config/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/config/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":"20.0.7.1"}
{"reqId":"hI8EqfeLGrHgvsf1CQp4","level":2,"time":"2021-02-20T05:01:53+00:00","remoteAddr":"8.45.41.211","user":"--","app":"core","method":"GET","url":"/s/MRdwT3ndLiYjn43","message":"Renewing session token failed","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0","version":"20.0.7.1"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => '-----',
  'passwordsalt' => '-----',
  'secret' => '-----',
  'trusted_proxies' =>
  array (
    0 => '172.22.*.*',
  ),
  'trusted_domains' =>
  array (
    0 => 'nextcloud.itsa.computer',
    1 => '172.22.*.*',
  ),
  'dbtype' => 'mysql',
  'version' => '20.0.7.1',
  'overwrite.cli.url' => 'https://nextcloud.itsa.computer',
  'dbname' => 'nextcloud',
  'dbhost' => 'db:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '-----',
  'dbpassword' => '-----',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

none

Iā€™ve attached my docker-compose.yml and docker inspect nextcloud/traefik

Do you still have this issue? I seem to have a similar problem where accessing Nextcloud from the Nextcloud Android app while on the same wifi network is fine, but using a cellular internet connection gives ā€˜server not availableā€™. When I use cellular + VPN I am able to access the server though (note this is a generic VPN, not a VPN to the network where the Nextcloud server is located). Interestingly, if I use cellular + PCAPdroid (a network monitoring app, which creates a fake VPN), I am also able to access the server.

What phone do you use? Iā€™m on a Samsung S10.

Yeah, still having this issue. It gets very problematic when using automatic uploads. Iā€™m on a Pixel 2 XL.

Did you ever come up with a solution to this? Iā€™m having the same issue as well. Itā€™s not a bad thing to constantly run my VPN I suppose, but it is confusing.
Also my Nextcloud instance is running via Docker, if that factors in at all.